Files

1943 lines
1.2 MiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const $ of document.querySelectorAll('link[rel="modulepreload"]'))a($);new MutationObserver($=>{for(const c of $)if(c.type==="childList")for(const nt of c.addedNodes)nt.tagName==="LINK"&&nt.rel==="modulepreload"&&a(nt)}).observe(document,{childList:!0,subtree:!0});function s($){const c={};return $.integrity&&(c.integrity=$.integrity),$.referrerPolicy&&(c.referrerPolicy=$.referrerPolicy),$.crossOrigin==="use-credentials"?c.credentials="include":$.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a($){if($.ep)return;$.ep=!0;const c=s($);fetch($.href,c)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var l$1=Symbol.for("react.element"),n$1=Symbol.for("react.portal"),p$3=Symbol.for("react.fragment"),q$3=Symbol.for("react.strict_mode"),r$1=Symbol.for("react.profiler"),t$1=Symbol.for("react.provider"),u$1=Symbol.for("react.context"),v$2=Symbol.for("react.forward_ref"),w$1=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y$1=Symbol.for("react.lazy"),z$3=Symbol.iterator;function A$2(e){return e===null||typeof e!="object"?null:(e=z$3&&e[z$3]||e["@@iterator"],typeof e=="function"?e:null)}var B$3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$2=Object.assign,D$3={};function E$2(e,o,s){this.props=e,this.context=o,this.refs=D$3,this.updater=s||B$3}E$2.prototype.isReactComponent={};E$2.prototype.setState=function(e,o){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,o,"setState")};E$2.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function F$2(){}F$2.prototype=E$2.prototype;function G$2(e,o,s){this.props=e,this.context=o,this.refs=D$3,this.updater=s||B$3}var H$3=G$2.prototype=new F$2;H$3.constructor=G$2;C$2(H$3,E$2.prototype);H$3.isPureReactComponent=!0;var I$2=Array.isArray,J$1=Object.prototype.hasOwnProperty,K$1={current:null},L$2={key:!0,ref:!0,__self:!0,__source:!0};function M$2(e,o,s){var a,$={},c=null,nt=null;if(o!=null)for(a in o.ref!==void 0&&(nt=o.ref),o.key!==void 0&&(c=""+o.key),o)J$1.call(o,a)&&!L$2.hasOwnProperty(a)&&($[a]=o[a]);var at=arguments.length-2;if(at===1)$.children=s;else if(1<at){for(var lt=Array(at),et=0;et<at;et++)lt[et]=arguments[et+2];$.children=lt}if(e&&e.defaultProps)for(a in at=e.defaultProps,at)$[a]===void 0&&($[a]=at[a]);return{$$typeof:l$1,type:e,key:c,ref:nt,props:$,_owner:K$1.current}}function N$2(e,o){return{$$typeof:l$1,type:e.type,key:o,ref:e.ref,props:e.props,_owner:e._owner}}function O$3(e){return typeof e=="object"&&e!==null&&e.$$typeof===l$1}function escape$2(e){var o={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(s){return o[s]})}var P$2=/\/+/g;function Q$2(e,o){return typeof e=="object"&&e!==null&&e.key!=null?escape$2(""+e.key):o.toString(36)}function R$2(e,o,s,a,$){var c=typeof e;(c==="undefined"||c==="boolean")&&(e=null);var nt=!1;if(e===null)nt=!0;else switch(c){case"string":case"number":nt=!0;break;case"object":switch(e.$$typeof){case l$1:case n$1:nt=!0}}if(nt)return nt=e,$=$(nt),e=a===""?"."+Q$2(nt,0):a,I$2($)?(s="",e!=null&&(s=e.replace(P$2,"$&/")+"/"),R$2($,o,s,"",function(et){return et})):$!=null&&(O$3($)&&($=N$2($,s+(!$.key||nt&&nt.key===$.key?"":(""+$.key).replace(P$2,"$&/")+"/")+e)),o.push($)),1;if(nt=0,a=a===""?".":a+":",I$2(e))for(var at=0;at<e.length;at++){c=e[at];var lt=a+Q$2(c,at);nt+=R$2(c,o,s,lt,$)}else if(lt=A$2(e),typeof lt=="function")for(e=lt.call(e),at=0;!(c=e.next()).done;)c=c.value,lt=a+Q$2(c,at++),nt+=R$2(c,o,s,lt,$);else if(c==="object")throw o=String(e),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.");return nt}function S$2(e,o,s){if(e==null)return e;var a=[],$=0;return R$2(e,a,"","",function(c){return o.call(s,c,$++)}),a}function T$2(e){if(e._status===-1){var o=e._result;o=o(),o.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s)},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s)}),e._status===-1&&(e._status=0,e._result=o)}if(e._status===1)return e._result.default;throw e._result}var U$1={current:null},V$2={transition:null},W$2={ReactCurrentDispatcher:U$1,ReactCurrentBatchConfig:V$2,ReactCurrentOwner:K$1};function X$1(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$2,forEach:function(e,o,s){S$2(e,function(){o.apply(this,arguments)},s)},count:function(e){var o=0;return S$2(e,function(){o++}),o},toArray:function(e){return S$2(e,function(o){return o})||[]},only:function(e){if(!O$3(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};react_production_min.Component=E$2;react_production_min.Fragment=p$3;react_production_min.Profiler=r$1;react_production_min.PureComponent=G$2;react_production_min.StrictMode=q$3;react_production_min.Suspense=w$1;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$2;react_production_min.act=X$1;react_production_min.cloneElement=function(e,o,s){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=C$2({},e.props),$=e.key,c=e.ref,nt=e._owner;if(o!=null){if(o.ref!==void 0&&(c=o.ref,nt=K$1.current),o.key!==void 0&&($=""+o.key),e.type&&e.type.defaultProps)var at=e.type.defaultProps;for(lt in o)J$1.call(o,lt)&&!L$2.hasOwnProperty(lt)&&(a[lt]=o[lt]===void 0&&at!==void 0?at[lt]:o[lt])}var lt=arguments.length-2;if(lt===1)a.children=s;else if(1<lt){at=Array(lt);for(var et=0;et<lt;et++)at[et]=arguments[et+2];a.children=at}return{$$typeof:l$1,type:e.type,key:$,ref:c,props:a,_owner:nt}};react_production_min.createContext=function(e){return e={$$typeof:u$1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:t$1,_context:e},e.Consumer=e};react_production_min.createElement=M$2;react_production_min.createFactory=function(e){var o=M$2.bind(null,e);return o.type=e,o};react_production_min.createRef=function(){return{current:null}};react_production_min.forwardRef=function(e){return{$$typeof:v$2,render:e}};react_production_min.isValidElement=O$3;react_production_min.lazy=function(e){return{$$typeof:y$1,_payload:{_status:-1,_result:e},_init:T$2}};react_production_min.memo=function(e,o){return{$$typeof:x,type:e,compare:o===void 0?null:o}};react_production_min.startTransition=function(e){var o=V$2.transition;V$2.transition={};try{e()}finally{V$2.transition=o}};react_production_min.unstable_act=X$1;react_production_min.useCallback=function(e,o){return U$1.current.useCallback(e,o)};react_production_min.useContext=function(e){return U$1.current.useContext(e)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(e){return U$1.current.useDeferredValue(e)};react_production_min.useEffect=function(e,o){return U$1.current.useEffect(e,o)};react_production_min.useId=function(){return U$1.current.useId()};react_production_min.useImperativeHandle=function(e,o,s){return U$1.current.useImperativeHandle(e,o,s)};react_production_min.useInsertionEffect=function(e,o){return U$1.current.useInsertionEffect(e,o)};react_production_min.useLayoutEffect=function(e,o){return U$1.current.useLayoutEffect(e,o)};react_production_min.useMemo=function(e,o){return U$1.current.useMemo(e,o)};react_production_min.useReducer=function(e,o,s){return U$1.current.useReducer(e,o,s)};react_production_min.useRef=function(e){return U$1.current.useRef(e)};react_production_min.useState=function(e){return U$1.current.useState(e)};react_production_min.useSyncExternalStore=function(e,o,s){return U$1.current.useSyncExternalStore(e,o,s)};react_production_min.useTransition=function(){return U$1.current.useTransition()};react_production_min.version="18.3.1";react.exports=react_production_min;var reactExports=react.exports;const t=getDefaultExportFromCjs(reactExports);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var f$1=reactExports,k$2=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m$2=Object.prototype.hasOwnProperty,n=f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$2={key:!0,ref:!0,__self:!0,__source:!0};function q$2(e,o,s){var a,$={},c=null,nt=null;s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),o.ref!==void 0&&(nt=o.ref);for(a in o)m$2.call(o,a)&&!p$2.hasOwnProperty(a)&&($[a]=o[a]);if(e&&e.defaultProps)for(a in o=e.defaultProps,o)$[a]===void 0&&($[a]=o[a]);return{$$typeof:k$2,type:e,key:c,ref:nt,props:$,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q$2;reactJsxRuntime_production_min.jsxs=q$2;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,client={},reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function o(en,Lr){var ko=en.length;en.push(Lr);e:for(;0<ko;){var Ir=ko-1>>>1,Dr=en[Ir];if(0<$(Dr,Lr))en[Ir]=Lr,en[ko]=Dr,ko=Ir;else break e}}function s(en){return en.length===0?null:en[0]}function a(en){if(en.length===0)return null;var Lr=en[0],ko=en.pop();if(ko!==Lr){en[0]=ko;e:for(var Ir=0,Dr=en.length,Zr=Dr>>>1;Ir<Zr;){var rn=2*(Ir+1)-1,On=en[rn],zo=rn+1,Yo=en[zo];if(0>$(On,ko))zo<Dr&&0>$(Yo,On)?(en[Ir]=Yo,en[zo]=ko,Ir=zo):(en[Ir]=On,en[rn]=ko,Ir=rn);else if(zo<Dr&&0>$(Yo,ko))en[Ir]=Yo,en[zo]=ko,Ir=zo;else break e}}return Lr}function $(en,Lr){var ko=en.sortIndex-Lr.sortIndex;return ko!==0?ko:en.id-Lr.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var nt=Date,at=nt.now();e.unstable_now=function(){return nt.now()-at}}var lt=[],et=[],it=1,st=null,ct=3,ft=!1,pt=!1,gt=!1,wt=typeof setTimeout=="function"?setTimeout:null,vt=typeof clearTimeout=="function"?clearTimeout:null,_t=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $t(en){for(var Lr=s(et);Lr!==null;){if(Lr.callback===null)a(et);else if(Lr.startTime<=en)a(et),Lr.sortIndex=Lr.expirationTime,o(lt,Lr);else break;Lr=s(et)}}function Pt(en){if(gt=!1,$t(en),!pt)if(s(lt)!==null)pt=!0,$o(Nt);else{var Lr=s(et);Lr!==null&&In(Pt,Lr.startTime-en)}}function Nt(en,Lr){pt=!1,gt&&(gt=!1,vt(Jt),Jt=-1),ft=!0;var ko=ct;try{for($t(Lr),st=s(lt);st!==null&&(!(st.expirationTime>Lr)||en&&!tn());){var Ir=st.callback;if(typeof Ir=="function"){st.callback=null,ct=st.priorityLevel;var Dr=Ir(st.expirationTime<=Lr);Lr=e.unstable_now(),typeof Dr=="function"?st.callback=Dr:st===s(lt)&&a(lt),$t(Lr)}else a(lt);st=s(lt)}if(st!==null)var Zr=!0;else{var rn=s(et);rn!==null&&In(Pt,rn.startTime-Lr),Zr=!1}return Zr}finally{st=null,ct=ko,ft=!1}}var Lt=!1,Ft=null,Jt=-1,_r=5,wr=-1;function tn(){return!(e.unstable_now()-wr<_r)}function Wt(){if(Ft!==null){var en=e.unstable_now();wr=en;var Lr=!0;try{Lr=Ft(!0,en)}finally{Lr?Yr():(Lt=!1,Ft=null)}}else Lt=!1}var Yr;if(typeof _t=="function")Yr=function(){_t(Wt)};else if(typeof MessageChannel<"u"){var Ot=new MessageChannel,gr=Ot.port2;Ot.port1.onmessage=Wt,Yr=function(){gr.postMessage(null)}}else Yr=function(){wt(Wt,0)};function $o(en){Ft=en,Lt||(Lt=!0,Yr())}function In(en,Lr){Jt=wt(function(){en(e.unstable_now())},Lr)}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(en){en.callback=null},e.unstable_continueExecution=function(){pt||ft||(pt=!0,$o(Nt))},e.unstable_forceFrameRate=function(en){0>en||125<en?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_r=0<en?Math.floor(1e3/en):5},e.unstable_getCurrentPriorityLevel=function(){return ct},e.unstable_getFirstCallbackNode=function(){return s(lt)},e.unstable_next=function(en){switch(ct){case 1:case 2:case 3:var Lr=3;break;default:Lr=ct}var ko=ct;ct=Lr;try{return en()}finally{ct=ko}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(en,Lr){switch(en){case 1:case 2:case 3:case 4:case 5:break;default:en=3}var ko=ct;ct=en;try{return Lr()}finally{ct=ko}},e.unstable_scheduleCallback=function(en,Lr,ko){var Ir=e.unstable_now();switch(typeof ko=="object"&&ko!==null?(ko=ko.delay,ko=typeof ko=="number"&&0<ko?Ir+ko:Ir):ko=Ir,en){case 1:var Dr=-1;break;case 2:Dr=250;break;case 5:Dr=1073741823;break;case 4:Dr=1e4;break;default:Dr=5e3}return Dr=ko+Dr,en={id:it++,callback:Lr,priorityLevel:en,startTime:ko,expirationTime:Dr,sortIndex:-1},ko>Ir?(en.sortIndex=ko,o(et,en),s(lt)===null&&en===s(et)&&(gt?(vt(Jt),Jt=-1):gt=!0,In(Pt,ko-Ir))):(en.sortIndex=Dr,o(lt,en),pt||ft||(pt=!0,$o(Nt))),en},e.unstable_shouldYield=tn,e.unstable_wrapCallback=function(en){var Lr=ct;return function(){var ko=ct;ct=Lr;try{return en.apply(this,arguments)}finally{ct=ko}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var aa=reactExports,ca=schedulerExports;function p$1(e){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)o+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(e,o){ha(e,o),ha(e+"Capture",o)}function ha(e,o){for(ea[e]=o,e=0;e<o.length;e++)da.add(o[e])}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[: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]*$/,la={},ma={};function oa(e){return ja.call(ma,e)?!0:ja.call(la,e)?!1:ka.test(e)?ma[e]=!0:(la[e]=!0,!1)}function pa(e,o,s,a){if(s!==null&&s.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return a?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qa(e,o,s,a){if(o===null||typeof o>"u"||pa(e,o,s,a))return!0;if(a)return!1;if(s!==null)switch(s.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function v$1(e,o,s,a,$,c,nt){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=a,this.attributeNamespace=$,this.mustUseProperty=s,this.propertyName=e,this.type=o,this.sanitizeURL=c,this.removeEmptyString=nt}var z$2={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){z$2[e]=new v$1(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var o=e[0];z$2[o]=new v$1(o,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){z$2[e]=new v$1(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){z$2[e]=new v$1(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){z$2[e]=new v$1(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){z$2[e]=new v$1(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){z$2[e]=new v$1(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){z$2[e]=new v$1(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){z$2[e]=new v$1(e,5,!1,e.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var o=e.replace(ra,sa);z$2[o]=new v$1(o,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var o=e.replace(ra,sa);z$2[o]=new v$1(o,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var o=e.replace(ra,sa);z$2[o]=new v$1(o,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){z$2[e]=new v$1(e,1,!1,e.toLowerCase(),null,!1,!1)});z$2.xlinkHref=new v$1("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){z$2[e]=new v$1(e,1,!1,e.toLowerCase(),null,!0,!0)});function ta$1(e,o,s,a){var $=z$2.hasOwnProperty(o)?z$2[o]:null;($!==null?$.type!==0:a||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(qa(o,s,$,a)&&(s=null),a||$===null?oa(o)&&(s===null?e.removeAttribute(o):e.setAttribute(o,""+s)):$.mustUseProperty?e[$.propertyName]=s===null?$.type===3?!1:"":s:(o=$.attributeName,a=$.attributeNamespace,s===null?e.removeAttribute(o):($=$.type,s=$===3||$===4&&s===!0?"":""+s,a?e.setAttributeNS(a,o,s):e.setAttribute(o,s))))}var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy"),Ia=Symbol.for("react.offscreen"),Ja=Symbol.iterator;function Ka(e){return e===null||typeof e!="object"?null:(e=Ja&&e[Ja]||e["@@iterator"],typeof e=="function"?e:null)}var A$1=Object.assign,La;function Ma(e){if(La===void 0)try{throw Error()}catch(s){var o=s.stack.trim().match(/\n( *(at )?)/);La=o&&o[1]||""}return`
`+La+e}var Na=!1;function Oa(e,o){if(!e||Na)return"";Na=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(et){var a=et}Reflect.construct(e,[],o)}else{try{o.call()}catch(et){a=et}e.call(o.prototype)}else{try{throw Error()}catch(et){a=et}e()}}catch(et){if(et&&a&&typeof et.stack=="string"){for(var $=et.stack.split(`
`),c=a.stack.split(`
`),nt=$.length-1,at=c.length-1;1<=nt&&0<=at&&$[nt]!==c[at];)at--;for(;1<=nt&&0<=at;nt--,at--)if($[nt]!==c[at]){if(nt!==1||at!==1)do if(nt--,at--,0>at||$[nt]!==c[at]){var lt=`
`+$[nt].replace(" at new "," at ");return e.displayName&&lt.includes("<anonymous>")&&(lt=lt.replace("<anonymous>",e.displayName)),lt}while(1<=nt&&0<=at);break}}}finally{Na=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?Ma(e):""}function Pa(e){switch(e.tag){case 5:return Ma(e.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return e=Oa(e.type,!1),e;case 11:return e=Oa(e.type.render,!1),e;case 1:return e=Oa(e.type,!0),e;default:return""}}function Qa$1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ca:return(e.displayName||"Context")+".Consumer";case Ba:return(e._context.displayName||"Context")+".Provider";case Da:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ga:return o=e.displayName||null,o!==null?o:Qa$1(e.type)||"Memo";case Ha:o=e._payload,e=e._init;try{return Qa$1(e(o))}catch{}}return null}function Ra(e){var o=e.type;switch(e.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=o.render,e=e.displayName||e.name||"",o.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa$1(o);case 8:return o===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Sa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ta(e){var o=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ua(e){var o=Ta(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,o),a=""+e[o];if(!e.hasOwnProperty(o)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var $=s.get,c=s.set;return Object.defineProperty(e,o,{configurable:!0,get:function(){return $.call(this)},set:function(nt){a=""+nt,c.call(this,nt)}}),Object.defineProperty(e,o,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(nt){a=""+nt},stopTracking:function(){e._valueTracker=null,delete e[o]}}}}function Va(e){e._valueTracker||(e._valueTracker=Ua(e))}function Wa(e){if(!e)return!1;var o=e._valueTracker;if(!o)return!0;var s=o.getValue(),a="";return e&&(a=Ta(e)?e.checked?"true":"false":e.value),e=a,e!==s?(o.setValue(e),!0):!1}function Xa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ya(e,o){var s=o.checked;return A$1({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Za(e,o){var s=o.defaultValue==null?"":o.defaultValue,a=o.checked!=null?o.checked:o.defaultChecked;s=Sa(o.value!=null?o.value:s),e._wrapperState={initialChecked:a,initialValue:s,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ab$1(e,o){o=o.checked,o!=null&&ta$1(e,"checked",o,!1)}function bb$1(e,o){ab$1(e,o);var s=Sa(o.value),a=o.type;if(s!=null)a==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}o.hasOwnProperty("value")?cb$2(e,o.type,s):o.hasOwnProperty("defaultValue")&&cb$2(e,o.type,Sa(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(e.defaultChecked=!!o.defaultChecked)}function db$1(e,o,s){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var a=o.type;if(!(a!=="submit"&&a!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+e._wrapperState.initialValue,s||o===e.value||(e.value=o),e.defaultValue=o}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function cb$2(e,o,s){(o!=="number"||Xa(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var eb$1=Array.isArray;function fb$1(e,o,s,a){if(e=e.options,o){o={};for(var $=0;$<s.length;$++)o["$"+s[$]]=!0;for(s=0;s<e.length;s++)$=o.hasOwnProperty("$"+e[s].value),e[s].selected!==$&&(e[s].selected=$),$&&a&&(e[s].defaultSelected=!0)}else{for(s=""+Sa(s),o=null,$=0;$<e.length;$++){if(e[$].value===s){e[$].selected=!0,a&&(e[$].defaultSelected=!0);return}o!==null||e[$].disabled||(o=e[$])}o!==null&&(o.selected=!0)}}function gb$1(e,o){if(o.dangerouslySetInnerHTML!=null)throw Error(p$1(91));return A$1({},o,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function hb$1(e,o){var s=o.value;if(s==null){if(s=o.children,o=o.defaultValue,s!=null){if(o!=null)throw Error(p$1(92));if(eb$1(s)){if(1<s.length)throw Error(p$1(93));s=s[0]}o=s}o==null&&(o=""),s=o}e._wrapperState={initialValue:Sa(s)}}function ib$1(e,o){var s=Sa(o.value),a=Sa(o.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),o.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),a!=null&&(e.defaultValue=""+a)}function jb$1(e){var o=e.textContent;o===e._wrapperState.initialValue&&o!==""&&o!==null&&(e.value=o)}function kb$1(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 lb$1(e,o){return e==null||e==="http://www.w3.org/1999/xhtml"?kb$1(o):e==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mb$1,nb$1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,s,a,$){MSApp.execUnsafeLocalFunction(function(){return e(o,s,a,$)})}:e}(function(e,o){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=o;else{for(mb$1=mb$1||document.createElement("div"),mb$1.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=mb$1.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;o.firstChild;)e.appendChild(o.firstChild)}});function ob$1(e,o){if(o){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=o;return}}e.textContent=o}var pb$1={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},qb$1=["Webkit","ms","Moz","O"];Object.keys(pb$1).forEach(function(e){qb$1.forEach(function(o){o=o+e.charAt(0).toUpperCase()+e.substring(1),pb$1[o]=pb$1[e]})});function rb$1(e,o,s){return o==null||typeof o=="boolean"||o===""?"":s||typeof o!="number"||o===0||pb$1.hasOwnProperty(e)&&pb$1[e]?(""+o).trim():o+"px"}function sb$1(e,o){e=e.style;for(var s in o)if(o.hasOwnProperty(s)){var a=s.indexOf("--")===0,$=rb$1(s,o[s],a);s==="float"&&(s="cssFloat"),a?e.setProperty(s,$):e[s]=$}}var tb$1=A$1({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 ub$1(e,o){if(o){if(tb$1[e]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(p$1(137,e));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(p$1(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(p$1(61))}if(o.style!=null&&typeof o.style!="object")throw Error(p$1(62))}}function vb$1(e,o){if(e.indexOf("-")===-1)return typeof o.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb$1=null;function xb$1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yb$1=null,zb$1=null,Ab$1=null;function Bb$1(e){if(e=Cb$1(e)){if(typeof yb$1!="function")throw Error(p$1(280));var o=e.stateNode;o&&(o=Db$1(o),yb$1(e.stateNode,e.type,o))}}function Eb$1(e){zb$1?Ab$1?Ab$1.push(e):Ab$1=[e]:zb$1=e}function Fb$1(){if(zb$1){var e=zb$1,o=Ab$1;if(Ab$1=zb$1=null,Bb$1(e),o)for(e=0;e<o.length;e++)Bb$1(o[e])}}function Gb$1(e,o){return e(o)}function Hb$1(){}var Ib$1=!1;function Jb$1(e,o,s){if(Ib$1)return e(o,s);Ib$1=!0;try{return Gb$1(e,o,s)}finally{Ib$1=!1,(zb$1!==null||Ab$1!==null)&&(Hb$1(),Fb$1())}}function Kb$1(e,o){var s=e.stateNode;if(s===null)return null;var a=Db$1(s);if(a===null)return null;s=a[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(p$1(231,o,typeof s));return s}var Lb$1=!1;if(ia)try{var Mb$1={};Object.defineProperty(Mb$1,"passive",{get:function(){Lb$1=!0}}),window.addEventListener("test",Mb$1,Mb$1),window.removeEventListener("test",Mb$1,Mb$1)}catch{Lb$1=!1}function Nb$1(e,o,s,a,$,c,nt,at,lt){var et=Array.prototype.slice.call(arguments,3);try{o.apply(s,et)}catch(it){this.onError(it)}}var Ob$1=!1,Pb$1=null,Qb$1=!1,Rb$1=null,Sb$1={onError:function(e){Ob$1=!0,Pb$1=e}};function Tb$1(e,o,s,a,$,c,nt,at,lt){Ob$1=!1,Pb$1=null,Nb$1.apply(Sb$1,arguments)}function Ub$1(e,o,s,a,$,c,nt,at,lt){if(Tb$1.apply(this,arguments),Ob$1){if(Ob$1){var et=Pb$1;Ob$1=!1,Pb$1=null}else throw Error(p$1(198));Qb$1||(Qb$1=!0,Rb$1=et)}}function Vb$1(e){var o=e,s=e;if(e.alternate)for(;o.return;)o=o.return;else{e=o;do o=e,o.flags&4098&&(s=o.return),e=o.return;while(e)}return o.tag===3?s:null}function Wb$1(e){if(e.tag===13){var o=e.memoizedState;if(o===null&&(e=e.alternate,e!==null&&(o=e.memoizedState)),o!==null)return o.dehydrated}return null}function Xb$1(e){if(Vb$1(e)!==e)throw Error(p$1(188))}function Yb$1(e){var o=e.alternate;if(!o){if(o=Vb$1(e),o===null)throw Error(p$1(188));return o!==e?null:e}for(var s=e,a=o;;){var $=s.return;if($===null)break;var c=$.alternate;if(c===null){if(a=$.return,a!==null){s=a;continue}break}if($.child===c.child){for(c=$.child;c;){if(c===s)return Xb$1($),e;if(c===a)return Xb$1($),o;c=c.sibling}throw Error(p$1(188))}if(s.return!==a.return)s=$,a=c;else{for(var nt=!1,at=$.child;at;){if(at===s){nt=!0,s=$,a=c;break}if(at===a){nt=!0,a=$,s=c;break}at=at.sibling}if(!nt){for(at=c.child;at;){if(at===s){nt=!0,s=c,a=$;break}if(at===a){nt=!0,a=c,s=$;break}at=at.sibling}if(!nt)throw Error(p$1(189))}}if(s.alternate!==a)throw Error(p$1(190))}if(s.tag!==3)throw Error(p$1(188));return s.stateNode.current===s?e:o}function Zb$1(e){return e=Yb$1(e),e!==null?$b$1(e):null}function $b$1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var o=$b$1(e);if(o!==null)return o;e=e.sibling}return null}var ac$1=ca.unstable_scheduleCallback,bc$1=ca.unstable_cancelCallback,cc$1=ca.unstable_shouldYield,dc$1=ca.unstable_requestPaint,B$2=ca.unstable_now,ec$1=ca.unstable_getCurrentPriorityLevel,fc$1=ca.unstable_ImmediatePriority,gc$1=ca.unstable_UserBlockingPriority,hc$1=ca.unstable_NormalPriority,ic$1=ca.unstable_LowPriority,jc$1=ca.unstable_IdlePriority,kc$1=null,lc$1=null;function mc$1(e){if(lc$1&&typeof lc$1.onCommitFiberRoot=="function")try{lc$1.onCommitFiberRoot(kc$1,e,void 0,(e.current.flags&128)===128)}catch{}}var oc$1=Math.clz32?Math.clz32:nc$1,pc$1=Math.log,qc$1=Math.LN2;function nc$1(e){return e>>>=0,e===0?32:31-(pc$1(e)/qc$1|0)|0}var rc$1=64,sc$1=4194304;function tc$1(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function uc$1(e,o){var s=e.pendingLanes;if(s===0)return 0;var a=0,$=e.suspendedLanes,c=e.pingedLanes,nt=s&268435455;if(nt!==0){var at=nt&~$;at!==0?a=tc$1(at):(c&=nt,c!==0&&(a=tc$1(c)))}else nt=s&~$,nt!==0?a=tc$1(nt):c!==0&&(a=tc$1(c));if(a===0)return 0;if(o!==0&&o!==a&&!(o&$)&&($=a&-a,c=o&-o,$>=c||$===16&&(c&4194240)!==0))return o;if(a&4&&(a|=s&16),o=e.entangledLanes,o!==0)for(e=e.entanglements,o&=a;0<o;)s=31-oc$1(o),$=1<<s,a|=e[s],o&=~$;return a}function vc$1(e,o){switch(e){case 1:case 2:case 4:return o+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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wc$1(e,o){for(var s=e.suspendedLanes,a=e.pingedLanes,$=e.expirationTimes,c=e.pendingLanes;0<c;){var nt=31-oc$1(c),at=1<<nt,lt=$[nt];lt===-1?(!(at&s)||at&a)&&($[nt]=vc$1(at,o)):lt<=o&&(e.expiredLanes|=at),c&=~at}}function xc$1(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yc$1(){var e=rc$1;return rc$1<<=1,!(rc$1&4194240)&&(rc$1=64),e}function zc$1(e){for(var o=[],s=0;31>s;s++)o.push(e);return o}function Ac$1(e,o,s){e.pendingLanes|=o,o!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,o=31-oc$1(o),e[o]=s}function Bc$1(e,o){var s=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0<s;){var $=31-oc$1(s),c=1<<$;o[$]=0,a[$]=-1,e[$]=-1,s&=~c}}function Cc$1(e,o){var s=e.entangledLanes|=o;for(e=e.entanglements;s;){var a=31-oc$1(s),$=1<<a;$&o|e[a]&o&&(e[a]|=o),s&=~$}}var C$1=0;function Dc$1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ec$1,Fc$1,Gc$1,Hc$1,Ic$1,Jc$1=!1,Kc$1=[],Lc$1=null,Mc$1=null,Nc$1=null,Oc$1=new Map,Pc$1=new Map,Qc$1=[],Rc$1="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 Sc$1(e,o){switch(e){case"focusin":case"focusout":Lc$1=null;break;case"dragenter":case"dragleave":Mc$1=null;break;case"mouseover":case"mouseout":Nc$1=null;break;case"pointerover":case"pointerout":Oc$1.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pc$1.delete(o.pointerId)}}function Tc$1(e,o,s,a,$,c){return e===null||e.nativeEvent!==c?(e={blockedOn:o,domEventName:s,eventSystemFlags:a,nativeEvent:c,targetContainers:[$]},o!==null&&(o=Cb$1(o),o!==null&&Fc$1(o)),e):(e.eventSystemFlags|=a,o=e.targetContainers,$!==null&&o.indexOf($)===-1&&o.push($),e)}function Uc$1(e,o,s,a,$){switch(o){case"focusin":return Lc$1=Tc$1(Lc$1,e,o,s,a,$),!0;case"dragenter":return Mc$1=Tc$1(Mc$1,e,o,s,a,$),!0;case"mouseover":return Nc$1=Tc$1(Nc$1,e,o,s,a,$),!0;case"pointerover":var c=$.pointerId;return Oc$1.set(c,Tc$1(Oc$1.get(c)||null,e,o,s,a,$)),!0;case"gotpointercapture":return c=$.pointerId,Pc$1.set(c,Tc$1(Pc$1.get(c)||null,e,o,s,a,$)),!0}return!1}function Vc$1(e){var o=Wc$1(e.target);if(o!==null){var s=Vb$1(o);if(s!==null){if(o=s.tag,o===13){if(o=Wb$1(s),o!==null){e.blockedOn=o,Ic$1(e.priority,function(){Gc$1(s)});return}}else if(o===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xc$1(e){if(e.blockedOn!==null)return!1;for(var o=e.targetContainers;0<o.length;){var s=Yc$1(e.domEventName,e.eventSystemFlags,o[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var a=new s.constructor(s.type,s);wb$1=a,s.target.dispatchEvent(a),wb$1=null}else return o=Cb$1(s),o!==null&&Fc$1(o),e.blockedOn=s,!1;o.shift()}return!0}function Zc$1(e,o,s){Xc$1(e)&&s.delete(o)}function $c$1(){Jc$1=!1,Lc$1!==null&&Xc$1(Lc$1)&&(Lc$1=null),Mc$1!==null&&Xc$1(Mc$1)&&(Mc$1=null),Nc$1!==null&&Xc$1(Nc$1)&&(Nc$1=null),Oc$1.forEach(Zc$1),Pc$1.forEach(Zc$1)}function ad$1(e,o){e.blockedOn===o&&(e.blockedOn=null,Jc$1||(Jc$1=!0,ca.unstable_scheduleCallback(ca.unstable_NormalPriority,$c$1)))}function bd(e){function o($){return ad$1($,e)}if(0<Kc$1.length){ad$1(Kc$1[0],e);for(var s=1;s<Kc$1.length;s++){var a=Kc$1[s];a.blockedOn===e&&(a.blockedOn=null)}}for(Lc$1!==null&&ad$1(Lc$1,e),Mc$1!==null&&ad$1(Mc$1,e),Nc$1!==null&&ad$1(Nc$1,e),Oc$1.forEach(o),Pc$1.forEach(o),s=0;s<Qc$1.length;s++)a=Qc$1[s],a.blockedOn===e&&(a.blockedOn=null);for(;0<Qc$1.length&&(s=Qc$1[0],s.blockedOn===null);)Vc$1(s),s.blockedOn===null&&Qc$1.shift()}var cd$1=ua.ReactCurrentBatchConfig,dd$1=!0;function ed$1(e,o,s,a){var $=C$1,c=cd$1.transition;cd$1.transition=null;try{C$1=1,fd$1(e,o,s,a)}finally{C$1=$,cd$1.transition=c}}function gd(e,o,s,a){var $=C$1,c=cd$1.transition;cd$1.transition=null;try{C$1=4,fd$1(e,o,s,a)}finally{C$1=$,cd$1.transition=c}}function fd$1(e,o,s,a){if(dd$1){var $=Yc$1(e,o,s,a);if($===null)hd(e,o,a,id$1,s),Sc$1(e,a);else if(Uc$1($,e,o,s,a))a.stopPropagation();else if(Sc$1(e,a),o&4&&-1<Rc$1.indexOf(e)){for(;$!==null;){var c=Cb$1($);if(c!==null&&Ec$1(c),c=Yc$1(e,o,s,a),c===null&&hd(e,o,a,id$1,s),c===$)break;$=c}$!==null&&a.stopPropagation()}else hd(e,o,a,null,s)}}var id$1=null;function Yc$1(e,o,s,a){if(id$1=null,e=xb$1(a),e=Wc$1(e),e!==null)if(o=Vb$1(e),o===null)e=null;else if(s=o.tag,s===13){if(e=Wb$1(o),e!==null)return e;e=null}else if(s===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;e=null}else o!==e&&(e=null);return id$1=e,null}function jd$1(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(ec$1()){case fc$1:return 1;case gc$1:return 4;case hc$1:case ic$1:return 16;case jc$1:return 536870912;default:return 16}default:return 16}}var kd=null,ld$1=null,md=null;function nd$1(){if(md)return md;var e,o=ld$1,s=o.length,a,$="value"in kd?kd.value:kd.textContent,c=$.length;for(e=0;e<s&&o[e]===$[e];e++);var nt=s-e;for(a=1;a<=nt&&o[s-a]===$[c-a];a++);return md=$.slice(e,1<a?1-a:void 0)}function od$1(e){var o=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&o===13&&(e=13)):e=o,e===10&&(e=13),32<=e||e===13?e:0}function pd$1(){return!0}function qd$1(){return!1}function rd$1(e){function o(s,a,$,c,nt){this._reactName=s,this._targetInst=$,this.type=a,this.nativeEvent=c,this.target=nt,this.currentTarget=null;for(var at in e)e.hasOwnProperty(at)&&(s=e[at],this[at]=s?s(c):c[at]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?pd$1:qd$1,this.isPropagationStopped=qd$1,this}return A$1(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=pd$1)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=pd$1)},persist:function(){},isPersistent:pd$1}),o}var sd$1={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td$1=rd$1(sd$1),ud$1=A$1({},sd$1,{view:0,detail:0}),vd=rd$1(ud$1),wd,xd,yd,Ad=A$1({},ud$1,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==yd&&(yd&&e.type==="mousemove"?(wd=e.screenX-yd.screenX,xd=e.screenY-yd.screenY):xd=wd=0,yd=e),wd)},movementY:function(e){return"movementY"in e?e.movementY:xd}}),Bd=rd$1(Ad),Cd=A$1({},Ad,{dataTransfer:0}),Dd=rd$1(Cd),Ed=A$1({},ud$1,{relatedTarget:0}),Fd=rd$1(Ed),Gd=A$1({},sd$1,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd$1=rd$1(Gd),Id=A$1({},sd$1,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Jd$1=rd$1(Id),Kd$1=A$1({},sd$1,{data:0}),Ld=rd$1(Kd$1),Md={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={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"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(e){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(e):(e=Od[e])?!!o[e]:!1}function zd(){return Pd}var Qd$1=A$1({},ud$1,{key:function(e){if(e.key){var o=Md[e.key]||e.key;if(o!=="Unidentified")return o}return e.type==="keypress"?(e=od$1(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(e){return e.type==="keypress"?od$1(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?od$1(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rd=rd$1(Qd$1),Sd=A$1({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd$1(Sd),Ud=A$1({},ud$1,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd$1(Ud),Wd=A$1({},sd$1,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd$1=rd$1(Wd),Yd$1=A$1({},Ad,{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}),Zd$1=rd$1(Yd$1),$d=[9,13,27,32],ae=ia&&"CompositionEvent"in window,be=null;ia&&"documentMode"in document&&(be=document.documentMode);var ce=ia&&"TextEvent"in window&&!be,de$1=ia&&(!ae||be&&8<be&&11>=be),ee=" ",fe=!1;function ge(e,o){switch(e){case"keyup":return $d.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ie=!1;function je$1(e,o){switch(e){case"compositionend":return he$1(o);case"keypress":return o.which!==32?null:(fe=!0,ee);case"textInput":return e=o.data,e===ee&&fe?null:e;default:return null}}function ke$1(e,o){if(ie)return e==="compositionend"||!ae&&ge(e,o)?(e=nd$1(),md=ld$1=kd=null,ie=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return de$1&&o.locale!=="ko"?null:o.data;default:return null}}var le={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 me$1(e){var o=e&&e.nodeName&&e.nodeName.toLowerCase();return o==="input"?!!le[e.type]:o==="textarea"}function ne$1(e,o,s,a){Eb$1(a),o=oe(o,"onChange"),0<o.length&&(s=new td$1("onChange","change",null,s,a),e.push({event:s,listeners:o}))}var pe$1=null,qe$1=null;function re(e){se(e,0)}function te(e){var o=ue(e);if(Wa(o))return e}function ve(e,o){if(e==="change")return o}var we=!1;if(ia){var xe$1;if(ia){var ye$1="oninput"in document;if(!ye$1){var ze$1=document.createElement("div");ze$1.setAttribute("oninput","return;"),ye$1=typeof ze$1.oninput=="function"}xe$1=ye$1}else xe$1=!1;we=xe$1&&(!document.documentMode||9<document.documentMode)}function Ae(){pe$1&&(pe$1.detachEvent("onpropertychange",Be$1),qe$1=pe$1=null)}function Be$1(e){if(e.propertyName==="value"&&te(qe$1)){var o=[];ne$1(o,qe$1,e,xb$1(e)),Jb$1(re,o)}}function Ce$1(e,o,s){e==="focusin"?(Ae(),pe$1=o,qe$1=s,pe$1.attachEvent("onpropertychange",Be$1)):e==="focusout"&&Ae()}function De(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return te(qe$1)}function Ee$1(e,o){if(e==="click")return te(o)}function Fe$1(e,o){if(e==="input"||e==="change")return te(o)}function Ge(e,o){return e===o&&(e!==0||1/e===1/o)||e!==e&&o!==o}var He$1=typeof Object.is=="function"?Object.is:Ge;function Ie(e,o){if(He$1(e,o))return!0;if(typeof e!="object"||e===null||typeof o!="object"||o===null)return!1;var s=Object.keys(e),a=Object.keys(o);if(s.length!==a.length)return!1;for(a=0;a<s.length;a++){var $=s[a];if(!ja.call(o,$)||!He$1(e[$],o[$]))return!1}return!0}function Je$1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ke$1(e,o){var s=Je$1(e);e=0;for(var a;s;){if(s.nodeType===3){if(a=e+s.textContent.length,e<=o&&a>=o)return{node:s,offset:o-e};e=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Je$1(s)}}function Le(e,o){return e&&o?e===o?!0:e&&e.nodeType===3?!1:o&&o.nodeType===3?Le(e,o.parentNode):"contains"in e?e.contains(o):e.compareDocumentPosition?!!(e.compareDocumentPosition(o)&16):!1:!1}function Me$1(){for(var e=window,o=Xa();o instanceof e.HTMLIFrameElement;){try{var s=typeof o.contentWindow.location.href=="string"}catch{s=!1}if(s)e=o.contentWindow;else break;o=Xa(e.document)}return o}function Ne$1(e){var o=e&&e.nodeName&&e.nodeName.toLowerCase();return o&&(o==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||o==="textarea"||e.contentEditable==="true")}function Oe(e){var o=Me$1(),s=e.focusedElem,a=e.selectionRange;if(o!==s&&s&&s.ownerDocument&&Le(s.ownerDocument.documentElement,s)){if(a!==null&&Ne$1(s)){if(o=a.start,e=a.end,e===void 0&&(e=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(e,s.value.length);else if(e=(o=s.ownerDocument||document)&&o.defaultView||window,e.getSelection){e=e.getSelection();var $=s.textContent.length,c=Math.min(a.start,$);a=a.end===void 0?c:Math.min(a.end,$),!e.extend&&c>a&&($=a,a=c,c=$),$=Ke$1(s,c);var nt=Ke$1(s,a);$&&nt&&(e.rangeCount!==1||e.anchorNode!==$.node||e.anchorOffset!==$.offset||e.focusNode!==nt.node||e.focusOffset!==nt.offset)&&(o=o.createRange(),o.setStart($.node,$.offset),e.removeAllRanges(),c>a?(e.addRange(o),e.extend(nt.node,nt.offset)):(o.setEnd(nt.node,nt.offset),e.addRange(o)))}}for(o=[],e=s;e=e.parentNode;)e.nodeType===1&&o.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<o.length;s++)e=o[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Pe$1=ia&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re=null,Se$1=null,Te$1=!1;function Ue$1(e,o,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Te$1||Qe==null||Qe!==Xa(a)||(a=Qe,"selectionStart"in a&&Ne$1(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Se$1&&Ie(Se$1,a)||(Se$1=a,a=oe(Re,"onSelect"),0<a.length&&(o=new td$1("onSelect","select",null,o,s),e.push({event:o,listeners:a}),o.target=Qe)))}function Ve$1(e,o){var s={};return s[e.toLowerCase()]=o.toLowerCase(),s["Webkit"+e]="webkit"+o,s["Moz"+e]="moz"+o,s}var We$1={animationend:Ve$1("Animation","AnimationEnd"),animationiteration:Ve$1("Animation","AnimationIteration"),animationstart:Ve$1("Animation","AnimationStart"),transitionend:Ve$1("Transition","TransitionEnd")},Xe$1={},Ye={};ia&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete We$1.animationend.animation,delete We$1.animationiteration.animation,delete We$1.animationstart.animation),"TransitionEvent"in window||delete We$1.transitionend.transition);function Ze(e){if(Xe$1[e])return Xe$1[e];if(!We$1[e])return e;var o=We$1[e],s;for(s in o)if(o.hasOwnProperty(s)&&s in Ye)return Xe$1[e]=o[s];return e}var $e=Ze("animationend"),af$1=Ze("animationiteration"),bf$1=Ze("animationstart"),cf$1=Ze("transitionend"),df$1=new Map,ef$1="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 ff$1(e,o){df$1.set(e,o),fa(o,[e])}for(var gf$1=0;gf$1<ef$1.length;gf$1++){var hf$1=ef$1[gf$1],jf$1=hf$1.toLowerCase(),kf$1=hf$1[0].toUpperCase()+hf$1.slice(1);ff$1(jf$1,"on"+kf$1)}ff$1($e,"onAnimationEnd");ff$1(af$1,"onAnimationIteration");ff$1(bf$1,"onAnimationStart");ff$1("dblclick","onDoubleClick");ff$1("focusin","onFocus");ff$1("focusout","onBlur");ff$1(cf$1,"onTransitionEnd");ha("onMouseEnter",["mouseout","mouseover"]);ha("onMouseLeave",["mouseout","mouseover"]);ha("onPointerEnter",["pointerout","pointerover"]);ha("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf$1="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(" "),mf$1=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf$1));function nf$1(e,o,s){var a=e.type||"unknown-event";e.currentTarget=s,Ub$1(a,o,void 0,e),e.currentTarget=null}function se(e,o){o=(o&4)!==0;for(var s=0;s<e.length;s++){var a=e[s],$=a.event;a=a.listeners;e:{var c=void 0;if(o)for(var nt=a.length-1;0<=nt;nt--){var at=a[nt],lt=at.instance,et=at.currentTarget;if(at=at.listener,lt!==c&&$.isPropagationStopped())break e;nf$1($,at,et),c=lt}else for(nt=0;nt<a.length;nt++){if(at=a[nt],lt=at.instance,et=at.currentTarget,at=at.listener,lt!==c&&$.isPropagationStopped())break e;nf$1($,at,et),c=lt}}}if(Qb$1)throw e=Rb$1,Qb$1=!1,Rb$1=null,e}function D$2(e,o){var s=o[of$1];s===void 0&&(s=o[of$1]=new Set);var a=e+"__bubble";s.has(a)||(pf$1(o,e,2,!1),s.add(a))}function qf$1(e,o,s){var a=0;o&&(a|=4),pf$1(s,e,a,o)}var rf$1="_reactListening"+Math.random().toString(36).slice(2);function sf$1(e){if(!e[rf$1]){e[rf$1]=!0,da.forEach(function(s){s!=="selectionchange"&&(mf$1.has(s)||qf$1(s,!1,e),qf$1(s,!0,e))});var o=e.nodeType===9?e:e.ownerDocument;o===null||o[rf$1]||(o[rf$1]=!0,qf$1("selectionchange",!1,o))}}function pf$1(e,o,s,a){switch(jd$1(o)){case 1:var $=ed$1;break;case 4:$=gd;break;default:$=fd$1}s=$.bind(null,o,s,e),$=void 0,!Lb$1||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||($=!0),a?$!==void 0?e.addEventListener(o,s,{capture:!0,passive:$}):e.addEventListener(o,s,!0):$!==void 0?e.addEventListener(o,s,{passive:$}):e.addEventListener(o,s,!1)}function hd(e,o,s,a,$){var c=a;if(!(o&1)&&!(o&2)&&a!==null)e:for(;;){if(a===null)return;var nt=a.tag;if(nt===3||nt===4){var at=a.stateNode.containerInfo;if(at===$||at.nodeType===8&&at.parentNode===$)break;if(nt===4)for(nt=a.return;nt!==null;){var lt=nt.tag;if((lt===3||lt===4)&&(lt=nt.stateNode.containerInfo,lt===$||lt.nodeType===8&&lt.parentNode===$))return;nt=nt.return}for(;at!==null;){if(nt=Wc$1(at),nt===null)return;if(lt=nt.tag,lt===5||lt===6){a=c=nt;continue e}at=at.parentNode}}a=a.return}Jb$1(function(){var et=c,it=xb$1(s),st=[];e:{var ct=df$1.get(e);if(ct!==void 0){var ft=td$1,pt=e;switch(e){case"keypress":if(od$1(s)===0)break e;case"keydown":case"keyup":ft=Rd;break;case"focusin":pt="focus",ft=Fd;break;case"focusout":pt="blur",ft=Fd;break;case"beforeblur":case"afterblur":ft=Fd;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ft=Bd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ft=Dd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ft=Vd;break;case $e:case af$1:case bf$1:ft=Hd$1;break;case cf$1:ft=Xd$1;break;case"scroll":ft=vd;break;case"wheel":ft=Zd$1;break;case"copy":case"cut":case"paste":ft=Jd$1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ft=Td}var gt=(o&4)!==0,wt=!gt&&e==="scroll",vt=gt?ct!==null?ct+"Capture":null:ct;gt=[];for(var _t=et,$t;_t!==null;){$t=_t;var Pt=$t.stateNode;if($t.tag===5&&Pt!==null&&($t=Pt,vt!==null&&(Pt=Kb$1(_t,vt),Pt!=null&&gt.push(tf$1(_t,Pt,$t)))),wt)break;_t=_t.return}0<gt.length&&(ct=new ft(ct,pt,null,s,it),st.push({event:ct,listeners:gt}))}}if(!(o&7)){e:{if(ct=e==="mouseover"||e==="pointerover",ft=e==="mouseout"||e==="pointerout",ct&&s!==wb$1&&(pt=s.relatedTarget||s.fromElement)&&(Wc$1(pt)||pt[uf$1]))break e;if((ft||ct)&&(ct=it.window===it?it:(ct=it.ownerDocument)?ct.defaultView||ct.parentWindow:window,ft?(pt=s.relatedTarget||s.toElement,ft=et,pt=pt?Wc$1(pt):null,pt!==null&&(wt=Vb$1(pt),pt!==wt||pt.tag!==5&&pt.tag!==6)&&(pt=null)):(ft=null,pt=et),ft!==pt)){if(gt=Bd,Pt="onMouseLeave",vt="onMouseEnter",_t="mouse",(e==="pointerout"||e==="pointerover")&&(gt=Td,Pt="onPointerLeave",vt="onPointerEnter",_t="pointer"),wt=ft==null?ct:ue(ft),$t=pt==null?ct:ue(pt),ct=new gt(Pt,_t+"leave",ft,s,it),ct.target=wt,ct.relatedTarget=$t,Pt=null,Wc$1(it)===et&&(gt=new gt(vt,_t+"enter",pt,s,it),gt.target=$t,gt.relatedTarget=wt,Pt=gt),wt=Pt,ft&&pt)t:{for(gt=ft,vt=pt,_t=0,$t=gt;$t;$t=vf$1($t))_t++;for($t=0,Pt=vt;Pt;Pt=vf$1(Pt))$t++;for(;0<_t-$t;)gt=vf$1(gt),_t--;for(;0<$t-_t;)vt=vf$1(vt),$t--;for(;_t--;){if(gt===vt||vt!==null&&gt===vt.alternate)break t;gt=vf$1(gt),vt=vf$1(vt)}gt=null}else gt=null;ft!==null&&wf$1(st,ct,ft,gt,!1),pt!==null&&wt!==null&&wf$1(st,wt,pt,gt,!0)}}e:{if(ct=et?ue(et):window,ft=ct.nodeName&&ct.nodeName.toLowerCase(),ft==="select"||ft==="input"&&ct.type==="file")var Nt=ve;else if(me$1(ct))if(we)Nt=Fe$1;else{Nt=De;var Lt=Ce$1}else(ft=ct.nodeName)&&ft.toLowerCase()==="input"&&(ct.type==="checkbox"||ct.type==="radio")&&(Nt=Ee$1);if(Nt&&(Nt=Nt(e,et))){ne$1(st,Nt,s,it);break e}Lt&&Lt(e,ct,et),e==="focusout"&&(Lt=ct._wrapperState)&&Lt.controlled&&ct.type==="number"&&cb$2(ct,"number",ct.value)}switch(Lt=et?ue(et):window,e){case"focusin":(me$1(Lt)||Lt.contentEditable==="true")&&(Qe=Lt,Re=et,Se$1=null);break;case"focusout":Se$1=Re=Qe=null;break;case"mousedown":Te$1=!0;break;case"contextmenu":case"mouseup":case"dragend":Te$1=!1,Ue$1(st,s,it);break;case"selectionchange":if(Pe$1)break;case"keydown":case"keyup":Ue$1(st,s,it)}var Ft;if(ae)e:{switch(e){case"compositionstart":var Jt="onCompositionStart";break e;case"compositionend":Jt="onCompositionEnd";break e;case"compositionupdate":Jt="onCompositionUpdate";break e}Jt=void 0}else ie?ge(e,s)&&(Jt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Jt="onCompositionStart");Jt&&(de$1&&s.locale!=="ko"&&(ie||Jt!=="onCompositionStart"?Jt==="onCompositionEnd"&&ie&&(Ft=nd$1()):(kd=it,ld$1="value"in kd?kd.value:kd.textContent,ie=!0)),Lt=oe(et,Jt),0<Lt.length&&(Jt=new Ld(Jt,e,null,s,it),st.push({event:Jt,listeners:Lt}),Ft?Jt.data=Ft:(Ft=he$1(s),Ft!==null&&(Jt.data=Ft)))),(Ft=ce?je$1(e,s):ke$1(e,s))&&(et=oe(et,"onBeforeInput"),0<et.length&&(it=new Ld("onBeforeInput","beforeinput",null,s,it),st.push({event:it,listeners:et}),it.data=Ft))}se(st,o)})}function tf$1(e,o,s){return{instance:e,listener:o,currentTarget:s}}function oe(e,o){for(var s=o+"Capture",a=[];e!==null;){var $=e,c=$.stateNode;$.tag===5&&c!==null&&($=c,c=Kb$1(e,s),c!=null&&a.unshift(tf$1(e,c,$)),c=Kb$1(e,o),c!=null&&a.push(tf$1(e,c,$))),e=e.return}return a}function vf$1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function wf$1(e,o,s,a,$){for(var c=o._reactName,nt=[];s!==null&&s!==a;){var at=s,lt=at.alternate,et=at.stateNode;if(lt!==null&&lt===a)break;at.tag===5&&et!==null&&(at=et,$?(lt=Kb$1(s,c),lt!=null&&nt.unshift(tf$1(s,lt,at))):$||(lt=Kb$1(s,c),lt!=null&&nt.push(tf$1(s,lt,at)))),s=s.return}nt.length!==0&&e.push({event:o,listeners:nt})}var xf$1=/\r\n?/g,yf$1=/\u0000|\uFFFD/g;function zf$1(e){return(typeof e=="string"?e:""+e).replace(xf$1,`
`).replace(yf$1,"")}function Af$1(e,o,s){if(o=zf$1(o),zf$1(e)!==o&&s)throw Error(p$1(425))}function Bf$1(){}var Cf$1=null,Df$1=null;function Ef$1(e,o){return e==="textarea"||e==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Ff$1=typeof setTimeout=="function"?setTimeout:void 0,Gf$1=typeof clearTimeout=="function"?clearTimeout:void 0,Hf$1=typeof Promise=="function"?Promise:void 0,Jf$1=typeof queueMicrotask=="function"?queueMicrotask:typeof Hf$1<"u"?function(e){return Hf$1.resolve(null).then(e).catch(If$1)}:Ff$1;function If$1(e){setTimeout(function(){throw e})}function Kf$1(e,o){var s=o,a=0;do{var $=s.nextSibling;if(e.removeChild(s),$&&$.nodeType===8)if(s=$.data,s==="/$"){if(a===0){e.removeChild($),bd(o);return}a--}else s!=="$"&&s!=="$?"&&s!=="$!"||a++;s=$}while(s);bd(o)}function Lf$1(e){for(;e!=null;e=e.nextSibling){var o=e.nodeType;if(o===1||o===3)break;if(o===8){if(o=e.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return e}function Mf$1(e){e=e.previousSibling;for(var o=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(o===0)return e;o--}else s==="/$"&&o++}e=e.previousSibling}return null}var Nf$1=Math.random().toString(36).slice(2),Of$1="__reactFiber$"+Nf$1,Pf$1="__reactProps$"+Nf$1,uf$1="__reactContainer$"+Nf$1,of$1="__reactEvents$"+Nf$1,Qf$1="__reactListeners$"+Nf$1,Rf$1="__reactHandles$"+Nf$1;function Wc$1(e){var o=e[Of$1];if(o)return o;for(var s=e.parentNode;s;){if(o=s[uf$1]||s[Of$1]){if(s=o.alternate,o.child!==null||s!==null&&s.child!==null)for(e=Mf$1(e);e!==null;){if(s=e[Of$1])return s;e=Mf$1(e)}return o}e=s,s=e.parentNode}return null}function Cb$1(e){return e=e[Of$1]||e[uf$1],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ue(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(p$1(33))}function Db$1(e){return e[Pf$1]||null}var Sf$1=[],Tf$1=-1;function Uf$1(e){return{current:e}}function E$1(e){0>Tf$1||(e.current=Sf$1[Tf$1],Sf$1[Tf$1]=null,Tf$1--)}function G$1(e,o){Tf$1++,Sf$1[Tf$1]=e.current,e.current=o}var Vf$1={},H$2=Uf$1(Vf$1),Wf$1=Uf$1(!1),Xf$1=Vf$1;function Yf$1(e,o){var s=e.type.contextTypes;if(!s)return Vf$1;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===o)return a.__reactInternalMemoizedMaskedChildContext;var $={},c;for(c in s)$[c]=o[c];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=$),$}function Zf$1(e){return e=e.childContextTypes,e!=null}function $f$1(){E$1(Wf$1),E$1(H$2)}function ag$1(e,o,s){if(H$2.current!==Vf$1)throw Error(p$1(168));G$1(H$2,o),G$1(Wf$1,s)}function bg$1(e,o,s){var a=e.stateNode;if(o=o.childContextTypes,typeof a.getChildContext!="function")return s;a=a.getChildContext();for(var $ in a)if(!($ in o))throw Error(p$1(108,Ra(e)||"Unknown",$));return A$1({},s,a)}function cg$1(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vf$1,Xf$1=H$2.current,G$1(H$2,e),G$1(Wf$1,Wf$1.current),!0}function dg(e,o,s){var a=e.stateNode;if(!a)throw Error(p$1(169));s?(e=bg$1(e,o,Xf$1),a.__reactInternalMemoizedMergedChildContext=e,E$1(Wf$1),E$1(H$2),G$1(H$2,e)):E$1(Wf$1),G$1(Wf$1,s)}var eg$1=null,fg$1=!1,gg$1=!1;function hg(e){eg$1===null?eg$1=[e]:eg$1.push(e)}function ig$1(e){fg$1=!0,hg(e)}function jg(){if(!gg$1&&eg$1!==null){gg$1=!0;var e=0,o=C$1;try{var s=eg$1;for(C$1=1;e<s.length;e++){var a=s[e];do a=a(!0);while(a!==null)}eg$1=null,fg$1=!1}catch($){throw eg$1!==null&&(eg$1=eg$1.slice(e+1)),ac$1(fc$1,jg),$}finally{C$1=o,gg$1=!1}}return null}var kg$1=[],lg$1=0,mg$1=null,ng$1=0,og$1=[],pg$1=0,qg=null,rg$1=1,sg$1="";function tg$1(e,o){kg$1[lg$1++]=ng$1,kg$1[lg$1++]=mg$1,mg$1=e,ng$1=o}function ug$1(e,o,s){og$1[pg$1++]=rg$1,og$1[pg$1++]=sg$1,og$1[pg$1++]=qg,qg=e;var a=rg$1;e=sg$1;var $=32-oc$1(a)-1;a&=~(1<<$),s+=1;var c=32-oc$1(o)+$;if(30<c){var nt=$-$%5;c=(a&(1<<nt)-1).toString(32),a>>=nt,$-=nt,rg$1=1<<32-oc$1(o)+$|s<<$|a,sg$1=c+e}else rg$1=1<<c|s<<$|a,sg$1=e}function vg$1(e){e.return!==null&&(tg$1(e,1),ug$1(e,1,0))}function wg$1(e){for(;e===mg$1;)mg$1=kg$1[--lg$1],kg$1[lg$1]=null,ng$1=kg$1[--lg$1],kg$1[lg$1]=null;for(;e===qg;)qg=og$1[--pg$1],og$1[pg$1]=null,sg$1=og$1[--pg$1],og$1[pg$1]=null,rg$1=og$1[--pg$1],og$1[pg$1]=null}var xg$1=null,yg$1=null,I$1=!1,zg=null;function Ag$1(e,o){var s=Bg$1(5,null,null,0);s.elementType="DELETED",s.stateNode=o,s.return=e,o=e.deletions,o===null?(e.deletions=[s],e.flags|=16):o.push(s)}function Cg$1(e,o){switch(e.tag){case 5:var s=e.type;return o=o.nodeType!==1||s.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(e.stateNode=o,xg$1=e,yg$1=Lf$1(o.firstChild),!0):!1;case 6:return o=e.pendingProps===""||o.nodeType!==3?null:o,o!==null?(e.stateNode=o,xg$1=e,yg$1=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(s=qg!==null?{id:rg$1,overflow:sg$1}:null,e.memoizedState={dehydrated:o,treeContext:s,retryLane:1073741824},s=Bg$1(18,null,null,0),s.stateNode=o,s.return=e,e.child=s,xg$1=e,yg$1=null,!0):!1;default:return!1}}function Dg$1(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Eg$1(e){if(I$1){var o=yg$1;if(o){var s=o;if(!Cg$1(e,o)){if(Dg$1(e))throw Error(p$1(418));o=Lf$1(s.nextSibling);var a=xg$1;o&&Cg$1(e,o)?Ag$1(a,s):(e.flags=e.flags&-4097|2,I$1=!1,xg$1=e)}}else{if(Dg$1(e))throw Error(p$1(418));e.flags=e.flags&-4097|2,I$1=!1,xg$1=e}}}function Fg$1(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xg$1=e}function Gg$1(e){if(e!==xg$1)return!1;if(!I$1)return Fg$1(e),I$1=!0,!1;var o;if((o=e.tag!==3)&&!(o=e.tag!==5)&&(o=e.type,o=o!=="head"&&o!=="body"&&!Ef$1(e.type,e.memoizedProps)),o&&(o=yg$1)){if(Dg$1(e))throw Hg(),Error(p$1(418));for(;o;)Ag$1(e,o),o=Lf$1(o.nextSibling)}if(Fg$1(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(p$1(317));e:{for(e=e.nextSibling,o=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(o===0){yg$1=Lf$1(e.nextSibling);break e}o--}else s!=="$"&&s!=="$!"&&s!=="$?"||o++}e=e.nextSibling}yg$1=null}}else yg$1=xg$1?Lf$1(e.stateNode.nextSibling):null;return!0}function Hg(){for(var e=yg$1;e;)e=Lf$1(e.nextSibling)}function Ig$1(){yg$1=xg$1=null,I$1=!1}function Jg(e){zg===null?zg=[e]:zg.push(e)}var Kg=ua.ReactCurrentBatchConfig;function Lg$1(e,o,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(p$1(309));var a=s.stateNode}if(!a)throw Error(p$1(147,e));var $=a,c=""+e;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===c?o.ref:(o=function(nt){var at=$.refs;nt===null?delete at[c]:at[c]=nt},o._stringRef=c,o)}if(typeof e!="string")throw Error(p$1(284));if(!s._owner)throw Error(p$1(290,e))}return e}function Mg$1(e,o){throw e=Object.prototype.toString.call(o),Error(p$1(31,e==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":e))}function Ng$1(e){var o=e._init;return o(e._payload)}function Og$1(e){function o(vt,_t){if(e){var $t=vt.deletions;$t===null?(vt.deletions=[_t],vt.flags|=16):$t.push(_t)}}function s(vt,_t){if(!e)return null;for(;_t!==null;)o(vt,_t),_t=_t.sibling;return null}function a(vt,_t){for(vt=new Map;_t!==null;)_t.key!==null?vt.set(_t.key,_t):vt.set(_t.index,_t),_t=_t.sibling;return vt}function $(vt,_t){return vt=Pg$1(vt,_t),vt.index=0,vt.sibling=null,vt}function c(vt,_t,$t){return vt.index=$t,e?($t=vt.alternate,$t!==null?($t=$t.index,$t<_t?(vt.flags|=2,_t):$t):(vt.flags|=2,_t)):(vt.flags|=1048576,_t)}function nt(vt){return e&&vt.alternate===null&&(vt.flags|=2),vt}function at(vt,_t,$t,Pt){return _t===null||_t.tag!==6?(_t=Qg($t,vt.mode,Pt),_t.return=vt,_t):(_t=$(_t,$t),_t.return=vt,_t)}function lt(vt,_t,$t,Pt){var Nt=$t.type;return Nt===ya?it(vt,_t,$t.props.children,Pt,$t.key):_t!==null&&(_t.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===Ha&&Ng$1(Nt)===_t.type)?(Pt=$(_t,$t.props),Pt.ref=Lg$1(vt,_t,$t),Pt.return=vt,Pt):(Pt=Rg($t.type,$t.key,$t.props,null,vt.mode,Pt),Pt.ref=Lg$1(vt,_t,$t),Pt.return=vt,Pt)}function et(vt,_t,$t,Pt){return _t===null||_t.tag!==4||_t.stateNode.containerInfo!==$t.containerInfo||_t.stateNode.implementation!==$t.implementation?(_t=Sg$1($t,vt.mode,Pt),_t.return=vt,_t):(_t=$(_t,$t.children||[]),_t.return=vt,_t)}function it(vt,_t,$t,Pt,Nt){return _t===null||_t.tag!==7?(_t=Tg$1($t,vt.mode,Pt,Nt),_t.return=vt,_t):(_t=$(_t,$t),_t.return=vt,_t)}function st(vt,_t,$t){if(typeof _t=="string"&&_t!==""||typeof _t=="number")return _t=Qg(""+_t,vt.mode,$t),_t.return=vt,_t;if(typeof _t=="object"&&_t!==null){switch(_t.$$typeof){case va:return $t=Rg(_t.type,_t.key,_t.props,null,vt.mode,$t),$t.ref=Lg$1(vt,null,_t),$t.return=vt,$t;case wa:return _t=Sg$1(_t,vt.mode,$t),_t.return=vt,_t;case Ha:var Pt=_t._init;return st(vt,Pt(_t._payload),$t)}if(eb$1(_t)||Ka(_t))return _t=Tg$1(_t,vt.mode,$t,null),_t.return=vt,_t;Mg$1(vt,_t)}return null}function ct(vt,_t,$t,Pt){var Nt=_t!==null?_t.key:null;if(typeof $t=="string"&&$t!==""||typeof $t=="number")return Nt!==null?null:at(vt,_t,""+$t,Pt);if(typeof $t=="object"&&$t!==null){switch($t.$$typeof){case va:return $t.key===Nt?lt(vt,_t,$t,Pt):null;case wa:return $t.key===Nt?et(vt,_t,$t,Pt):null;case Ha:return Nt=$t._init,ct(vt,_t,Nt($t._payload),Pt)}if(eb$1($t)||Ka($t))return Nt!==null?null:it(vt,_t,$t,Pt,null);Mg$1(vt,$t)}return null}function ft(vt,_t,$t,Pt,Nt){if(typeof Pt=="string"&&Pt!==""||typeof Pt=="number")return vt=vt.get($t)||null,at(_t,vt,""+Pt,Nt);if(typeof Pt=="object"&&Pt!==null){switch(Pt.$$typeof){case va:return vt=vt.get(Pt.key===null?$t:Pt.key)||null,lt(_t,vt,Pt,Nt);case wa:return vt=vt.get(Pt.key===null?$t:Pt.key)||null,et(_t,vt,Pt,Nt);case Ha:var Lt=Pt._init;return ft(vt,_t,$t,Lt(Pt._payload),Nt)}if(eb$1(Pt)||Ka(Pt))return vt=vt.get($t)||null,it(_t,vt,Pt,Nt,null);Mg$1(_t,Pt)}return null}function pt(vt,_t,$t,Pt){for(var Nt=null,Lt=null,Ft=_t,Jt=_t=0,_r=null;Ft!==null&&Jt<$t.length;Jt++){Ft.index>Jt?(_r=Ft,Ft=null):_r=Ft.sibling;var wr=ct(vt,Ft,$t[Jt],Pt);if(wr===null){Ft===null&&(Ft=_r);break}e&&Ft&&wr.alternate===null&&o(vt,Ft),_t=c(wr,_t,Jt),Lt===null?Nt=wr:Lt.sibling=wr,Lt=wr,Ft=_r}if(Jt===$t.length)return s(vt,Ft),I$1&&tg$1(vt,Jt),Nt;if(Ft===null){for(;Jt<$t.length;Jt++)Ft=st(vt,$t[Jt],Pt),Ft!==null&&(_t=c(Ft,_t,Jt),Lt===null?Nt=Ft:Lt.sibling=Ft,Lt=Ft);return I$1&&tg$1(vt,Jt),Nt}for(Ft=a(vt,Ft);Jt<$t.length;Jt++)_r=ft(Ft,vt,Jt,$t[Jt],Pt),_r!==null&&(e&&_r.alternate!==null&&Ft.delete(_r.key===null?Jt:_r.key),_t=c(_r,_t,Jt),Lt===null?Nt=_r:Lt.sibling=_r,Lt=_r);return e&&Ft.forEach(function(tn){return o(vt,tn)}),I$1&&tg$1(vt,Jt),Nt}function gt(vt,_t,$t,Pt){var Nt=Ka($t);if(typeof Nt!="function")throw Error(p$1(150));if($t=Nt.call($t),$t==null)throw Error(p$1(151));for(var Lt=Nt=null,Ft=_t,Jt=_t=0,_r=null,wr=$t.next();Ft!==null&&!wr.done;Jt++,wr=$t.next()){Ft.index>Jt?(_r=Ft,Ft=null):_r=Ft.sibling;var tn=ct(vt,Ft,wr.value,Pt);if(tn===null){Ft===null&&(Ft=_r);break}e&&Ft&&tn.alternate===null&&o(vt,Ft),_t=c(tn,_t,Jt),Lt===null?Nt=tn:Lt.sibling=tn,Lt=tn,Ft=_r}if(wr.done)return s(vt,Ft),I$1&&tg$1(vt,Jt),Nt;if(Ft===null){for(;!wr.done;Jt++,wr=$t.next())wr=st(vt,wr.value,Pt),wr!==null&&(_t=c(wr,_t,Jt),Lt===null?Nt=wr:Lt.sibling=wr,Lt=wr);return I$1&&tg$1(vt,Jt),Nt}for(Ft=a(vt,Ft);!wr.done;Jt++,wr=$t.next())wr=ft(Ft,vt,Jt,wr.value,Pt),wr!==null&&(e&&wr.alternate!==null&&Ft.delete(wr.key===null?Jt:wr.key),_t=c(wr,_t,Jt),Lt===null?Nt=wr:Lt.sibling=wr,Lt=wr);return e&&Ft.forEach(function(Wt){return o(vt,Wt)}),I$1&&tg$1(vt,Jt),Nt}function wt(vt,_t,$t,Pt){if(typeof $t=="object"&&$t!==null&&$t.type===ya&&$t.key===null&&($t=$t.props.children),typeof $t=="object"&&$t!==null){switch($t.$$typeof){case va:e:{for(var Nt=$t.key,Lt=_t;Lt!==null;){if(Lt.key===Nt){if(Nt=$t.type,Nt===ya){if(Lt.tag===7){s(vt,Lt.sibling),_t=$(Lt,$t.props.children),_t.return=vt,vt=_t;break e}}else if(Lt.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===Ha&&Ng$1(Nt)===Lt.type){s(vt,Lt.sibling),_t=$(Lt,$t.props),_t.ref=Lg$1(vt,Lt,$t),_t.return=vt,vt=_t;break e}s(vt,Lt);break}else o(vt,Lt);Lt=Lt.sibling}$t.type===ya?(_t=Tg$1($t.props.children,vt.mode,Pt,$t.key),_t.return=vt,vt=_t):(Pt=Rg($t.type,$t.key,$t.props,null,vt.mode,Pt),Pt.ref=Lg$1(vt,_t,$t),Pt.return=vt,vt=Pt)}return nt(vt);case wa:e:{for(Lt=$t.key;_t!==null;){if(_t.key===Lt)if(_t.tag===4&&_t.stateNode.containerInfo===$t.containerInfo&&_t.stateNode.implementation===$t.implementation){s(vt,_t.sibling),_t=$(_t,$t.children||[]),_t.return=vt,vt=_t;break e}else{s(vt,_t);break}else o(vt,_t);_t=_t.sibling}_t=Sg$1($t,vt.mode,Pt),_t.return=vt,vt=_t}return nt(vt);case Ha:return Lt=$t._init,wt(vt,_t,Lt($t._payload),Pt)}if(eb$1($t))return pt(vt,_t,$t,Pt);if(Ka($t))return gt(vt,_t,$t,Pt);Mg$1(vt,$t)}return typeof $t=="string"&&$t!==""||typeof $t=="number"?($t=""+$t,_t!==null&&_t.tag===6?(s(vt,_t.sibling),_t=$(_t,$t),_t.return=vt,vt=_t):(s(vt,_t),_t=Qg($t,vt.mode,Pt),_t.return=vt,vt=_t),nt(vt)):s(vt,_t)}return wt}var Ug$1=Og$1(!0),Vg=Og$1(!1),Wg=Uf$1(null),Xg=null,Yg=null,Zg=null;function $g$1(){Zg=Yg=Xg=null}function ah(e){var o=Wg.current;E$1(Wg),e._currentValue=o}function bh$1(e,o,s){for(;e!==null;){var a=e.alternate;if((e.childLanes&o)!==o?(e.childLanes|=o,a!==null&&(a.childLanes|=o)):a!==null&&(a.childLanes&o)!==o&&(a.childLanes|=o),e===s)break;e=e.return}}function ch(e,o){Xg=e,Zg=Yg=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&o&&(dh=!0),e.firstContext=null)}function eh$1(e){var o=e._currentValue;if(Zg!==e)if(e={context:e,memoizedValue:o,next:null},Yg===null){if(Xg===null)throw Error(p$1(308));Yg=e,Xg.dependencies={lanes:0,firstContext:e}}else Yg=Yg.next=e;return o}var fh=null;function gh$1(e){fh===null?fh=[e]:fh.push(e)}function hh$1(e,o,s,a){var $=o.interleaved;return $===null?(s.next=s,gh$1(o)):(s.next=$.next,$.next=s),o.interleaved=s,ih(e,a)}function ih(e,o){e.lanes|=o;var s=e.alternate;for(s!==null&&(s.lanes|=o),s=e,e=e.return;e!==null;)e.childLanes|=o,s=e.alternate,s!==null&&(s.childLanes|=o),s=e,e=e.return;return s.tag===3?s.stateNode:null}var jh$1=!1;function kh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(e,o){e=e.updateQueue,o.updateQueue===e&&(o.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function mh$1(e,o){return{eventTime:e,lane:o,tag:0,payload:null,callback:null,next:null}}function nh(e,o,s){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,K&2){var $=a.pending;return $===null?o.next=o:(o.next=$.next,$.next=o),a.pending=o,ih(e,s)}return $=a.interleaved,$===null?(o.next=o,gh$1(a)):(o.next=$.next,$.next=o),a.interleaved=o,ih(e,s)}function oh$1(e,o,s){if(o=o.updateQueue,o!==null&&(o=o.shared,(s&4194240)!==0)){var a=o.lanes;a&=e.pendingLanes,s|=a,o.lanes=s,Cc$1(e,s)}}function ph(e,o){var s=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,s===a)){var $=null,c=null;if(s=s.firstBaseUpdate,s!==null){do{var nt={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};c===null?$=c=nt:c=c.next=nt,s=s.next}while(s!==null);c===null?$=c=o:c=c.next=o}else $=c=o;s={baseState:a.baseState,firstBaseUpdate:$,lastBaseUpdate:c,shared:a.shared,effects:a.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=o:e.next=o,s.lastBaseUpdate=o}function qh$1(e,o,s,a){var $=e.updateQueue;jh$1=!1;var c=$.firstBaseUpdate,nt=$.lastBaseUpdate,at=$.shared.pending;if(at!==null){$.shared.pending=null;var lt=at,et=lt.next;lt.next=null,nt===null?c=et:nt.next=et,nt=lt;var it=e.alternate;it!==null&&(it=it.updateQueue,at=it.lastBaseUpdate,at!==nt&&(at===null?it.firstBaseUpdate=et:at.next=et,it.lastBaseUpdate=lt))}if(c!==null){var st=$.baseState;nt=0,it=et=lt=null,at=c;do{var ct=at.lane,ft=at.eventTime;if((a&ct)===ct){it!==null&&(it=it.next={eventTime:ft,lane:0,tag:at.tag,payload:at.payload,callback:at.callback,next:null});e:{var pt=e,gt=at;switch(ct=o,ft=s,gt.tag){case 1:if(pt=gt.payload,typeof pt=="function"){st=pt.call(ft,st,ct);break e}st=pt;break e;case 3:pt.flags=pt.flags&-65537|128;case 0:if(pt=gt.payload,ct=typeof pt=="function"?pt.call(ft,st,ct):pt,ct==null)break e;st=A$1({},st,ct);break e;case 2:jh$1=!0}}at.callback!==null&&at.lane!==0&&(e.flags|=64,ct=$.effects,ct===null?$.effects=[at]:ct.push(at))}else ft={eventTime:ft,lane:ct,tag:at.tag,payload:at.payload,callback:at.callback,next:null},it===null?(et=it=ft,lt=st):it=it.next=ft,nt|=ct;if(at=at.next,at===null){if(at=$.shared.pending,at===null)break;ct=at,at=ct.next,ct.next=null,$.lastBaseUpdate=ct,$.shared.pending=null}}while(!0);if(it===null&&(lt=st),$.baseState=lt,$.firstBaseUpdate=et,$.lastBaseUpdate=it,o=$.shared.interleaved,o!==null){$=o;do nt|=$.lane,$=$.next;while($!==o)}else c===null&&($.shared.lanes=0);rh$1|=nt,e.lanes=nt,e.memoizedState=st}}function sh(e,o,s){if(e=o.effects,o.effects=null,e!==null)for(o=0;o<e.length;o++){var a=e[o],$=a.callback;if($!==null){if(a.callback=null,a=s,typeof $!="function")throw Error(p$1(191,$));$.call(a)}}}var th$1={},uh=Uf$1(th$1),vh$1=Uf$1(th$1),wh$1=Uf$1(th$1);function xh$1(e){if(e===th$1)throw Error(p$1(174));return e}function yh$1(e,o){switch(G$1(wh$1,o),G$1(vh$1,e),G$1(uh,th$1),e=o.nodeType,e){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:lb$1(null,"");break;default:e=e===8?o.parentNode:o,o=e.namespaceURI||null,e=e.tagName,o=lb$1(o,e)}E$1(uh),G$1(uh,o)}function zh$1(){E$1(uh),E$1(vh$1),E$1(wh$1)}function Ah$1(e){xh$1(wh$1.current);var o=xh$1(uh.current),s=lb$1(o,e.type);o!==s&&(G$1(vh$1,e),G$1(uh,s))}function Bh$1(e){vh$1.current===e&&(E$1(uh),E$1(vh$1))}var L$1=Uf$1(0);function Ch$1(e){for(var o=e;o!==null;){if(o.tag===13){var s=o.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break;for(;o.sibling===null;){if(o.return===null||o.return===e)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Dh$1=[];function Eh(){for(var e=0;e<Dh$1.length;e++)Dh$1[e]._workInProgressVersionPrimary=null;Dh$1.length=0}var Fh$1=ua.ReactCurrentDispatcher,Gh$1=ua.ReactCurrentBatchConfig,Hh$1=0,M$1=null,N$1=null,O$2=null,Ih$1=!1,Jh$1=!1,Kh$1=0,Lh$1=0;function P$1(){throw Error(p$1(321))}function Mh$1(e,o){if(o===null)return!1;for(var s=0;s<o.length&&s<e.length;s++)if(!He$1(e[s],o[s]))return!1;return!0}function Nh$1(e,o,s,a,$,c){if(Hh$1=c,M$1=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Fh$1.current=e===null||e.memoizedState===null?Oh$1:Ph$1,e=s(a,$),Jh$1){c=0;do{if(Jh$1=!1,Kh$1=0,25<=c)throw Error(p$1(301));c+=1,O$2=N$1=null,o.updateQueue=null,Fh$1.current=Qh$1,e=s(a,$)}while(Jh$1)}if(Fh$1.current=Rh$1,o=N$1!==null&&N$1.next!==null,Hh$1=0,O$2=N$1=M$1=null,Ih$1=!1,o)throw Error(p$1(300));return e}function Sh$1(){var e=Kh$1!==0;return Kh$1=0,e}function Th$1(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return O$2===null?M$1.memoizedState=O$2=e:O$2=O$2.next=e,O$2}function Uh$1(){if(N$1===null){var e=M$1.alternate;e=e!==null?e.memoizedState:null}else e=N$1.next;var o=O$2===null?M$1.memoizedState:O$2.next;if(o!==null)O$2=o,N$1=e;else{if(e===null)throw Error(p$1(310));N$1=e,e={memoizedState:N$1.memoizedState,baseState:N$1.baseState,baseQueue:N$1.baseQueue,queue:N$1.queue,next:null},O$2===null?M$1.memoizedState=O$2=e:O$2=O$2.next=e}return O$2}function Vh$1(e,o){return typeof o=="function"?o(e):o}function Wh$1(e){var o=Uh$1(),s=o.queue;if(s===null)throw Error(p$1(311));s.lastRenderedReducer=e;var a=N$1,$=a.baseQueue,c=s.pending;if(c!==null){if($!==null){var nt=$.next;$.next=c.next,c.next=nt}a.baseQueue=$=c,s.pending=null}if($!==null){c=$.next,a=a.baseState;var at=nt=null,lt=null,et=c;do{var it=et.lane;if((Hh$1&it)===it)lt!==null&&(lt=lt.next={lane:0,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null}),a=et.hasEagerState?et.eagerState:e(a,et.action);else{var st={lane:it,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null};lt===null?(at=lt=st,nt=a):lt=lt.next=st,M$1.lanes|=it,rh$1|=it}et=et.next}while(et!==null&&et!==c);lt===null?nt=a:lt.next=at,He$1(a,o.memoizedState)||(dh=!0),o.memoizedState=a,o.baseState=nt,o.baseQueue=lt,s.lastRenderedState=a}if(e=s.interleaved,e!==null){$=e;do c=$.lane,M$1.lanes|=c,rh$1|=c,$=$.next;while($!==e)}else $===null&&(s.lanes=0);return[o.memoizedState,s.dispatch]}function Xh(e){var o=Uh$1(),s=o.queue;if(s===null)throw Error(p$1(311));s.lastRenderedReducer=e;var a=s.dispatch,$=s.pending,c=o.memoizedState;if($!==null){s.pending=null;var nt=$=$.next;do c=e(c,nt.action),nt=nt.next;while(nt!==$);He$1(c,o.memoizedState)||(dh=!0),o.memoizedState=c,o.baseQueue===null&&(o.baseState=c),s.lastRenderedState=c}return[c,a]}function Yh$1(){}function Zh$1(e,o){var s=M$1,a=Uh$1(),$=o(),c=!He$1(a.memoizedState,$);if(c&&(a.memoizedState=$,dh=!0),a=a.queue,$h$1(ai$1.bind(null,s,a,e),[e]),a.getSnapshot!==o||c||O$2!==null&&O$2.memoizedState.tag&1){if(s.flags|=2048,bi$1(9,ci$1.bind(null,s,a,$,o),void 0,null),Q$1===null)throw Error(p$1(349));Hh$1&30||di$1(s,o,$)}return $}function di$1(e,o,s){e.flags|=16384,e={getSnapshot:o,value:s},o=M$1.updateQueue,o===null?(o={lastEffect:null,stores:null},M$1.updateQueue=o,o.stores=[e]):(s=o.stores,s===null?o.stores=[e]:s.push(e))}function ci$1(e,o,s,a){o.value=s,o.getSnapshot=a,ei$1(o)&&fi$1(e)}function ai$1(e,o,s){return s(function(){ei$1(o)&&fi$1(e)})}function ei$1(e){var o=e.getSnapshot;e=e.value;try{var s=o();return!He$1(e,s)}catch{return!0}}function fi$1(e){var o=ih(e,1);o!==null&&gi$1(o,e,1,-1)}function hi$1(e){var o=Th$1();return typeof e=="function"&&(e=e()),o.memoizedState=o.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh$1,lastRenderedState:e},o.queue=e,e=e.dispatch=ii.bind(null,M$1,e),[o.memoizedState,e]}function bi$1(e,o,s,a){return e={tag:e,create:o,destroy:s,deps:a,next:null},o=M$1.updateQueue,o===null?(o={lastEffect:null,stores:null},M$1.updateQueue=o,o.lastEffect=e.next=e):(s=o.lastEffect,s===null?o.lastEffect=e.next=e:(a=s.next,s.next=e,e.next=a,o.lastEffect=e)),e}function ji$1(){return Uh$1().memoizedState}function ki$1(e,o,s,a){var $=Th$1();M$1.flags|=e,$.memoizedState=bi$1(1|o,s,void 0,a===void 0?null:a)}function li$1(e,o,s,a){var $=Uh$1();a=a===void 0?null:a;var c=void 0;if(N$1!==null){var nt=N$1.memoizedState;if(c=nt.destroy,a!==null&&Mh$1(a,nt.deps)){$.memoizedState=bi$1(o,s,c,a);return}}M$1.flags|=e,$.memoizedState=bi$1(1|o,s,c,a)}function mi$1(e,o){return ki$1(8390656,8,e,o)}function $h$1(e,o){return li$1(2048,8,e,o)}function ni(e,o){return li$1(4,2,e,o)}function oi$1(e,o){return li$1(4,4,e,o)}function pi$1(e,o){if(typeof o=="function")return e=e(),o(e),function(){o(null)};if(o!=null)return e=e(),o.current=e,function(){o.current=null}}function qi$1(e,o,s){return s=s!=null?s.concat([e]):null,li$1(4,4,pi$1.bind(null,o,e),s)}function ri(){}function si$1(e,o){var s=Uh$1();o=o===void 0?null:o;var a=s.memoizedState;return a!==null&&o!==null&&Mh$1(o,a[1])?a[0]:(s.memoizedState=[e,o],e)}function ti(e,o){var s=Uh$1();o=o===void 0?null:o;var a=s.memoizedState;return a!==null&&o!==null&&Mh$1(o,a[1])?a[0]:(e=e(),s.memoizedState=[e,o],e)}function ui$1(e,o,s){return Hh$1&21?(He$1(s,o)||(s=yc$1(),M$1.lanes|=s,rh$1|=s,e.baseState=!0),o):(e.baseState&&(e.baseState=!1,dh=!0),e.memoizedState=s)}function vi$1(e,o){var s=C$1;C$1=s!==0&&4>s?s:4,e(!0);var a=Gh$1.transition;Gh$1.transition={};try{e(!1),o()}finally{C$1=s,Gh$1.transition=a}}function wi$1(){return Uh$1().memoizedState}function xi$1(e,o,s){var a=yi$1(e);if(s={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null},zi$1(e))Ai$1(o,s);else if(s=hh$1(e,o,s,a),s!==null){var $=R$1();gi$1(s,e,a,$),Bi$1(s,o,a)}}function ii(e,o,s){var a=yi$1(e),$={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null};if(zi$1(e))Ai$1(o,$);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=o.lastRenderedReducer,c!==null))try{var nt=o.lastRenderedState,at=c(nt,s);if($.hasEagerState=!0,$.eagerState=at,He$1(at,nt)){var lt=o.interleaved;lt===null?($.next=$,gh$1(o)):($.next=lt.next,lt.next=$),o.interleaved=$;return}}catch{}finally{}s=hh$1(e,o,$,a),s!==null&&($=R$1(),gi$1(s,e,a,$),Bi$1(s,o,a))}}function zi$1(e){var o=e.alternate;return e===M$1||o!==null&&o===M$1}function Ai$1(e,o){Jh$1=Ih$1=!0;var s=e.pending;s===null?o.next=o:(o.next=s.next,s.next=o),e.pending=o}function Bi$1(e,o,s){if(s&4194240){var a=o.lanes;a&=e.pendingLanes,s|=a,o.lanes=s,Cc$1(e,s)}}var Rh$1={readContext:eh$1,useCallback:P$1,useContext:P$1,useEffect:P$1,useImperativeHandle:P$1,useInsertionEffect:P$1,useLayoutEffect:P$1,useMemo:P$1,useReducer:P$1,useRef:P$1,useState:P$1,useDebugValue:P$1,useDeferredValue:P$1,useTransition:P$1,useMutableSource:P$1,useSyncExternalStore:P$1,useId:P$1,unstable_isNewReconciler:!1},Oh$1={readContext:eh$1,useCallback:function(e,o){return Th$1().memoizedState=[e,o===void 0?null:o],e},useContext:eh$1,useEffect:mi$1,useImperativeHandle:function(e,o,s){return s=s!=null?s.concat([e]):null,ki$1(4194308,4,pi$1.bind(null,o,e),s)},useLayoutEffect:function(e,o){return ki$1(4194308,4,e,o)},useInsertionEffect:function(e,o){return ki$1(4,2,e,o)},useMemo:function(e,o){var s=Th$1();return o=o===void 0?null:o,e=e(),s.memoizedState=[e,o],e},useReducer:function(e,o,s){var a=Th$1();return o=s!==void 0?s(o):o,a.memoizedState=a.baseState=o,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},a.queue=e,e=e.dispatch=xi$1.bind(null,M$1,e),[a.memoizedState,e]},useRef:function(e){var o=Th$1();return e={current:e},o.memoizedState=e},useState:hi$1,useDebugValue:ri,useDeferredValue:function(e){return Th$1().memoizedState=e},useTransition:function(){var e=hi$1(!1),o=e[0];return e=vi$1.bind(null,e[1]),Th$1().memoizedState=e,[o,e]},useMutableSource:function(){},useSyncExternalStore:function(e,o,s){var a=M$1,$=Th$1();if(I$1){if(s===void 0)throw Error(p$1(407));s=s()}else{if(s=o(),Q$1===null)throw Error(p$1(349));Hh$1&30||di$1(a,o,s)}$.memoizedState=s;var c={value:s,getSnapshot:o};return $.queue=c,mi$1(ai$1.bind(null,a,c,e),[e]),a.flags|=2048,bi$1(9,ci$1.bind(null,a,c,s,o),void 0,null),s},useId:function(){var e=Th$1(),o=Q$1.identifierPrefix;if(I$1){var s=sg$1,a=rg$1;s=(a&~(1<<32-oc$1(a)-1)).toString(32)+s,o=":"+o+"R"+s,s=Kh$1++,0<s&&(o+="H"+s.toString(32)),o+=":"}else s=Lh$1++,o=":"+o+"r"+s.toString(32)+":";return e.memoizedState=o},unstable_isNewReconciler:!1},Ph$1={readContext:eh$1,useCallback:si$1,useContext:eh$1,useEffect:$h$1,useImperativeHandle:qi$1,useInsertionEffect:ni,useLayoutEffect:oi$1,useMemo:ti,useReducer:Wh$1,useRef:ji$1,useState:function(){return Wh$1(Vh$1)},useDebugValue:ri,useDeferredValue:function(e){var o=Uh$1();return ui$1(o,N$1.memoizedState,e)},useTransition:function(){var e=Wh$1(Vh$1)[0],o=Uh$1().memoizedState;return[e,o]},useMutableSource:Yh$1,useSyncExternalStore:Zh$1,useId:wi$1,unstable_isNewReconciler:!1},Qh$1={readContext:eh$1,useCallback:si$1,useContext:eh$1,useEffect:$h$1,useImperativeHandle:qi$1,useInsertionEffect:ni,useLayoutEffect:oi$1,useMemo:ti,useReducer:Xh,useRef:ji$1,useState:function(){return Xh(Vh$1)},useDebugValue:ri,useDeferredValue:function(e){var o=Uh$1();return N$1===null?o.memoizedState=e:ui$1(o,N$1.memoizedState,e)},useTransition:function(){var e=Xh(Vh$1)[0],o=Uh$1().memoizedState;return[e,o]},useMutableSource:Yh$1,useSyncExternalStore:Zh$1,useId:wi$1,unstable_isNewReconciler:!1};function Ci$1(e,o){if(e&&e.defaultProps){o=A$1({},o),e=e.defaultProps;for(var s in e)o[s]===void 0&&(o[s]=e[s]);return o}return o}function Di$1(e,o,s,a){o=e.memoizedState,s=s(a,o),s=s==null?o:A$1({},o,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Ei$1={isMounted:function(e){return(e=e._reactInternals)?Vb$1(e)===e:!1},enqueueSetState:function(e,o,s){e=e._reactInternals;var a=R$1(),$=yi$1(e),c=mh$1(a,$);c.payload=o,s!=null&&(c.callback=s),o=nh(e,c,$),o!==null&&(gi$1(o,e,$,a),oh$1(o,e,$))},enqueueReplaceState:function(e,o,s){e=e._reactInternals;var a=R$1(),$=yi$1(e),c=mh$1(a,$);c.tag=1,c.payload=o,s!=null&&(c.callback=s),o=nh(e,c,$),o!==null&&(gi$1(o,e,$,a),oh$1(o,e,$))},enqueueForceUpdate:function(e,o){e=e._reactInternals;var s=R$1(),a=yi$1(e),$=mh$1(s,a);$.tag=2,o!=null&&($.callback=o),o=nh(e,$,a),o!==null&&(gi$1(o,e,a,s),oh$1(o,e,a))}};function Fi$1(e,o,s,a,$,c,nt){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,c,nt):o.prototype&&o.prototype.isPureReactComponent?!Ie(s,a)||!Ie($,c):!0}function Gi$1(e,o,s){var a=!1,$=Vf$1,c=o.contextType;return typeof c=="object"&&c!==null?c=eh$1(c):($=Zf$1(o)?Xf$1:H$2.current,a=o.contextTypes,c=(a=a!=null)?Yf$1(e,$):Vf$1),o=new o(s,c),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ei$1,e.stateNode=o,o._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=$,e.__reactInternalMemoizedMaskedChildContext=c),o}function Hi$1(e,o,s,a){e=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(s,a),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(s,a),o.state!==e&&Ei$1.enqueueReplaceState(o,o.state,null)}function Ii$1(e,o,s,a){var $=e.stateNode;$.props=s,$.state=e.memoizedState,$.refs={},kh(e);var c=o.contextType;typeof c=="object"&&c!==null?$.context=eh$1(c):(c=Zf$1(o)?Xf$1:H$2.current,$.context=Yf$1(e,c)),$.state=e.memoizedState,c=o.getDerivedStateFromProps,typeof c=="function"&&(Di$1(e,o,c,s),$.state=e.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof $.getSnapshotBeforeUpdate=="function"||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(o=$.state,typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount(),o!==$.state&&Ei$1.enqueueReplaceState($,$.state,null),qh$1(e,s,$,a),$.state=e.memoizedState),typeof $.componentDidMount=="function"&&(e.flags|=4194308)}function Ji$1(e,o){try{var s="",a=o;do s+=Pa(a),a=a.return;while(a);var $=s}catch(c){$=`
Error generating stack: `+c.message+`
`+c.stack}return{value:e,source:o,stack:$,digest:null}}function Ki$1(e,o,s){return{value:e,source:null,stack:s??null,digest:o??null}}function Li$1(e,o){try{console.error(o.value)}catch(s){setTimeout(function(){throw s})}}var Mi$1=typeof WeakMap=="function"?WeakMap:Map;function Ni$1(e,o,s){s=mh$1(-1,s),s.tag=3,s.payload={element:null};var a=o.value;return s.callback=function(){Oi$1||(Oi$1=!0,Pi$1=a),Li$1(e,o)},s}function Qi$1(e,o,s){s=mh$1(-1,s),s.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var $=o.value;s.payload=function(){return a($)},s.callback=function(){Li$1(e,o)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(s.callback=function(){Li$1(e,o),typeof a!="function"&&(Ri$1===null?Ri$1=new Set([this]):Ri$1.add(this));var nt=o.stack;this.componentDidCatch(o.value,{componentStack:nt!==null?nt:""})}),s}function Si$1(e,o,s){var a=e.pingCache;if(a===null){a=e.pingCache=new Mi$1;var $=new Set;a.set(o,$)}else $=a.get(o),$===void 0&&($=new Set,a.set(o,$));$.has(s)||($.add(s),e=Ti$1.bind(null,e,o,s),o.then(e,e))}function Ui$1(e){do{var o;if((o=e.tag===13)&&(o=e.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return e;e=e.return}while(e!==null);return null}function Vi$1(e,o,s,a,$){return e.mode&1?(e.flags|=65536,e.lanes=$,e):(e===o?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(o=mh$1(-1,1),o.tag=2,nh(s,o,1))),s.lanes|=1),e)}var Wi$1=ua.ReactCurrentOwner,dh=!1;function Xi$1(e,o,s,a){o.child=e===null?Vg(o,null,s,a):Ug$1(o,e.child,s,a)}function Yi$1(e,o,s,a,$){s=s.render;var c=o.ref;return ch(o,$),a=Nh$1(e,o,s,a,c,$),s=Sh$1(),e!==null&&!dh?(o.updateQueue=e.updateQueue,o.flags&=-2053,e.lanes&=~$,Zi$1(e,o,$)):(I$1&&s&&vg$1(o),o.flags|=1,Xi$1(e,o,a,$),o.child)}function $i$1(e,o,s,a,$){if(e===null){var c=s.type;return typeof c=="function"&&!aj(c)&&c.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(o.tag=15,o.type=c,bj(e,o,c,a,$)):(e=Rg(s.type,null,a,o,o.mode,$),e.ref=o.ref,e.return=o,o.child=e)}if(c=e.child,!(e.lanes&$)){var nt=c.memoizedProps;if(s=s.compare,s=s!==null?s:Ie,s(nt,a)&&e.ref===o.ref)return Zi$1(e,o,$)}return o.flags|=1,e=Pg$1(c,a),e.ref=o.ref,e.return=o,o.child=e}function bj(e,o,s,a,$){if(e!==null){var c=e.memoizedProps;if(Ie(c,a)&&e.ref===o.ref)if(dh=!1,o.pendingProps=a=c,(e.lanes&$)!==0)e.flags&131072&&(dh=!0);else return o.lanes=e.lanes,Zi$1(e,o,$)}return cj(e,o,s,a,$)}function dj(e,o,s){var a=o.pendingProps,$=a.children,c=e!==null?e.memoizedState:null;if(a.mode==="hidden")if(!(o.mode&1))o.memoizedState={baseLanes:0,cachePool:null,transitions:null},G$1(ej,fj),fj|=s;else{if(!(s&1073741824))return e=c!==null?c.baseLanes|s:s,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:e,cachePool:null,transitions:null},o.updateQueue=null,G$1(ej,fj),fj|=e,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=c!==null?c.baseLanes:s,G$1(ej,fj),fj|=a}else c!==null?(a=c.baseLanes|s,o.memoizedState=null):a=s,G$1(ej,fj),fj|=a;return Xi$1(e,o,$,s),o.child}function gj(e,o){var s=o.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(o.flags|=512,o.flags|=2097152)}function cj(e,o,s,a,$){var c=Zf$1(s)?Xf$1:H$2.current;return c=Yf$1(o,c),ch(o,$),s=Nh$1(e,o,s,a,c,$),a=Sh$1(),e!==null&&!dh?(o.updateQueue=e.updateQueue,o.flags&=-2053,e.lanes&=~$,Zi$1(e,o,$)):(I$1&&a&&vg$1(o),o.flags|=1,Xi$1(e,o,s,$),o.child)}function hj(e,o,s,a,$){if(Zf$1(s)){var c=!0;cg$1(o)}else c=!1;if(ch(o,$),o.stateNode===null)ij(e,o),Gi$1(o,s,a),Ii$1(o,s,a,$),a=!0;else if(e===null){var nt=o.stateNode,at=o.memoizedProps;nt.props=at;var lt=nt.context,et=s.contextType;typeof et=="object"&&et!==null?et=eh$1(et):(et=Zf$1(s)?Xf$1:H$2.current,et=Yf$1(o,et));var it=s.getDerivedStateFromProps,st=typeof it=="function"||typeof nt.getSnapshotBeforeUpdate=="function";st||typeof nt.UNSAFE_componentWillReceiveProps!="function"&&typeof nt.componentWillReceiveProps!="function"||(at!==a||lt!==et)&&Hi$1(o,nt,a,et),jh$1=!1;var ct=o.memoizedState;nt.state=ct,qh$1(o,a,nt,$),lt=o.memoizedState,at!==a||ct!==lt||Wf$1.current||jh$1?(typeof it=="function"&&(Di$1(o,s,it,a),lt=o.memoizedState),(at=jh$1||Fi$1(o,s,at,a,ct,lt,et))?(st||typeof nt.UNSAFE_componentWillMount!="function"&&typeof nt.componentWillMount!="function"||(typeof nt.componentWillMount=="function"&&nt.componentWillMount(),typeof nt.UNSAFE_componentWillMount=="function"&&nt.UNSAFE_componentWillMount()),typeof nt.componentDidMount=="function"&&(o.flags|=4194308)):(typeof nt.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=a,o.memoizedState=lt),nt.props=a,nt.state=lt,nt.context=et,a=at):(typeof nt.componentDidMount=="function"&&(o.flags|=4194308),a=!1)}else{nt=o.stateNode,lh(e,o),at=o.memoizedProps,et=o.type===o.elementType?at:Ci$1(o.type,at),nt.props=et,st=o.pendingProps,ct=nt.context,lt=s.contextType,typeof lt=="object"&&lt!==null?lt=eh$1(lt):(lt=Zf$1(s)?Xf$1:H$2.current,lt=Yf$1(o,lt));var ft=s.getDerivedStateFromProps;(it=typeof ft=="function"||typeof nt.getSnapshotBeforeUpdate=="function")||typeof nt.UNSAFE_componentWillReceiveProps!="function"&&typeof nt.componentWillReceiveProps!="function"||(at!==st||ct!==lt)&&Hi$1(o,nt,a,lt),jh$1=!1,ct=o.memoizedState,nt.state=ct,qh$1(o,a,nt,$);var pt=o.memoizedState;at!==st||ct!==pt||Wf$1.current||jh$1?(typeof ft=="function"&&(Di$1(o,s,ft,a),pt=o.memoizedState),(et=jh$1||Fi$1(o,s,et,a,ct,pt,lt)||!1)?(it||typeof nt.UNSAFE_componentWillUpdate!="function"&&typeof nt.componentWillUpdate!="function"||(typeof nt.componentWillUpdate=="function"&&nt.componentWillUpdate(a,pt,lt),typeof nt.UNSAFE_componentWillUpdate=="function"&&nt.UNSAFE_componentWillUpdate(a,pt,lt)),typeof nt.componentDidUpdate=="function"&&(o.flags|=4),typeof nt.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof nt.componentDidUpdate!="function"||at===e.memoizedProps&&ct===e.memoizedState||(o.flags|=4),typeof nt.getSnapshotBeforeUpdate!="function"||at===e.memoizedProps&&ct===e.memoizedState||(o.flags|=1024),o.memoizedProps=a,o.memoizedState=pt),nt.props=a,nt.state=pt,nt.context=lt,a=et):(typeof nt.componentDidUpdate!="function"||at===e.memoizedProps&&ct===e.memoizedState||(o.flags|=4),typeof nt.getSnapshotBeforeUpdate!="function"||at===e.memoizedProps&&ct===e.memoizedState||(o.flags|=1024),a=!1)}return jj(e,o,s,a,c,$)}function jj(e,o,s,a,$,c){gj(e,o);var nt=(o.flags&128)!==0;if(!a&&!nt)return $&&dg(o,s,!1),Zi$1(e,o,c);a=o.stateNode,Wi$1.current=o;var at=nt&&typeof s.getDerivedStateFromError!="function"?null:a.render();return o.flags|=1,e!==null&&nt?(o.child=Ug$1(o,e.child,null,c),o.child=Ug$1(o,null,at,c)):Xi$1(e,o,at,c),o.memoizedState=a.state,$&&dg(o,s,!0),o.child}function kj(e){var o=e.stateNode;o.pendingContext?ag$1(e,o.pendingContext,o.pendingContext!==o.context):o.context&&ag$1(e,o.context,!1),yh$1(e,o.containerInfo)}function lj(e,o,s,a,$){return Ig$1(),Jg($),o.flags|=256,Xi$1(e,o,s,a),o.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(e){return{baseLanes:e,cachePool:null,transitions:null}}function oj(e,o,s){var a=o.pendingProps,$=L$1.current,c=!1,nt=(o.flags&128)!==0,at;if((at=nt)||(at=e!==null&&e.memoizedState===null?!1:($&2)!==0),at?(c=!0,o.flags&=-129):(e===null||e.memoizedState!==null)&&($|=1),G$1(L$1,$&1),e===null)return Eg$1(o),e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(o.mode&1?e.data==="$!"?o.lanes=8:o.lanes=1073741824:o.lanes=1,null):(nt=a.children,e=a.fallback,c?(a=o.mode,c=o.child,nt={mode:"hidden",children:nt},!(a&1)&&c!==null?(c.childLanes=0,c.pendingProps=nt):c=pj(nt,a,0,null),e=Tg$1(e,a,s,null),c.return=o,e.return=o,c.sibling=e,o.child=c,o.child.memoizedState=nj(s),o.memoizedState=mj,e):qj(o,nt));if($=e.memoizedState,$!==null&&(at=$.dehydrated,at!==null))return rj(e,o,nt,a,at,$,s);if(c){c=a.fallback,nt=o.mode,$=e.child,at=$.sibling;var lt={mode:"hidden",children:a.children};return!(nt&1)&&o.child!==$?(a=o.child,a.childLanes=0,a.pendingProps=lt,o.deletions=null):(a=Pg$1($,lt),a.subtreeFlags=$.subtreeFlags&14680064),at!==null?c=Pg$1(at,c):(c=Tg$1(c,nt,s,null),c.flags|=2),c.return=o,a.return=o,a.sibling=c,o.child=a,a=c,c=o.child,nt=e.child.memoizedState,nt=nt===null?nj(s):{baseLanes:nt.baseLanes|s,cachePool:null,transitions:nt.transitions},c.memoizedState=nt,c.childLanes=e.childLanes&~s,o.memoizedState=mj,a}return c=e.child,e=c.sibling,a=Pg$1(c,{mode:"visible",children:a.children}),!(o.mode&1)&&(a.lanes=s),a.return=o,a.sibling=null,e!==null&&(s=o.deletions,s===null?(o.deletions=[e],o.flags|=16):s.push(e)),o.child=a,o.memoizedState=null,a}function qj(e,o){return o=pj({mode:"visible",children:o},e.mode,0,null),o.return=e,e.child=o}function sj(e,o,s,a){return a!==null&&Jg(a),Ug$1(o,e.child,null,s),e=qj(o,o.pendingProps.children),e.flags|=2,o.memoizedState=null,e}function rj(e,o,s,a,$,c,nt){if(s)return o.flags&256?(o.flags&=-257,a=Ki$1(Error(p$1(422))),sj(e,o,nt,a)):o.memoizedState!==null?(o.child=e.child,o.flags|=128,null):(c=a.fallback,$=o.mode,a=pj({mode:"visible",children:a.children},$,0,null),c=Tg$1(c,$,nt,null),c.flags|=2,a.return=o,c.return=o,a.sibling=c,o.child=a,o.mode&1&&Ug$1(o,e.child,null,nt),o.child.memoizedState=nj(nt),o.memoizedState=mj,c);if(!(o.mode&1))return sj(e,o,nt,null);if($.data==="$!"){if(a=$.nextSibling&&$.nextSibling.dataset,a)var at=a.dgst;return a=at,c=Error(p$1(419)),a=Ki$1(c,a,void 0),sj(e,o,nt,a)}if(at=(nt&e.childLanes)!==0,dh||at){if(a=Q$1,a!==null){switch(nt&-nt){case 4:$=2;break;case 16:$=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:$=32;break;case 536870912:$=268435456;break;default:$=0}$=$&(a.suspendedLanes|nt)?0:$,$!==0&&$!==c.retryLane&&(c.retryLane=$,ih(e,$),gi$1(a,e,$,-1))}return tj(),a=Ki$1(Error(p$1(421))),sj(e,o,nt,a)}return $.data==="$?"?(o.flags|=128,o.child=e.child,o=uj.bind(null,e),$._reactRetry=o,null):(e=c.treeContext,yg$1=Lf$1($.nextSibling),xg$1=o,I$1=!0,zg=null,e!==null&&(og$1[pg$1++]=rg$1,og$1[pg$1++]=sg$1,og$1[pg$1++]=qg,rg$1=e.id,sg$1=e.overflow,qg=o),o=qj(o,a.children),o.flags|=4096,o)}function vj(e,o,s){e.lanes|=o;var a=e.alternate;a!==null&&(a.lanes|=o),bh$1(e.return,o,s)}function wj(e,o,s,a,$){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:a,tail:s,tailMode:$}:(c.isBackwards=o,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=s,c.tailMode=$)}function xj(e,o,s){var a=o.pendingProps,$=a.revealOrder,c=a.tail;if(Xi$1(e,o,a.children,s),a=L$1.current,a&2)a=a&1|2,o.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=o.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vj(e,s,o);else if(e.tag===19)vj(e,s,o);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===o)break e;for(;e.sibling===null;){if(e.return===null||e.return===o)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(G$1(L$1,a),!(o.mode&1))o.memoizedState=null;else switch($){case"forwards":for(s=o.child,$=null;s!==null;)e=s.alternate,e!==null&&Ch$1(e)===null&&($=s),s=s.sibling;s=$,s===null?($=o.child,o.child=null):($=s.sibling,s.sibling=null),wj(o,!1,$,s,c);break;case"backwards":for(s=null,$=o.child,o.child=null;$!==null;){if(e=$.alternate,e!==null&&Ch$1(e)===null){o.child=$;break}e=$.sibling,$.sibling=s,s=$,$=e}wj(o,!0,s,null,c);break;case"together":wj(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function ij(e,o){!(o.mode&1)&&e!==null&&(e.alternate=null,o.alternate=null,o.flags|=2)}function Zi$1(e,o,s){if(e!==null&&(o.dependencies=e.dependencies),rh$1|=o.lanes,!(s&o.childLanes))return null;if(e!==null&&o.child!==e.child)throw Error(p$1(153));if(o.child!==null){for(e=o.child,s=Pg$1(e,e.pendingProps),o.child=s,s.return=o;e.sibling!==null;)e=e.sibling,s=s.sibling=Pg$1(e,e.pendingProps),s.return=o;s.sibling=null}return o.child}function yj(e,o,s){switch(o.tag){case 3:kj(o),Ig$1();break;case 5:Ah$1(o);break;case 1:Zf$1(o.type)&&cg$1(o);break;case 4:yh$1(o,o.stateNode.containerInfo);break;case 10:var a=o.type._context,$=o.memoizedProps.value;G$1(Wg,a._currentValue),a._currentValue=$;break;case 13:if(a=o.memoizedState,a!==null)return a.dehydrated!==null?(G$1(L$1,L$1.current&1),o.flags|=128,null):s&o.child.childLanes?oj(e,o,s):(G$1(L$1,L$1.current&1),e=Zi$1(e,o,s),e!==null?e.sibling:null);G$1(L$1,L$1.current&1);break;case 19:if(a=(s&o.childLanes)!==0,e.flags&128){if(a)return xj(e,o,s);o.flags|=128}if($=o.memoizedState,$!==null&&($.rendering=null,$.tail=null,$.lastEffect=null),G$1(L$1,L$1.current),a)break;return null;case 22:case 23:return o.lanes=0,dj(e,o,s)}return Zi$1(e,o,s)}var zj,Aj,Bj,Cj;zj=function(e,o){for(var s=o.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return;s=s.return}s.sibling.return=s.return,s=s.sibling}};Aj=function(){};Bj=function(e,o,s,a){var $=e.memoizedProps;if($!==a){e=o.stateNode,xh$1(uh.current);var c=null;switch(s){case"input":$=Ya(e,$),a=Ya(e,a),c=[];break;case"select":$=A$1({},$,{value:void 0}),a=A$1({},a,{value:void 0}),c=[];break;case"textarea":$=gb$1(e,$),a=gb$1(e,a),c=[];break;default:typeof $.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=Bf$1)}ub$1(s,a);var nt;s=null;for(et in $)if(!a.hasOwnProperty(et)&&$.hasOwnProperty(et)&&$[et]!=null)if(et==="style"){var at=$[et];for(nt in at)at.hasOwnProperty(nt)&&(s||(s={}),s[nt]="")}else et!=="dangerouslySetInnerHTML"&&et!=="children"&&et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&et!=="autoFocus"&&(ea.hasOwnProperty(et)?c||(c=[]):(c=c||[]).push(et,null));for(et in a){var lt=a[et];if(at=$?.[et],a.hasOwnProperty(et)&&lt!==at&&(lt!=null||at!=null))if(et==="style")if(at){for(nt in at)!at.hasOwnProperty(nt)||lt&&lt.hasOwnProperty(nt)||(s||(s={}),s[nt]="");for(nt in lt)lt.hasOwnProperty(nt)&&at[nt]!==lt[nt]&&(s||(s={}),s[nt]=lt[nt])}else s||(c||(c=[]),c.push(et,s)),s=lt;else et==="dangerouslySetInnerHTML"?(lt=lt?lt.__html:void 0,at=at?at.__html:void 0,lt!=null&&at!==lt&&(c=c||[]).push(et,lt)):et==="children"?typeof lt!="string"&&typeof lt!="number"||(c=c||[]).push(et,""+lt):et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&(ea.hasOwnProperty(et)?(lt!=null&&et==="onScroll"&&D$2("scroll",e),c||at===lt||(c=[])):(c=c||[]).push(et,lt))}s&&(c=c||[]).push("style",s);var et=c;(o.updateQueue=et)&&(o.flags|=4)}};Cj=function(e,o,s,a){s!==a&&(o.flags|=4)};function Dj(e,o){if(!I$1)switch(e.tailMode){case"hidden":o=e.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?o||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function S$1(e){var o=e.alternate!==null&&e.alternate.child===e.child,s=0,a=0;if(o)for(var $=e.child;$!==null;)s|=$.lanes|$.childLanes,a|=$.subtreeFlags&14680064,a|=$.flags&14680064,$.return=e,$=$.sibling;else for($=e.child;$!==null;)s|=$.lanes|$.childLanes,a|=$.subtreeFlags,a|=$.flags,$.return=e,$=$.sibling;return e.subtreeFlags|=a,e.childLanes=s,o}function Ej(e,o,s){var a=o.pendingProps;switch(wg$1(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S$1(o),null;case 1:return Zf$1(o.type)&&$f$1(),S$1(o),null;case 3:return a=o.stateNode,zh$1(),E$1(Wf$1),E$1(H$2),Eh(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Gg$1(o)?o.flags|=4:e===null||e.memoizedState.isDehydrated&&!(o.flags&256)||(o.flags|=1024,zg!==null&&(Fj(zg),zg=null))),Aj(e,o),S$1(o),null;case 5:Bh$1(o);var $=xh$1(wh$1.current);if(s=o.type,e!==null&&o.stateNode!=null)Bj(e,o,s,a,$),e.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!a){if(o.stateNode===null)throw Error(p$1(166));return S$1(o),null}if(e=xh$1(uh.current),Gg$1(o)){a=o.stateNode,s=o.type;var c=o.memoizedProps;switch(a[Of$1]=o,a[Pf$1]=c,e=(o.mode&1)!==0,s){case"dialog":D$2("cancel",a),D$2("close",a);break;case"iframe":case"object":case"embed":D$2("load",a);break;case"video":case"audio":for($=0;$<lf$1.length;$++)D$2(lf$1[$],a);break;case"source":D$2("error",a);break;case"img":case"image":case"link":D$2("error",a),D$2("load",a);break;case"details":D$2("toggle",a);break;case"input":Za(a,c),D$2("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!c.multiple},D$2("invalid",a);break;case"textarea":hb$1(a,c),D$2("invalid",a)}ub$1(s,c),$=null;for(var nt in c)if(c.hasOwnProperty(nt)){var at=c[nt];nt==="children"?typeof at=="string"?a.textContent!==at&&(c.suppressHydrationWarning!==!0&&Af$1(a.textContent,at,e),$=["children",at]):typeof at=="number"&&a.textContent!==""+at&&(c.suppressHydrationWarning!==!0&&Af$1(a.textContent,at,e),$=["children",""+at]):ea.hasOwnProperty(nt)&&at!=null&&nt==="onScroll"&&D$2("scroll",a)}switch(s){case"input":Va(a),db$1(a,c,!0);break;case"textarea":Va(a),jb$1(a);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(a.onclick=Bf$1)}a=$,o.updateQueue=a,a!==null&&(o.flags|=4)}else{nt=$.nodeType===9?$:$.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=kb$1(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=nt.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=nt.createElement(s,{is:a.is}):(e=nt.createElement(s),s==="select"&&(nt=e,a.multiple?nt.multiple=!0:a.size&&(nt.size=a.size))):e=nt.createElementNS(e,s),e[Of$1]=o,e[Pf$1]=a,zj(e,o,!1,!1),o.stateNode=e;e:{switch(nt=vb$1(s,a),s){case"dialog":D$2("cancel",e),D$2("close",e),$=a;break;case"iframe":case"object":case"embed":D$2("load",e),$=a;break;case"video":case"audio":for($=0;$<lf$1.length;$++)D$2(lf$1[$],e);$=a;break;case"source":D$2("error",e),$=a;break;case"img":case"image":case"link":D$2("error",e),D$2("load",e),$=a;break;case"details":D$2("toggle",e),$=a;break;case"input":Za(e,a),$=Ya(e,a),D$2("invalid",e);break;case"option":$=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},$=A$1({},a,{value:void 0}),D$2("invalid",e);break;case"textarea":hb$1(e,a),$=gb$1(e,a),D$2("invalid",e);break;default:$=a}ub$1(s,$),at=$;for(c in at)if(at.hasOwnProperty(c)){var lt=at[c];c==="style"?sb$1(e,lt):c==="dangerouslySetInnerHTML"?(lt=lt?lt.__html:void 0,lt!=null&&nb$1(e,lt)):c==="children"?typeof lt=="string"?(s!=="textarea"||lt!=="")&&ob$1(e,lt):typeof lt=="number"&&ob$1(e,""+lt):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ea.hasOwnProperty(c)?lt!=null&&c==="onScroll"&&D$2("scroll",e):lt!=null&&ta$1(e,c,lt,nt))}switch(s){case"input":Va(e),db$1(e,a,!1);break;case"textarea":Va(e),jb$1(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Sa(a.value));break;case"select":e.multiple=!!a.multiple,c=a.value,c!=null?fb$1(e,!!a.multiple,c,!1):a.defaultValue!=null&&fb$1(e,!!a.multiple,a.defaultValue,!0);break;default:typeof $.onClick=="function"&&(e.onclick=Bf$1)}switch(s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return S$1(o),null;case 6:if(e&&o.stateNode!=null)Cj(e,o,e.memoizedProps,a);else{if(typeof a!="string"&&o.stateNode===null)throw Error(p$1(166));if(s=xh$1(wh$1.current),xh$1(uh.current),Gg$1(o)){if(a=o.stateNode,s=o.memoizedProps,a[Of$1]=o,(c=a.nodeValue!==s)&&(e=xg$1,e!==null))switch(e.tag){case 3:Af$1(a.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Af$1(a.nodeValue,s,(e.mode&1)!==0)}c&&(o.flags|=4)}else a=(s.nodeType===9?s:s.ownerDocument).createTextNode(a),a[Of$1]=o,o.stateNode=a}return S$1(o),null;case 13:if(E$1(L$1),a=o.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(I$1&&yg$1!==null&&o.mode&1&&!(o.flags&128))Hg(),Ig$1(),o.flags|=98560,c=!1;else if(c=Gg$1(o),a!==null&&a.dehydrated!==null){if(e===null){if(!c)throw Error(p$1(318));if(c=o.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(p$1(317));c[Of$1]=o}else Ig$1(),!(o.flags&128)&&(o.memoizedState=null),o.flags|=4;S$1(o),c=!1}else zg!==null&&(Fj(zg),zg=null),c=!0;if(!c)return o.flags&65536?o:null}return o.flags&128?(o.lanes=s,o):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(o.child.flags|=8192,o.mode&1&&(e===null||L$1.current&1?T$1===0&&(T$1=3):tj())),o.updateQueue!==null&&(o.flags|=4),S$1(o),null);case 4:return zh$1(),Aj(e,o),e===null&&sf$1(o.stateNode.containerInfo),S$1(o),null;case 10:return ah(o.type._context),S$1(o),null;case 17:return Zf$1(o.type)&&$f$1(),S$1(o),null;case 19:if(E$1(L$1),c=o.memoizedState,c===null)return S$1(o),null;if(a=(o.flags&128)!==0,nt=c.rendering,nt===null)if(a)Dj(c,!1);else{if(T$1!==0||e!==null&&e.flags&128)for(e=o.child;e!==null;){if(nt=Ch$1(e),nt!==null){for(o.flags|=128,Dj(c,!1),a=nt.updateQueue,a!==null&&(o.updateQueue=a,o.flags|=4),o.subtreeFlags=0,a=s,s=o.child;s!==null;)c=s,e=a,c.flags&=14680066,nt=c.alternate,nt===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=nt.childLanes,c.lanes=nt.lanes,c.child=nt.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=nt.memoizedProps,c.memoizedState=nt.memoizedState,c.updateQueue=nt.updateQueue,c.type=nt.type,e=nt.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return G$1(L$1,L$1.current&1|2),o.child}e=e.sibling}c.tail!==null&&B$2()>Gj&&(o.flags|=128,a=!0,Dj(c,!1),o.lanes=4194304)}else{if(!a)if(e=Ch$1(nt),e!==null){if(o.flags|=128,a=!0,s=e.updateQueue,s!==null&&(o.updateQueue=s,o.flags|=4),Dj(c,!0),c.tail===null&&c.tailMode==="hidden"&&!nt.alternate&&!I$1)return S$1(o),null}else 2*B$2()-c.renderingStartTime>Gj&&s!==1073741824&&(o.flags|=128,a=!0,Dj(c,!1),o.lanes=4194304);c.isBackwards?(nt.sibling=o.child,o.child=nt):(s=c.last,s!==null?s.sibling=nt:o.child=nt,c.last=nt)}return c.tail!==null?(o=c.tail,c.rendering=o,c.tail=o.sibling,c.renderingStartTime=B$2(),o.sibling=null,s=L$1.current,G$1(L$1,a?s&1|2:s&1),o):(S$1(o),null);case 22:case 23:return Hj(),a=o.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(o.flags|=8192),a&&o.mode&1?fj&1073741824&&(S$1(o),o.subtreeFlags&6&&(o.flags|=8192)):S$1(o),null;case 24:return null;case 25:return null}throw Error(p$1(156,o.tag))}function Ij(e,o){switch(wg$1(o),o.tag){case 1:return Zf$1(o.type)&&$f$1(),e=o.flags,e&65536?(o.flags=e&-65537|128,o):null;case 3:return zh$1(),E$1(Wf$1),E$1(H$2),Eh(),e=o.flags,e&65536&&!(e&128)?(o.flags=e&-65537|128,o):null;case 5:return Bh$1(o),null;case 13:if(E$1(L$1),e=o.memoizedState,e!==null&&e.dehydrated!==null){if(o.alternate===null)throw Error(p$1(340));Ig$1()}return e=o.flags,e&65536?(o.flags=e&-65537|128,o):null;case 19:return E$1(L$1),null;case 4:return zh$1(),null;case 10:return ah(o.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V$1=null;function Lj(e,o){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(a){W$1(e,o,a)}else s.current=null}function Mj(e,o,s){try{s()}catch(a){W$1(e,o,a)}}var Nj=!1;function Oj(e,o){if(Cf$1=dd$1,e=Me$1(),Ne$1(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var a=s.getSelection&&s.getSelection();if(a&&a.rangeCount!==0){s=a.anchorNode;var $=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{s.nodeType,c.nodeType}catch{s=null;break e}var nt=0,at=-1,lt=-1,et=0,it=0,st=e,ct=null;t:for(;;){for(var ft;st!==s||$!==0&&st.nodeType!==3||(at=nt+$),st!==c||a!==0&&st.nodeType!==3||(lt=nt+a),st.nodeType===3&&(nt+=st.nodeValue.length),(ft=st.firstChild)!==null;)ct=st,st=ft;for(;;){if(st===e)break t;if(ct===s&&++et===$&&(at=nt),ct===c&&++it===a&&(lt=nt),(ft=st.nextSibling)!==null)break;st=ct,ct=st.parentNode}st=ft}s=at===-1||lt===-1?null:{start:at,end:lt}}else s=null}s=s||{start:0,end:0}}else s=null;for(Df$1={focusedElem:e,selectionRange:s},dd$1=!1,V$1=o;V$1!==null;)if(o=V$1,e=o.child,(o.subtreeFlags&1028)!==0&&e!==null)e.return=o,V$1=e;else for(;V$1!==null;){o=V$1;try{var pt=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(pt!==null){var gt=pt.memoizedProps,wt=pt.memoizedState,vt=o.stateNode,_t=vt.getSnapshotBeforeUpdate(o.elementType===o.type?gt:Ci$1(o.type,gt),wt);vt.__reactInternalSnapshotBeforeUpdate=_t}break;case 3:var $t=o.stateNode.containerInfo;$t.nodeType===1?$t.textContent="":$t.nodeType===9&&$t.documentElement&&$t.removeChild($t.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$1(163))}}catch(Pt){W$1(o,o.return,Pt)}if(e=o.sibling,e!==null){e.return=o.return,V$1=e;break}V$1=o.return}return pt=Nj,Nj=!1,pt}function Pj(e,o,s){var a=o.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var $=a=a.next;do{if(($.tag&e)===e){var c=$.destroy;$.destroy=void 0,c!==void 0&&Mj(o,s,c)}$=$.next}while($!==a)}}function Qj(e,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var s=o=o.next;do{if((s.tag&e)===e){var a=s.create;s.destroy=a()}s=s.next}while(s!==o)}}function Rj(e){var o=e.ref;if(o!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof o=="function"?o(e):o.current=e}}function Sj(e){var o=e.alternate;o!==null&&(e.alternate=null,Sj(o)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(o=e.stateNode,o!==null&&(delete o[Of$1],delete o[Pf$1],delete o[of$1],delete o[Qf$1],delete o[Rf$1])),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 Tj(e){return e.tag===5||e.tag===3||e.tag===4}function Uj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vj(e,o,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,o?s.nodeType===8?s.parentNode.insertBefore(e,o):s.insertBefore(e,o):(s.nodeType===8?(o=s.parentNode,o.insertBefore(e,s)):(o=s,o.appendChild(e)),s=s._reactRootContainer,s!=null||o.onclick!==null||(o.onclick=Bf$1));else if(a!==4&&(e=e.child,e!==null))for(Vj(e,o,s),e=e.sibling;e!==null;)Vj(e,o,s),e=e.sibling}function Wj(e,o,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,o?s.insertBefore(e,o):s.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Wj(e,o,s),e=e.sibling;e!==null;)Wj(e,o,s),e=e.sibling}var X=null,Xj=!1;function Yj(e,o,s){for(s=s.child;s!==null;)Zj(e,o,s),s=s.sibling}function Zj(e,o,s){if(lc$1&&typeof lc$1.onCommitFiberUnmount=="function")try{lc$1.onCommitFiberUnmount(kc$1,s)}catch{}switch(s.tag){case 5:U||Lj(s,o);case 6:var a=X,$=Xj;X=null,Yj(e,o,s),X=a,Xj=$,X!==null&&(Xj?(e=X,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):X.removeChild(s.stateNode));break;case 18:X!==null&&(Xj?(e=X,s=s.stateNode,e.nodeType===8?Kf$1(e.parentNode,s):e.nodeType===1&&Kf$1(e,s),bd(e)):Kf$1(X,s.stateNode));break;case 4:a=X,$=Xj,X=s.stateNode.containerInfo,Xj=!0,Yj(e,o,s),X=a,Xj=$;break;case 0:case 11:case 14:case 15:if(!U&&(a=s.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){$=a=a.next;do{var c=$,nt=c.destroy;c=c.tag,nt!==void 0&&(c&2||c&4)&&Mj(s,o,nt),$=$.next}while($!==a)}Yj(e,o,s);break;case 1:if(!U&&(Lj(s,o),a=s.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=s.memoizedProps,a.state=s.memoizedState,a.componentWillUnmount()}catch(at){W$1(s,o,at)}Yj(e,o,s);break;case 21:Yj(e,o,s);break;case 22:s.mode&1?(U=(a=U)||s.memoizedState!==null,Yj(e,o,s),U=a):Yj(e,o,s);break;default:Yj(e,o,s)}}function ak(e){var o=e.updateQueue;if(o!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Kj),o.forEach(function(a){var $=bk.bind(null,e,a);s.has(a)||(s.add(a),a.then($,$))})}}function ck(e,o){var s=o.deletions;if(s!==null)for(var a=0;a<s.length;a++){var $=s[a];try{var c=e,nt=o,at=nt;e:for(;at!==null;){switch(at.tag){case 5:X=at.stateNode,Xj=!1;break e;case 3:X=at.stateNode.containerInfo,Xj=!0;break e;case 4:X=at.stateNode.containerInfo,Xj=!0;break e}at=at.return}if(X===null)throw Error(p$1(160));Zj(c,nt,$),X=null,Xj=!1;var lt=$.alternate;lt!==null&&(lt.return=null),$.return=null}catch(et){W$1($,o,et)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)dk(o,e),o=o.sibling}function dk(e,o){var s=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ck(o,e),ek(e),a&4){try{Pj(3,e,e.return),Qj(3,e)}catch(gt){W$1(e,e.return,gt)}try{Pj(5,e,e.return)}catch(gt){W$1(e,e.return,gt)}}break;case 1:ck(o,e),ek(e),a&512&&s!==null&&Lj(s,s.return);break;case 5:if(ck(o,e),ek(e),a&512&&s!==null&&Lj(s,s.return),e.flags&32){var $=e.stateNode;try{ob$1($,"")}catch(gt){W$1(e,e.return,gt)}}if(a&4&&($=e.stateNode,$!=null)){var c=e.memoizedProps,nt=s!==null?s.memoizedProps:c,at=e.type,lt=e.updateQueue;if(e.updateQueue=null,lt!==null)try{at==="input"&&c.type==="radio"&&c.name!=null&&ab$1($,c),vb$1(at,nt);var et=vb$1(at,c);for(nt=0;nt<lt.length;nt+=2){var it=lt[nt],st=lt[nt+1];it==="style"?sb$1($,st):it==="dangerouslySetInnerHTML"?nb$1($,st):it==="children"?ob$1($,st):ta$1($,it,st,et)}switch(at){case"input":bb$1($,c);break;case"textarea":ib$1($,c);break;case"select":var ct=$._wrapperState.wasMultiple;$._wrapperState.wasMultiple=!!c.multiple;var ft=c.value;ft!=null?fb$1($,!!c.multiple,ft,!1):ct!==!!c.multiple&&(c.defaultValue!=null?fb$1($,!!c.multiple,c.defaultValue,!0):fb$1($,!!c.multiple,c.multiple?[]:"",!1))}$[Pf$1]=c}catch(gt){W$1(e,e.return,gt)}}break;case 6:if(ck(o,e),ek(e),a&4){if(e.stateNode===null)throw Error(p$1(162));$=e.stateNode,c=e.memoizedProps;try{$.nodeValue=c}catch(gt){W$1(e,e.return,gt)}}break;case 3:if(ck(o,e),ek(e),a&4&&s!==null&&s.memoizedState.isDehydrated)try{bd(o.containerInfo)}catch(gt){W$1(e,e.return,gt)}break;case 4:ck(o,e),ek(e);break;case 13:ck(o,e),ek(e),$=e.child,$.flags&8192&&(c=$.memoizedState!==null,$.stateNode.isHidden=c,!c||$.alternate!==null&&$.alternate.memoizedState!==null||(fk=B$2())),a&4&&ak(e);break;case 22:if(it=s!==null&&s.memoizedState!==null,e.mode&1?(U=(et=U)||it,ck(o,e),U=et):ck(o,e),ek(e),a&8192){if(et=e.memoizedState!==null,(e.stateNode.isHidden=et)&&!it&&e.mode&1)for(V$1=e,it=e.child;it!==null;){for(st=V$1=it;V$1!==null;){switch(ct=V$1,ft=ct.child,ct.tag){case 0:case 11:case 14:case 15:Pj(4,ct,ct.return);break;case 1:Lj(ct,ct.return);var pt=ct.stateNode;if(typeof pt.componentWillUnmount=="function"){a=ct,s=ct.return;try{o=a,pt.props=o.memoizedProps,pt.state=o.memoizedState,pt.componentWillUnmount()}catch(gt){W$1(a,s,gt)}}break;case 5:Lj(ct,ct.return);break;case 22:if(ct.memoizedState!==null){gk(st);continue}}ft!==null?(ft.return=ct,V$1=ft):gk(st)}it=it.sibling}e:for(it=null,st=e;;){if(st.tag===5){if(it===null){it=st;try{$=st.stateNode,et?(c=$.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(at=st.stateNode,lt=st.memoizedProps.style,nt=lt!=null&&lt.hasOwnProperty("display")?lt.display:null,at.style.display=rb$1("display",nt))}catch(gt){W$1(e,e.return,gt)}}}else if(st.tag===6){if(it===null)try{st.stateNode.nodeValue=et?"":st.memoizedProps}catch(gt){W$1(e,e.return,gt)}}else if((st.tag!==22&&st.tag!==23||st.memoizedState===null||st===e)&&st.child!==null){st.child.return=st,st=st.child;continue}if(st===e)break e;for(;st.sibling===null;){if(st.return===null||st.return===e)break e;it===st&&(it=null),st=st.return}it===st&&(it=null),st.sibling.return=st.return,st=st.sibling}}break;case 19:ck(o,e),ek(e),a&4&&ak(e);break;case 21:break;default:ck(o,e),ek(e)}}function ek(e){var o=e.flags;if(o&2){try{e:{for(var s=e.return;s!==null;){if(Tj(s)){var a=s;break e}s=s.return}throw Error(p$1(160))}switch(a.tag){case 5:var $=a.stateNode;a.flags&32&&(ob$1($,""),a.flags&=-33);var c=Uj(e);Wj(e,c,$);break;case 3:case 4:var nt=a.stateNode.containerInfo,at=Uj(e);Vj(e,at,nt);break;default:throw Error(p$1(161))}}catch(lt){W$1(e,e.return,lt)}e.flags&=-3}o&4096&&(e.flags&=-4097)}function hk(e,o,s){V$1=e,ik(e)}function ik(e,o,s){for(var a=(e.mode&1)!==0;V$1!==null;){var $=V$1,c=$.child;if($.tag===22&&a){var nt=$.memoizedState!==null||Jj;if(!nt){var at=$.alternate,lt=at!==null&&at.memoizedState!==null||U;at=Jj;var et=U;if(Jj=nt,(U=lt)&&!et)for(V$1=$;V$1!==null;)nt=V$1,lt=nt.child,nt.tag===22&&nt.memoizedState!==null?jk($):lt!==null?(lt.return=nt,V$1=lt):jk($);for(;c!==null;)V$1=c,ik(c),c=c.sibling;V$1=$,Jj=at,U=et}kk(e)}else $.subtreeFlags&8772&&c!==null?(c.return=$,V$1=c):kk(e)}}function kk(e){for(;V$1!==null;){var o=V$1;if(o.flags&8772){var s=o.alternate;try{if(o.flags&8772)switch(o.tag){case 0:case 11:case 15:U||Qj(5,o);break;case 1:var a=o.stateNode;if(o.flags&4&&!U)if(s===null)a.componentDidMount();else{var $=o.elementType===o.type?s.memoizedProps:Ci$1(o.type,s.memoizedProps);a.componentDidUpdate($,s.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var c=o.updateQueue;c!==null&&sh(o,c,a);break;case 3:var nt=o.updateQueue;if(nt!==null){if(s=null,o.child!==null)switch(o.child.tag){case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}sh(o,nt,s)}break;case 5:var at=o.stateNode;if(s===null&&o.flags&4){s=at;var lt=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":lt.autoFocus&&s.focus();break;case"img":lt.src&&(s.src=lt.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var et=o.alternate;if(et!==null){var it=et.memoizedState;if(it!==null){var st=it.dehydrated;st!==null&&bd(st)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p$1(163))}U||o.flags&512&&Rj(o)}catch(ct){W$1(o,o.return,ct)}}if(o===e){V$1=null;break}if(s=o.sibling,s!==null){s.return=o.return,V$1=s;break}V$1=o.return}}function gk(e){for(;V$1!==null;){var o=V$1;if(o===e){V$1=null;break}var s=o.sibling;if(s!==null){s.return=o.return,V$1=s;break}V$1=o.return}}function jk(e){for(;V$1!==null;){var o=V$1;try{switch(o.tag){case 0:case 11:case 15:var s=o.return;try{Qj(4,o)}catch(lt){W$1(o,s,lt)}break;case 1:var a=o.stateNode;if(typeof a.componentDidMount=="function"){var $=o.return;try{a.componentDidMount()}catch(lt){W$1(o,$,lt)}}var c=o.return;try{Rj(o)}catch(lt){W$1(o,c,lt)}break;case 5:var nt=o.return;try{Rj(o)}catch(lt){W$1(o,nt,lt)}}}catch(lt){W$1(o,o.return,lt)}if(o===e){V$1=null;break}var at=o.sibling;if(at!==null){at.return=o.return,V$1=at;break}V$1=o.return}}var lk=Math.ceil,mk=ua.ReactCurrentDispatcher,nk=ua.ReactCurrentOwner,ok=ua.ReactCurrentBatchConfig,K=0,Q$1=null,Y$1=null,Z=0,fj=0,ej=Uf$1(0),T$1=0,pk=null,rh$1=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=1/0,uk=null,Oi$1=!1,Pi$1=null,Ri$1=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R$1(){return K&6?B$2():Ak!==-1?Ak:Ak=B$2()}function yi$1(e){return e.mode&1?K&2&&Z!==0?Z&-Z:Kg.transition!==null?(Bk===0&&(Bk=yc$1()),Bk):(e=C$1,e!==0||(e=window.event,e=e===void 0?16:jd$1(e.type)),e):1}function gi$1(e,o,s,a){if(50<yk)throw yk=0,zk=null,Error(p$1(185));Ac$1(e,s,a),(!(K&2)||e!==Q$1)&&(e===Q$1&&(!(K&2)&&(qk|=s),T$1===4&&Ck(e,Z)),Dk(e,a),s===1&&K===0&&!(o.mode&1)&&(Gj=B$2()+500,fg$1&&jg()))}function Dk(e,o){var s=e.callbackNode;wc$1(e,o);var a=uc$1(e,e===Q$1?Z:0);if(a===0)s!==null&&bc$1(s),e.callbackNode=null,e.callbackPriority=0;else if(o=a&-a,e.callbackPriority!==o){if(s!=null&&bc$1(s),o===1)e.tag===0?ig$1(Ek.bind(null,e)):hg(Ek.bind(null,e)),Jf$1(function(){!(K&6)&&jg()}),s=null;else{switch(Dc$1(a)){case 1:s=fc$1;break;case 4:s=gc$1;break;case 16:s=hc$1;break;case 536870912:s=jc$1;break;default:s=hc$1}s=Fk(s,Gk.bind(null,e))}e.callbackPriority=o,e.callbackNode=s}}function Gk(e,o){if(Ak=-1,Bk=0,K&6)throw Error(p$1(327));var s=e.callbackNode;if(Hk()&&e.callbackNode!==s)return null;var a=uc$1(e,e===Q$1?Z:0);if(a===0)return null;if(a&30||a&e.expiredLanes||o)o=Ik(e,a);else{o=a;var $=K;K|=2;var c=Jk();(Q$1!==e||Z!==o)&&(uk=null,Gj=B$2()+500,Kk(e,o));do try{Lk();break}catch(at){Mk(e,at)}while(!0);$g$1(),mk.current=c,K=$,Y$1!==null?o=0:(Q$1=null,Z=0,o=T$1)}if(o!==0){if(o===2&&($=xc$1(e),$!==0&&(a=$,o=Nk(e,$))),o===1)throw s=pk,Kk(e,0),Ck(e,a),Dk(e,B$2()),s;if(o===6)Ck(e,a);else{if($=e.current.alternate,!(a&30)&&!Ok($)&&(o=Ik(e,a),o===2&&(c=xc$1(e),c!==0&&(a=c,o=Nk(e,c))),o===1))throw s=pk,Kk(e,0),Ck(e,a),Dk(e,B$2()),s;switch(e.finishedWork=$,e.finishedLanes=a,o){case 0:case 1:throw Error(p$1(345));case 2:Pk(e,tk,uk);break;case 3:if(Ck(e,a),(a&130023424)===a&&(o=fk+500-B$2(),10<o)){if(uc$1(e,0)!==0)break;if($=e.suspendedLanes,($&a)!==a){R$1(),e.pingedLanes|=e.suspendedLanes&$;break}e.timeoutHandle=Ff$1(Pk.bind(null,e,tk,uk),o);break}Pk(e,tk,uk);break;case 4:if(Ck(e,a),(a&4194240)===a)break;for(o=e.eventTimes,$=-1;0<a;){var nt=31-oc$1(a);c=1<<nt,nt=o[nt],nt>$&&($=nt),a&=~c}if(a=$,a=B$2()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*lk(a/1960))-a,10<a){e.timeoutHandle=Ff$1(Pk.bind(null,e,tk,uk),a);break}Pk(e,tk,uk);break;case 5:Pk(e,tk,uk);break;default:throw Error(p$1(329))}}}return Dk(e,B$2()),e.callbackNode===s?Gk.bind(null,e):null}function Nk(e,o){var s=sk;return e.current.memoizedState.isDehydrated&&(Kk(e,o).flags|=256),e=Ik(e,o),e!==2&&(o=tk,tk=s,o!==null&&Fj(o)),e}function Fj(e){tk===null?tk=e:tk.push.apply(tk,e)}function Ok(e){for(var o=e;;){if(o.flags&16384){var s=o.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var a=0;a<s.length;a++){var $=s[a],c=$.getSnapshot;$=$.value;try{if(!He$1(c(),$))return!1}catch{return!1}}}if(s=o.child,o.subtreeFlags&16384&&s!==null)s.return=o,o=s;else{if(o===e)break;for(;o.sibling===null;){if(o.return===null||o.return===e)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ck(e,o){for(o&=~rk,o&=~qk,e.suspendedLanes|=o,e.pingedLanes&=~o,e=e.expirationTimes;0<o;){var s=31-oc$1(o),a=1<<s;e[s]=-1,o&=~a}}function Ek(e){if(K&6)throw Error(p$1(327));Hk();var o=uc$1(e,0);if(!(o&1))return Dk(e,B$2()),null;var s=Ik(e,o);if(e.tag!==0&&s===2){var a=xc$1(e);a!==0&&(o=a,s=Nk(e,a))}if(s===1)throw s=pk,Kk(e,0),Ck(e,o),Dk(e,B$2()),s;if(s===6)throw Error(p$1(345));return e.finishedWork=e.current.alternate,e.finishedLanes=o,Pk(e,tk,uk),Dk(e,B$2()),null}function Qk(e,o){var s=K;K|=1;try{return e(o)}finally{K=s,K===0&&(Gj=B$2()+500,fg$1&&jg())}}function Rk(e){wk!==null&&wk.tag===0&&!(K&6)&&Hk();var o=K;K|=1;var s=ok.transition,a=C$1;try{if(ok.transition=null,C$1=1,e)return e()}finally{C$1=a,ok.transition=s,K=o,!(K&6)&&jg()}}function Hj(){fj=ej.current,E$1(ej)}function Kk(e,o){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,Gf$1(s)),Y$1!==null)for(s=Y$1.return;s!==null;){var a=s;switch(wg$1(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&$f$1();break;case 3:zh$1(),E$1(Wf$1),E$1(H$2),Eh();break;case 5:Bh$1(a);break;case 4:zh$1();break;case 13:E$1(L$1);break;case 19:E$1(L$1);break;case 10:ah(a.type._context);break;case 22:case 23:Hj()}s=s.return}if(Q$1=e,Y$1=e=Pg$1(e.current,null),Z=fj=o,T$1=0,pk=null,rk=qk=rh$1=0,tk=sk=null,fh!==null){for(o=0;o<fh.length;o++)if(s=fh[o],a=s.interleaved,a!==null){s.interleaved=null;var $=a.next,c=s.pending;if(c!==null){var nt=c.next;c.next=$,a.next=nt}s.pending=a}fh=null}return e}function Mk(e,o){do{var s=Y$1;try{if($g$1(),Fh$1.current=Rh$1,Ih$1){for(var a=M$1.memoizedState;a!==null;){var $=a.queue;$!==null&&($.pending=null),a=a.next}Ih$1=!1}if(Hh$1=0,O$2=N$1=M$1=null,Jh$1=!1,Kh$1=0,nk.current=null,s===null||s.return===null){T$1=1,pk=o,Y$1=null;break}e:{var c=e,nt=s.return,at=s,lt=o;if(o=Z,at.flags|=32768,lt!==null&&typeof lt=="object"&&typeof lt.then=="function"){var et=lt,it=at,st=it.tag;if(!(it.mode&1)&&(st===0||st===11||st===15)){var ct=it.alternate;ct?(it.updateQueue=ct.updateQueue,it.memoizedState=ct.memoizedState,it.lanes=ct.lanes):(it.updateQueue=null,it.memoizedState=null)}var ft=Ui$1(nt);if(ft!==null){ft.flags&=-257,Vi$1(ft,nt,at,c,o),ft.mode&1&&Si$1(c,et,o),o=ft,lt=et;var pt=o.updateQueue;if(pt===null){var gt=new Set;gt.add(lt),o.updateQueue=gt}else pt.add(lt);break e}else{if(!(o&1)){Si$1(c,et,o),tj();break e}lt=Error(p$1(426))}}else if(I$1&&at.mode&1){var wt=Ui$1(nt);if(wt!==null){!(wt.flags&65536)&&(wt.flags|=256),Vi$1(wt,nt,at,c,o),Jg(Ji$1(lt,at));break e}}c=lt=Ji$1(lt,at),T$1!==4&&(T$1=2),sk===null?sk=[c]:sk.push(c),c=nt;do{switch(c.tag){case 3:c.flags|=65536,o&=-o,c.lanes|=o;var vt=Ni$1(c,lt,o);ph(c,vt);break e;case 1:at=lt;var _t=c.type,$t=c.stateNode;if(!(c.flags&128)&&(typeof _t.getDerivedStateFromError=="function"||$t!==null&&typeof $t.componentDidCatch=="function"&&(Ri$1===null||!Ri$1.has($t)))){c.flags|=65536,o&=-o,c.lanes|=o;var Pt=Qi$1(c,at,o);ph(c,Pt);break e}}c=c.return}while(c!==null)}Sk(s)}catch(Nt){o=Nt,Y$1===s&&s!==null&&(Y$1=s=s.return);continue}break}while(!0)}function Jk(){var e=mk.current;return mk.current=Rh$1,e===null?Rh$1:e}function tj(){(T$1===0||T$1===3||T$1===2)&&(T$1=4),Q$1===null||!(rh$1&268435455)&&!(qk&268435455)||Ck(Q$1,Z)}function Ik(e,o){var s=K;K|=2;var a=Jk();(Q$1!==e||Z!==o)&&(uk=null,Kk(e,o));do try{Tk();break}catch($){Mk(e,$)}while(!0);if($g$1(),K=s,mk.current=a,Y$1!==null)throw Error(p$1(261));return Q$1=null,Z=0,T$1}function Tk(){for(;Y$1!==null;)Uk(Y$1)}function Lk(){for(;Y$1!==null&&!cc$1();)Uk(Y$1)}function Uk(e){var o=Vk(e.alternate,e,fj);e.memoizedProps=e.pendingProps,o===null?Sk(e):Y$1=o,nk.current=null}function Sk(e){var o=e;do{var s=o.alternate;if(e=o.return,o.flags&32768){if(s=Ij(s,o),s!==null){s.flags&=32767,Y$1=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{T$1=6,Y$1=null;return}}else if(s=Ej(s,o,fj),s!==null){Y$1=s;return}if(o=o.sibling,o!==null){Y$1=o;return}Y$1=o=e}while(o!==null);T$1===0&&(T$1=5)}function Pk(e,o,s){var a=C$1,$=ok.transition;try{ok.transition=null,C$1=1,Wk(e,o,s,a)}finally{ok.transition=$,C$1=a}return null}function Wk(e,o,s,a){do Hk();while(wk!==null);if(K&6)throw Error(p$1(327));s=e.finishedWork;var $=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(p$1(177));e.callbackNode=null,e.callbackPriority=0;var c=s.lanes|s.childLanes;if(Bc$1(e,c),e===Q$1&&(Y$1=Q$1=null,Z=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||vk||(vk=!0,Fk(hc$1,function(){return Hk(),null})),c=(s.flags&15990)!==0,s.subtreeFlags&15990||c){c=ok.transition,ok.transition=null;var nt=C$1;C$1=1;var at=K;K|=4,nk.current=null,Oj(e,s),dk(s,e),Oe(Df$1),dd$1=!!Cf$1,Df$1=Cf$1=null,e.current=s,hk(s),dc$1(),K=at,C$1=nt,ok.transition=c}else e.current=s;if(vk&&(vk=!1,wk=e,xk=$),c=e.pendingLanes,c===0&&(Ri$1=null),mc$1(s.stateNode),Dk(e,B$2()),o!==null)for(a=e.onRecoverableError,s=0;s<o.length;s++)$=o[s],a($.value,{componentStack:$.stack,digest:$.digest});if(Oi$1)throw Oi$1=!1,e=Pi$1,Pi$1=null,e;return xk&1&&e.tag!==0&&Hk(),c=e.pendingLanes,c&1?e===zk?yk++:(yk=0,zk=e):yk=0,jg(),null}function Hk(){if(wk!==null){var e=Dc$1(xk),o=ok.transition,s=C$1;try{if(ok.transition=null,C$1=16>e?16:e,wk===null)var a=!1;else{if(e=wk,wk=null,xk=0,K&6)throw Error(p$1(331));var $=K;for(K|=4,V$1=e.current;V$1!==null;){var c=V$1,nt=c.child;if(V$1.flags&16){var at=c.deletions;if(at!==null){for(var lt=0;lt<at.length;lt++){var et=at[lt];for(V$1=et;V$1!==null;){var it=V$1;switch(it.tag){case 0:case 11:case 15:Pj(8,it,c)}var st=it.child;if(st!==null)st.return=it,V$1=st;else for(;V$1!==null;){it=V$1;var ct=it.sibling,ft=it.return;if(Sj(it),it===et){V$1=null;break}if(ct!==null){ct.return=ft,V$1=ct;break}V$1=ft}}}var pt=c.alternate;if(pt!==null){var gt=pt.child;if(gt!==null){pt.child=null;do{var wt=gt.sibling;gt.sibling=null,gt=wt}while(gt!==null)}}V$1=c}}if(c.subtreeFlags&2064&&nt!==null)nt.return=c,V$1=nt;else e:for(;V$1!==null;){if(c=V$1,c.flags&2048)switch(c.tag){case 0:case 11:case 15:Pj(9,c,c.return)}var vt=c.sibling;if(vt!==null){vt.return=c.return,V$1=vt;break e}V$1=c.return}}var _t=e.current;for(V$1=_t;V$1!==null;){nt=V$1;var $t=nt.child;if(nt.subtreeFlags&2064&&$t!==null)$t.return=nt,V$1=$t;else e:for(nt=_t;V$1!==null;){if(at=V$1,at.flags&2048)try{switch(at.tag){case 0:case 11:case 15:Qj(9,at)}}catch(Nt){W$1(at,at.return,Nt)}if(at===nt){V$1=null;break e}var Pt=at.sibling;if(Pt!==null){Pt.return=at.return,V$1=Pt;break e}V$1=at.return}}if(K=$,jg(),lc$1&&typeof lc$1.onPostCommitFiberRoot=="function")try{lc$1.onPostCommitFiberRoot(kc$1,e)}catch{}a=!0}return a}finally{C$1=s,ok.transition=o}}return!1}function Xk(e,o,s){o=Ji$1(s,o),o=Ni$1(e,o,1),e=nh(e,o,1),o=R$1(),e!==null&&(Ac$1(e,1,o),Dk(e,o))}function W$1(e,o,s){if(e.tag===3)Xk(e,e,s);else for(;o!==null;){if(o.tag===3){Xk(o,e,s);break}else if(o.tag===1){var a=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ri$1===null||!Ri$1.has(a))){e=Ji$1(s,e),e=Qi$1(o,e,1),o=nh(o,e,1),e=R$1(),o!==null&&(Ac$1(o,1,e),Dk(o,e));break}}o=o.return}}function Ti$1(e,o,s){var a=e.pingCache;a!==null&&a.delete(o),o=R$1(),e.pingedLanes|=e.suspendedLanes&s,Q$1===e&&(Z&s)===s&&(T$1===4||T$1===3&&(Z&130023424)===Z&&500>B$2()-fk?Kk(e,0):rk|=s),Dk(e,o)}function Yk(e,o){o===0&&(e.mode&1?(o=sc$1,sc$1<<=1,!(sc$1&130023424)&&(sc$1=4194304)):o=1);var s=R$1();e=ih(e,o),e!==null&&(Ac$1(e,o,s),Dk(e,s))}function uj(e){var o=e.memoizedState,s=0;o!==null&&(s=o.retryLane),Yk(e,s)}function bk(e,o){var s=0;switch(e.tag){case 13:var a=e.stateNode,$=e.memoizedState;$!==null&&(s=$.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(p$1(314))}a!==null&&a.delete(o),Yk(e,s)}var Vk;Vk=function(e,o,s){if(e!==null)if(e.memoizedProps!==o.pendingProps||Wf$1.current)dh=!0;else{if(!(e.lanes&s)&&!(o.flags&128))return dh=!1,yj(e,o,s);dh=!!(e.flags&131072)}else dh=!1,I$1&&o.flags&1048576&&ug$1(o,ng$1,o.index);switch(o.lanes=0,o.tag){case 2:var a=o.type;ij(e,o),e=o.pendingProps;var $=Yf$1(o,H$2.current);ch(o,s),$=Nh$1(null,o,a,e,$,s);var c=Sh$1();return o.flags|=1,typeof $=="object"&&$!==null&&typeof $.render=="function"&&$.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Zf$1(a)?(c=!0,cg$1(o)):c=!1,o.memoizedState=$.state!==null&&$.state!==void 0?$.state:null,kh(o),$.updater=Ei$1,o.stateNode=$,$._reactInternals=o,Ii$1(o,a,e,s),o=jj(null,o,a,!0,c,s)):(o.tag=0,I$1&&c&&vg$1(o),Xi$1(null,o,$,s),o=o.child),o;case 16:a=o.elementType;e:{switch(ij(e,o),e=o.pendingProps,$=a._init,a=$(a._payload),o.type=a,$=o.tag=Zk(a),e=Ci$1(a,e),$){case 0:o=cj(null,o,a,e,s);break e;case 1:o=hj(null,o,a,e,s);break e;case 11:o=Yi$1(null,o,a,e,s);break e;case 14:o=$i$1(null,o,a,Ci$1(a.type,e),s);break e}throw Error(p$1(306,a,""))}return o;case 0:return a=o.type,$=o.pendingProps,$=o.elementType===a?$:Ci$1(a,$),cj(e,o,a,$,s);case 1:return a=o.type,$=o.pendingProps,$=o.elementType===a?$:Ci$1(a,$),hj(e,o,a,$,s);case 3:e:{if(kj(o),e===null)throw Error(p$1(387));a=o.pendingProps,c=o.memoizedState,$=c.element,lh(e,o),qh$1(o,a,null,s);var nt=o.memoizedState;if(a=nt.element,c.isDehydrated)if(c={element:a,isDehydrated:!1,cache:nt.cache,pendingSuspenseBoundaries:nt.pendingSuspenseBoundaries,transitions:nt.transitions},o.updateQueue.baseState=c,o.memoizedState=c,o.flags&256){$=Ji$1(Error(p$1(423)),o),o=lj(e,o,a,s,$);break e}else if(a!==$){$=Ji$1(Error(p$1(424)),o),o=lj(e,o,a,s,$);break e}else for(yg$1=Lf$1(o.stateNode.containerInfo.firstChild),xg$1=o,I$1=!0,zg=null,s=Vg(o,null,a,s),o.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ig$1(),a===$){o=Zi$1(e,o,s);break e}Xi$1(e,o,a,s)}o=o.child}return o;case 5:return Ah$1(o),e===null&&Eg$1(o),a=o.type,$=o.pendingProps,c=e!==null?e.memoizedProps:null,nt=$.children,Ef$1(a,$)?nt=null:c!==null&&Ef$1(a,c)&&(o.flags|=32),gj(e,o),Xi$1(e,o,nt,s),o.child;case 6:return e===null&&Eg$1(o),null;case 13:return oj(e,o,s);case 4:return yh$1(o,o.stateNode.containerInfo),a=o.pendingProps,e===null?o.child=Ug$1(o,null,a,s):Xi$1(e,o,a,s),o.child;case 11:return a=o.type,$=o.pendingProps,$=o.elementType===a?$:Ci$1(a,$),Yi$1(e,o,a,$,s);case 7:return Xi$1(e,o,o.pendingProps,s),o.child;case 8:return Xi$1(e,o,o.pendingProps.children,s),o.child;case 12:return Xi$1(e,o,o.pendingProps.children,s),o.child;case 10:e:{if(a=o.type._context,$=o.pendingProps,c=o.memoizedProps,nt=$.value,G$1(Wg,a._currentValue),a._currentValue=nt,c!==null)if(He$1(c.value,nt)){if(c.children===$.children&&!Wf$1.current){o=Zi$1(e,o,s);break e}}else for(c=o.child,c!==null&&(c.return=o);c!==null;){var at=c.dependencies;if(at!==null){nt=c.child;for(var lt=at.firstContext;lt!==null;){if(lt.context===a){if(c.tag===1){lt=mh$1(-1,s&-s),lt.tag=2;var et=c.updateQueue;if(et!==null){et=et.shared;var it=et.pending;it===null?lt.next=lt:(lt.next=it.next,it.next=lt),et.pending=lt}}c.lanes|=s,lt=c.alternate,lt!==null&&(lt.lanes|=s),bh$1(c.return,s,o),at.lanes|=s;break}lt=lt.next}}else if(c.tag===10)nt=c.type===o.type?null:c.child;else if(c.tag===18){if(nt=c.return,nt===null)throw Error(p$1(341));nt.lanes|=s,at=nt.alternate,at!==null&&(at.lanes|=s),bh$1(nt,s,o),nt=c.sibling}else nt=c.child;if(nt!==null)nt.return=c;else for(nt=c;nt!==null;){if(nt===o){nt=null;break}if(c=nt.sibling,c!==null){c.return=nt.return,nt=c;break}nt=nt.return}c=nt}Xi$1(e,o,$.children,s),o=o.child}return o;case 9:return $=o.type,a=o.pendingProps.children,ch(o,s),$=eh$1($),a=a($),o.flags|=1,Xi$1(e,o,a,s),o.child;case 14:return a=o.type,$=Ci$1(a,o.pendingProps),$=Ci$1(a.type,$),$i$1(e,o,a,$,s);case 15:return bj(e,o,o.type,o.pendingProps,s);case 17:return a=o.type,$=o.pendingProps,$=o.elementType===a?$:Ci$1(a,$),ij(e,o),o.tag=1,Zf$1(a)?(e=!0,cg$1(o)):e=!1,ch(o,s),Gi$1(o,a,$),Ii$1(o,a,$,s),jj(null,o,a,!0,e,s);case 19:return xj(e,o,s);case 22:return dj(e,o,s)}throw Error(p$1(156,o.tag))};function Fk(e,o){return ac$1(e,o)}function $k(e,o,s,a){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg$1(e,o,s,a){return new $k(e,o,s,a)}function aj(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zk(e){if(typeof e=="function")return aj(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Da)return 11;if(e===Ga)return 14}return 2}function Pg$1(e,o){var s=e.alternate;return s===null?(s=Bg$1(e.tag,o,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=o,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,o=e.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Rg(e,o,s,a,$,c){var nt=2;if(a=e,typeof e=="function")aj(e)&&(nt=1);else if(typeof e=="string")nt=5;else e:switch(e){case ya:return Tg$1(s.children,$,c,o);case za:nt=8,$|=8;break;case Aa:return e=Bg$1(12,s,o,$|2),e.elementType=Aa,e.lanes=c,e;case Ea:return e=Bg$1(13,s,o,$),e.elementType=Ea,e.lanes=c,e;case Fa:return e=Bg$1(19,s,o,$),e.elementType=Fa,e.lanes=c,e;case Ia:return pj(s,$,c,o);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ba:nt=10;break e;case Ca:nt=9;break e;case Da:nt=11;break e;case Ga:nt=14;break e;case Ha:nt=16,a=null;break e}throw Error(p$1(130,e==null?e:typeof e,""))}return o=Bg$1(nt,s,o,$),o.elementType=e,o.type=a,o.lanes=c,o}function Tg$1(e,o,s,a){return e=Bg$1(7,e,a,o),e.lanes=s,e}function pj(e,o,s,a){return e=Bg$1(22,e,a,o),e.elementType=Ia,e.lanes=s,e.stateNode={isHidden:!1},e}function Qg(e,o,s){return e=Bg$1(6,e,null,o),e.lanes=s,e}function Sg$1(e,o,s){return o=Bg$1(4,e.children!==null?e.children:[],e.key,o),o.lanes=s,o.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},o}function al$1(e,o,s,a,$){this.tag=o,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=zc$1(0),this.expirationTimes=zc$1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc$1(0),this.identifierPrefix=a,this.onRecoverableError=$,this.mutableSourceEagerHydrationData=null}function bl$1(e,o,s,a,$,c,nt,at,lt){return e=new al$1(e,o,s,at,lt),o===1?(o=1,c===!0&&(o|=8)):o=0,c=Bg$1(3,null,null,o),e.current=c,c.stateNode=e,c.memoizedState={element:a,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(c),e}function cl$1(e,o,s){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wa,key:a==null?null:""+a,children:e,containerInfo:o,implementation:s}}function dl$1(e){if(!e)return Vf$1;e=e._reactInternals;e:{if(Vb$1(e)!==e||e.tag!==1)throw Error(p$1(170));var o=e;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Zf$1(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(p$1(171))}if(e.tag===1){var s=e.type;if(Zf$1(s))return bg$1(e,s,o)}return o}function el$1(e,o,s,a,$,c,nt,at,lt){return e=bl$1(s,a,!0,e,$,c,nt,at,lt),e.context=dl$1(null),s=e.current,a=R$1(),$=yi$1(s),c=mh$1(a,$),c.callback=o??null,nh(s,c,$),e.current.lanes=$,Ac$1(e,$,a),Dk(e,a),e}function fl(e,o,s,a){var $=o.current,c=R$1(),nt=yi$1($);return s=dl$1(s),o.context===null?o.context=s:o.pendingContext=s,o=mh$1(c,nt),o.payload={element:e},a=a===void 0?null:a,a!==null&&(o.callback=a),e=nh($,o,nt),e!==null&&(gi$1(e,$,nt,c),oh$1(e,$,nt)),nt}function gl$1(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function hl$1(e,o){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<o?s:o}}function il$1(e,o){hl$1(e,o),(e=e.alternate)&&hl$1(e,o)}function jl$1(){return null}var kl$1=typeof reportError=="function"?reportError:function(e){console.error(e)};function ll$1(e){this._internalRoot=e}ml$1.prototype.render=ll$1.prototype.render=function(e){var o=this._internalRoot;if(o===null)throw Error(p$1(409));fl(e,o,null,null)};ml$1.prototype.unmount=ll$1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var o=e.containerInfo;Rk(function(){fl(null,e,null,null)}),o[uf$1]=null}};function ml$1(e){this._internalRoot=e}ml$1.prototype.unstable_scheduleHydration=function(e){if(e){var o=Hc$1();e={blockedOn:null,target:e,priority:o};for(var s=0;s<Qc$1.length&&o!==0&&o<Qc$1[s].priority;s++);Qc$1.splice(s,0,e),s===0&&Vc$1(e)}};function nl$1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ol$1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pl$1(){}function ql$1(e,o,s,a,$){if($){if(typeof a=="function"){var c=a;a=function(){var et=gl$1(nt);c.call(et)}}var nt=el$1(o,a,e,0,null,!1,!1,"",pl$1);return e._reactRootContainer=nt,e[uf$1]=nt.current,sf$1(e.nodeType===8?e.parentNode:e),Rk(),nt}for(;$=e.lastChild;)e.removeChild($);if(typeof a=="function"){var at=a;a=function(){var et=gl$1(lt);at.call(et)}}var lt=bl$1(e,0,!1,null,null,!1,!1,"",pl$1);return e._reactRootContainer=lt,e[uf$1]=lt.current,sf$1(e.nodeType===8?e.parentNode:e),Rk(function(){fl(o,lt,s,a)}),lt}function rl$1(e,o,s,a,$){var c=s._reactRootContainer;if(c){var nt=c;if(typeof $=="function"){var at=$;$=function(){var lt=gl$1(nt);at.call(lt)}}fl(o,nt,e,$)}else nt=ql$1(s,o,e,$,a);return gl$1(nt)}Ec$1=function(e){switch(e.tag){case 3:var o=e.stateNode;if(o.current.memoizedState.isDehydrated){var s=tc$1(o.pendingLanes);s!==0&&(Cc$1(o,s|1),Dk(o,B$2()),!(K&6)&&(Gj=B$2()+500,jg()))}break;case 13:Rk(function(){var a=ih(e,1);if(a!==null){var $=R$1();gi$1(a,e,1,$)}}),il$1(e,1)}};Fc$1=function(e){if(e.tag===13){var o=ih(e,134217728);if(o!==null){var s=R$1();gi$1(o,e,134217728,s)}il$1(e,134217728)}};Gc$1=function(e){if(e.tag===13){var o=yi$1(e),s=ih(e,o);if(s!==null){var a=R$1();gi$1(s,e,o,a)}il$1(e,o)}};Hc$1=function(){return C$1};Ic$1=function(e,o){var s=C$1;try{return C$1=e,o()}finally{C$1=s}};yb$1=function(e,o,s){switch(o){case"input":if(bb$1(e,s),o=s.name,s.type==="radio"&&o!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<s.length;o++){var a=s[o];if(a!==e&&a.form===e.form){var $=Db$1(a);if(!$)throw Error(p$1(90));Wa(a),bb$1(a,$)}}}break;case"textarea":ib$1(e,s);break;case"select":o=s.value,o!=null&&fb$1(e,!!s.multiple,o,!1)}};Gb$1=Qk;Hb$1=Rk;var sl$1={usingClientEntryPoint:!1,Events:[Cb$1,ue,Db$1,Eb$1,Fb$1,Qk]},tl$1={findFiberByHostInstance:Wc$1,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ul$1={bundleType:tl$1.bundleType,version:tl$1.version,rendererPackageName:tl$1.rendererPackageName,rendererConfig:tl$1.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Zb$1(e),e===null?null:e.stateNode},findFiberByHostInstance:tl$1.findFiberByHostInstance||jl$1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vl$1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl$1.isDisabled&&vl$1.supportsFiber)try{kc$1=vl$1.inject(ul$1),lc$1=vl$1}catch{}}reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl$1;reactDom_production_min.createPortal=function(e,o){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nl$1(o))throw Error(p$1(200));return cl$1(e,o,null,s)};reactDom_production_min.createRoot=function(e,o){if(!nl$1(e))throw Error(p$1(299));var s=!1,a="",$=kl$1;return o!=null&&(o.unstable_strictMode===!0&&(s=!0),o.identifierPrefix!==void 0&&(a=o.identifierPrefix),o.onRecoverableError!==void 0&&($=o.onRecoverableError)),o=bl$1(e,1,!1,null,null,s,!1,a,$),e[uf$1]=o.current,sf$1(e.nodeType===8?e.parentNode:e),new ll$1(o)};reactDom_production_min.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var o=e._reactInternals;if(o===void 0)throw typeof e.render=="function"?Error(p$1(188)):(e=Object.keys(e).join(","),Error(p$1(268,e)));return e=Zb$1(o),e=e===null?null:e.stateNode,e};reactDom_production_min.flushSync=function(e){return Rk(e)};reactDom_production_min.hydrate=function(e,o,s){if(!ol$1(o))throw Error(p$1(200));return rl$1(null,e,o,!0,s)};reactDom_production_min.hydrateRoot=function(e,o,s){if(!nl$1(e))throw Error(p$1(405));var a=s!=null&&s.hydratedSources||null,$=!1,c="",nt=kl$1;if(s!=null&&(s.unstable_strictMode===!0&&($=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onRecoverableError!==void 0&&(nt=s.onRecoverableError)),o=el$1(o,null,e,1,s??null,$,!1,c,nt),e[uf$1]=o.current,sf$1(e),a)for(e=0;e<a.length;e++)s=a[e],$=s._getVersion,$=$(s._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[s,$]:o.mutableSourceEagerHydrationData.push(s,$);return new ml$1(o)};reactDom_production_min.render=function(e,o,s){if(!ol$1(o))throw Error(p$1(200));return rl$1(null,e,o,!1,s)};reactDom_production_min.unmountComponentAtNode=function(e){if(!ol$1(e))throw Error(p$1(40));return e._reactRootContainer?(Rk(function(){rl$1(null,null,e,!1,function(){e._reactRootContainer=null,e[uf$1]=null})}),!0):!1};reactDom_production_min.unstable_batchedUpdates=Qk;reactDom_production_min.unstable_renderSubtreeIntoContainer=function(e,o,s,a){if(!ol$1(s))throw Error(p$1(200));if(e==null||e._reactInternals===void 0)throw Error(p$1(38));return rl$1(e,o,s,!1,a)};reactDom_production_min.version="18.3.1-next-f1338f8080-20240426";function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports,m$1=reactDomExports;client.createRoot=m$1.createRoot,client.hydrateRoot=m$1.hydrateRoot;const canUseDom=!!(typeof window<"u"&&typeof document<"u"&&window.document&&window.document.createElement);canUseDom&&document.addEventListener("touchstart",()=>{},!0);const typeTemplate="${label}不是一个有效的${type}",zhCN={locale:"zh-CH",common:{confirm:"确定",cancel:"取消",loading:"加载中",close:"关闭"},Calendar:{title:"日期选择",confirm:"确认",start:"开始",end:"结束",today:"今日",markItems:["一","二","三","四","五","六","日"],yearAndMonth:"${year}年${month}月"},Cascader:{placeholder:"请选择"},Dialog:{ok:"我知道了"},DatePicker:{tillNow:"至今"},ErrorBlock:{default:{title:"页面遇到一些小问题",description:"待会来试试"},busy:{title:"前方拥堵",description:"刷新试试"},disconnected:{title:"网络有点忙",description:"动动手指帮忙修复"},empty:{title:"没有找到你需要的东西",description:"找找其他的吧"}},Form:{required:"必填",optional:"选填",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:typeTemplate,method:typeTemplate,array:typeTemplate,object:typeTemplate,number:typeTemplate,date:typeTemplate,boolean:typeTemplate,integer:typeTemplate,float:typeTemplate,regexp:typeTemplate,email:typeTemplate,url:typeTemplate,hex:typeTemplate},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},ImageUploader:{uploading:"上传中...",upload:"上传"},InfiniteScroll:{noMore:"没有更多了",failedToLoad:"加载失败",retry:"重新加载"},Input:{clear:"清除"},Mask:{name:"背景蒙层"},Modal:{ok:"我知道了"},PasscodeInput:{name:"密码输入框"},PullToRefresh:{pulling:"下拉刷新",canRelease:"释放立即刷新",complete:"刷新成功"},SearchBar:{name:"搜索框"},Slider:{name:"滑动输入条"},Stepper:{decrease:"减少",increase:"增加"},Switch:{name:"开关"},Selector:{name:"选择组"}},defaultConfigRef={current:{locale:zhCN}};function getDefaultConfig(){return defaultConfigRef.current}const ConfigContext=t.createContext(null);function useConfig(){var e;return(e=reactExports.useContext(ConfigContext))!==null&&e!==void 0?e:getDefaultConfig()}var classnames={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(e){(function(){var o={}.hasOwnProperty;function s(){for(var c="",nt=0;nt<arguments.length;nt++){var at=arguments[nt];at&&(c=$(c,a(at)))}return c}function a(c){if(typeof c=="string"||typeof c=="number")return c;if(typeof c!="object")return"";if(Array.isArray(c))return s.apply(null,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var nt="";for(var at in c)o.call(c,at)&&c[at]&&(nt=$(nt,at));return nt}function $(c,nt){return nt?c?c+" "+nt:c+nt:c}e.exports?(s.default=s,e.exports=s):window.classNames=s})()})(classnames);var classnamesExports=classnames.exports;const classNames=getDefaultExportFromCjs(classnamesExports);function withNativeProps(e,o){const s=Object.assign({},o.props);e.className&&(s.className=classNames(o.props.className,e.className)),e.style&&(s.style=Object.assign(Object.assign({},s.style),e.style)),e.tabIndex!==void 0&&(s.tabIndex=e.tabIndex);for(const a in e)e.hasOwnProperty(a)&&(a.startsWith("data-")||a.startsWith("aria-"))&&(s[a]=e[a]);return t.cloneElement(o,s)}function mergeProps(...e){const o={};return e.forEach(s=>{s&&Object.keys(s).forEach(a=>{s[a]!==void 0&&(o[a]=s[a])})}),o}var isBrowser$1=!!(typeof window<"u"&&window.document&&window.document.createElement);/*! js-cookie v3.0.5 | MIT */function assign$1(e){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var a in s)e[a]=s[a]}return e}var defaultConverter={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function init(e,o){function s($,c,nt){if(!(typeof document>"u")){nt=assign$1({},o,nt),typeof nt.expires=="number"&&(nt.expires=new Date(Date.now()+nt.expires*864e5)),nt.expires&&(nt.expires=nt.expires.toUTCString()),$=encodeURIComponent($).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var at="";for(var lt in nt)nt[lt]&&(at+="; "+lt,nt[lt]!==!0&&(at+="="+nt[lt].split(";")[0]));return document.cookie=$+"="+e.write(c,$)+at}}function a($){if(!(typeof document>"u"||arguments.length&&!$)){for(var c=document.cookie?document.cookie.split("; "):[],nt={},at=0;at<c.length;at++){var lt=c[at].split("="),et=lt.slice(1).join("=");try{var it=decodeURIComponent(lt[0]);if(nt[it]=e.read(et,it),$===it)break}catch{}}return $?nt[$]:nt}}return Object.create({set:s,get:a,remove:function($,c){s($,"",assign$1({},c,{expires:-1}))},withAttributes:function($){return init(this.converter,assign$1({},this.attributes,$))},withConverter:function($){return init(assign$1({},this.converter,$),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(e)}})}var api$1=init(defaultConverter,{path:"/"}),useIsomorphicLayoutEffect$1=isBrowser$1?reactExports.useLayoutEffect:reactExports.useEffect,useUnmountedRef=function(){var e=reactExports.useRef(!1);return reactExports.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e};const MIN_DISTANCE=10;function getDirection(e,o){return e>o&&e>MIN_DISTANCE?"horizontal":o>e&&o>MIN_DISTANCE?"vertical":""}function useTouch(){const e=reactExports.useRef(0),o=reactExports.useRef(0),s=reactExports.useRef(0),a=reactExports.useRef(0),$=reactExports.useRef(0),c=reactExports.useRef(0),nt=reactExports.useRef(""),at=()=>nt.current==="vertical",lt=()=>nt.current==="horizontal",et=()=>{s.current=0,a.current=0,$.current=0,c.current=0,nt.current=""};return{move:ct=>{const ft=ct.touches[0];s.current=ft.clientX<0?0:ft.clientX-e.current,a.current=ft.clientY-o.current,$.current=Math.abs(s.current),c.current=Math.abs(a.current),nt.current||(nt.current=getDirection($.current,c.current))},start:ct=>{et(),e.current=ct.touches[0].clientX,o.current=ct.touches[0].clientY},reset:et,startX:e,startY:o,deltaX:s,deltaY:a,offsetX:$,offsetY:c,direction:nt,isVertical:at,isHorizontal:lt}}const defaultRoot=canUseDom?window:void 0,overflowStylePatterns=["scroll","auto","overlay"];function isElement$2(e){return e.nodeType===1}function getScrollParent(e,o=defaultRoot){let s=e;for(;s&&s!==o&&isElement$2(s);){if(s===document.body)return o;const{overflowY:a}=window.getComputedStyle(s);if(overflowStylePatterns.includes(a)&&s.scrollHeight>s.clientHeight)return s;s=s.parentNode}return o}let supportsPassive=!1;if(canUseDom)try{const e={};Object.defineProperty(e,"passive",{get(){supportsPassive=!0}}),window.addEventListener("test-passive",null,e)}catch{}let totalLockCount=0;const BODY_LOCK_CLASS="adm-overflow-hidden";function getScrollableElement(e){let o=e?.parentElement;for(;o;){if(o.clientHeight<o.scrollHeight)return o;o=o.parentElement}return null}function useLockScroll(e,o){const s=useTouch(),a=nt=>{s.move(nt);const at=s.deltaY.current>0?"10":"01",lt=getScrollParent(nt.target,e.current);if(!lt)return;if(o==="strict"){const pt=getScrollableElement(nt.target);if(pt===document.body||pt===document.documentElement){nt.preventDefault();return}}const{scrollHeight:et,offsetHeight:it,scrollTop:st}=lt,{height:ct}=lt.getBoundingClientRect();let ft="11";st===0?ft=it>=et?"00":"01":et<=Math.round(ct+st)&&(ft="10"),ft!=="11"&&s.isVertical()&&!(parseInt(ft,2)&parseInt(at,2))&&nt.cancelable&&supportsPassive&&nt.preventDefault()},$=()=>{document.addEventListener("touchstart",s.start),document.addEventListener("touchmove",a,supportsPassive?{passive:!1}:!1),totalLockCount||document.body.classList.add(BODY_LOCK_CLASS),totalLockCount++},c=()=>{totalLockCount&&(document.removeEventListener("touchstart",s.start),document.removeEventListener("touchmove",a),totalLockCount--,totalLockCount||document.body.classList.remove(BODY_LOCK_CLASS))};reactExports.useEffect(()=>{if(o)return $(),()=>{c()}},[o])}let updateQueue=makeQueue();const raf=e=>schedule(e,updateQueue);let writeQueue=makeQueue();raf.write=e=>schedule(e,writeQueue);let onStartQueue=makeQueue();raf.onStart=e=>schedule(e,onStartQueue);let onFrameQueue=makeQueue();raf.onFrame=e=>schedule(e,onFrameQueue);let onFinishQueue=makeQueue();raf.onFinish=e=>schedule(e,onFinishQueue);let timeouts=[];raf.setTimeout=(e,o)=>{let s=raf.now()+o,a=()=>{let c=timeouts.findIndex(nt=>nt.cancel==a);~c&&timeouts.splice(c,1),pendingCount-=~c?1:0},$={time:s,handler:e,cancel:a};return timeouts.splice(findTimeout(s),0,$),pendingCount+=1,start(),$};let findTimeout=e=>~(~timeouts.findIndex(o=>o.time>e)||~timeouts.length);raf.cancel=e=>{onStartQueue.delete(e),onFrameQueue.delete(e),onFinishQueue.delete(e),updateQueue.delete(e),writeQueue.delete(e)};raf.sync=e=>{sync=!0,raf.batchedUpdates(e),sync=!1};raf.throttle=e=>{let o;function s(){try{e(...o)}finally{o=null}}function a(...$){o=$,raf.onStart(s)}return a.handler=e,a.cancel=()=>{onStartQueue.delete(s),o=null},a};let nativeRaf=typeof window<"u"?window.requestAnimationFrame:()=>{};raf.use=e=>nativeRaf=e;raf.now=typeof performance<"u"?()=>performance.now():Date.now;raf.batchedUpdates=e=>e();raf.catch=console.error;raf.frameLoop="always";raf.advance=()=>{raf.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):update()};let ts$1=-1,pendingCount=0,sync=!1;function schedule(e,o){sync?(o.delete(e),e(0)):(o.add(e),start())}function start(){ts$1<0&&(ts$1=0,raf.frameLoop!=="demand"&&nativeRaf(loop))}function stop(){ts$1=-1}function loop(){~ts$1&&(nativeRaf(loop),raf.batchedUpdates(update))}function update(){let e=ts$1;ts$1=raf.now();let o=findTimeout(ts$1);if(o&&(eachSafely(timeouts.splice(0,o),s=>s.handler()),pendingCount-=o),!pendingCount){stop();return}onStartQueue.flush(),updateQueue.flush(e?Math.min(64,ts$1-e):16.667),onFrameQueue.flush(),writeQueue.flush(),onFinishQueue.flush()}function makeQueue(){let e=new Set,o=e;return{add(s){pendingCount+=o==e&&!e.has(s)?1:0,e.add(s)},delete(s){return pendingCount-=o==e&&e.has(s)?1:0,e.delete(s)},flush(s){o.size&&(e=new Set,pendingCount-=o.size,eachSafely(o,a=>a(s)&&e.add(a)),pendingCount+=e.size,o=e)}}}function eachSafely(e,o){e.forEach(s=>{try{o(s)}catch(a){raf.catch(a)}})}function noop$3(){}const defineHidden=(e,o,s)=>Object.defineProperty(e,o,{value:s,writable:!0,configurable:!0}),is$1={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function isEqual$1(e,o){if(is$1.arr(e)){if(!is$1.arr(o)||e.length!==o.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==o[s])return!1;return!0}return e===o}const each$1=(e,o)=>e.forEach(o);function eachProp(e,o,s){if(is$1.arr(e)){for(let a=0;a<e.length;a++)o.call(s,e[a],`${a}`);return}for(const a in e)e.hasOwnProperty(a)&&o.call(s,e[a],a)}const toArray$3=e=>is$1.und(e)?[]:is$1.arr(e)?e:[e];function flush(e,o){if(e.size){const s=Array.from(e);e.clear(),each$1(s,o)}}const flushCalls=(e,...o)=>flush(e,s=>s(...o)),isSSR=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let createStringInterpolator$1,to$2,colors$1=null,skipAnimation=!1,willAdvance=noop$3;const assign=e=>{e.to&&(to$2=e.to),e.now&&(raf.now=e.now),e.colors!==void 0&&(colors$1=e.colors),e.skipAnimation!=null&&(skipAnimation=e.skipAnimation),e.createStringInterpolator&&(createStringInterpolator$1=e.createStringInterpolator),e.requestAnimationFrame&&raf.use(e.requestAnimationFrame),e.batchedUpdates&&(raf.batchedUpdates=e.batchedUpdates),e.willAdvance&&(willAdvance=e.willAdvance),e.frameLoop&&(raf.frameLoop=e.frameLoop)};var globals=Object.freeze({__proto__:null,get createStringInterpolator(){return createStringInterpolator$1},get to(){return to$2},get colors(){return colors$1},get skipAnimation(){return skipAnimation},get willAdvance(){return willAdvance},assign});const startQueue=new Set;let currentFrame=[],prevFrame=[],priority=0;const frameLoop={get idle(){return!startQueue.size&&!currentFrame.length},start(e){priority>e.priority?(startQueue.add(e),raf.onStart(flushStartQueue)):(startSafely(e),raf(advance))},advance,sort(e){if(priority)raf.onFrame(()=>frameLoop.sort(e));else{const o=currentFrame.indexOf(e);~o&&(currentFrame.splice(o,1),startUnsafely(e))}},clear(){currentFrame=[],startQueue.clear()}};function flushStartQueue(){startQueue.forEach(startSafely),startQueue.clear(),raf(advance)}function startSafely(e){currentFrame.includes(e)||startUnsafely(e)}function startUnsafely(e){currentFrame.splice(findIndex$1(currentFrame,o=>o.priority>e.priority),0,e)}function advance(e){const o=prevFrame;for(let s=0;s<currentFrame.length;s++){const a=currentFrame[s];priority=a.priority,a.idle||(willAdvance(a),a.advance(e),a.idle||o.push(a))}return priority=0,prevFrame=currentFrame,prevFrame.length=0,currentFrame=o,currentFrame.length>0}function findIndex$1(e,o){const s=e.findIndex(o);return s<0?e.length:s}const clamp$1=(e,o,s)=>Math.min(Math.max(s,e),o),colors={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},NUMBER="[-+]?\\d*\\.?\\d+",PERCENTAGE=NUMBER+"%";function call$1(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const rgb=new RegExp("rgb"+call$1(NUMBER,NUMBER,NUMBER)),rgba=new RegExp("rgba"+call$1(NUMBER,NUMBER,NUMBER,NUMBER)),hsl=new RegExp("hsl"+call$1(NUMBER,PERCENTAGE,PERCENTAGE)),hsla=new RegExp("hsla"+call$1(NUMBER,PERCENTAGE,PERCENTAGE,NUMBER)),hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6=/^#([0-9a-fA-F]{6})$/,hex8=/^#([0-9a-fA-F]{8})$/;function normalizeColor(e){let o;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(o=hex6.exec(e))?parseInt(o[1]+"ff",16)>>>0:colors$1&&colors$1[e]!==void 0?colors$1[e]:(o=rgb.exec(e))?(parse255(o[1])<<24|parse255(o[2])<<16|parse255(o[3])<<8|255)>>>0:(o=rgba.exec(e))?(parse255(o[1])<<24|parse255(o[2])<<16|parse255(o[3])<<8|parse1(o[4]))>>>0:(o=hex3.exec(e))?parseInt(o[1]+o[1]+o[2]+o[2]+o[3]+o[3]+"ff",16)>>>0:(o=hex8.exec(e))?parseInt(o[1],16)>>>0:(o=hex4.exec(e))?parseInt(o[1]+o[1]+o[2]+o[2]+o[3]+o[3]+o[4]+o[4],16)>>>0:(o=hsl.exec(e))?(hslToRgb(parse360(o[1]),parsePercentage(o[2]),parsePercentage(o[3]))|255)>>>0:(o=hsla.exec(e))?(hslToRgb(parse360(o[1]),parsePercentage(o[2]),parsePercentage(o[3]))|parse1(o[4]))>>>0:null}function hue2rgb(e,o,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(o-e)*6*s:s<1/2?o:s<2/3?e+(o-e)*(2/3-s)*6:e}function hslToRgb(e,o,s){const a=s<.5?s*(1+o):s+o-s*o,$=2*s-a,c=hue2rgb($,a,e+1/3),nt=hue2rgb($,a,e),at=hue2rgb($,a,e-1/3);return Math.round(c*255)<<24|Math.round(nt*255)<<16|Math.round(at*255)<<8}function parse255(e){const o=parseInt(e,10);return o<0?0:o>255?255:o}function parse360(e){return(parseFloat(e)%360+360)%360/360}function parse1(e){const o=parseFloat(e);return o<0?0:o>1?255:Math.round(o*255)}function parsePercentage(e){const o=parseFloat(e);return o<0?0:o>100?1:o/100}function colorToRgba(e){let o=normalizeColor(e);if(o===null)return e;o=o||0;let s=(o&4278190080)>>>24,a=(o&16711680)>>>16,$=(o&65280)>>>8,c=(o&255)/255;return`rgba(${s}, ${a}, ${$}, ${c})`}const createInterpolator=(e,o,s)=>{if(is$1.fun(e))return e;if(is$1.arr(e))return createInterpolator({range:e,output:o,extrapolate:s});if(is$1.str(e.output[0]))return createStringInterpolator$1(e);const a=e,$=a.output,c=a.range||[0,1],nt=a.extrapolateLeft||a.extrapolate||"extend",at=a.extrapolateRight||a.extrapolate||"extend",lt=a.easing||(et=>et);return et=>{const it=findRange(et,c);return interpolate(et,c[it],c[it+1],$[it],$[it+1],lt,nt,at,a.map)}};function interpolate(e,o,s,a,$,c,nt,at,lt){let et=lt?lt(e):e;if(et<o){if(nt==="identity")return et;nt==="clamp"&&(et=o)}if(et>s){if(at==="identity")return et;at==="clamp"&&(et=s)}return a===$?a:o===s?e<=o?a:$:(o===-1/0?et=-et:s===1/0?et=et-o:et=(et-o)/(s-o),et=c(et),a===-1/0?et=-et:$===1/0?et=et+a:et=et*($-a)+a,et)}function findRange(e,o){for(var s=1;s<o.length-1&&!(o[s]>=e);++s);return s-1}const steps=(e,o="end")=>s=>{s=o==="end"?Math.min(s,.999):Math.max(s,.001);const a=s*e,$=o==="end"?Math.floor(a):Math.ceil(a);return clamp$1(0,1,$/e)},c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*Math.PI/3,c5=2*Math.PI/4.5,bounceOut=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,easings={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>c3*e*e*e-c1*e*e,easeOutBack:e=>1+c3*Math.pow(e-1,3)+c1*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((c2+1)*2*e-c2)/2:(Math.pow(2*e-2,2)*((c2+1)*(e*2-2)+c2)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*c4),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*c4)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*c5))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*c5)/2+1,easeInBounce:e=>1-bounceOut(1-e),easeOutBounce:bounceOut,easeInOutBounce:e=>e<.5?(1-bounceOut(1-2*e))/2:(1+bounceOut(2*e-1))/2,steps};function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},_extends$2.apply(this,arguments)}const $get=Symbol.for("FluidValue.get"),$observers=Symbol.for("FluidValue.observers"),hasFluidValue=e=>!!(e&&e[$get]),getFluidValue=e=>e&&e[$get]?e[$get]():e,getFluidObservers=e=>e[$observers]||null;function callFluidObserver(e,o){e.eventObserved?e.eventObserved(o):e(o)}function callFluidObservers(e,o){let s=e[$observers];s&&s.forEach(a=>{callFluidObserver(a,o)})}class FluidValue{constructor(o){if(this[$get]=void 0,this[$observers]=void 0,!o&&!(o=this.get))throw Error("Unknown getter");setFluidGetter(this,o)}}const setFluidGetter=(e,o)=>setHidden(e,$get,o);function addFluidObserver(e,o){if(e[$get]){let s=e[$observers];s||setHidden(e,$observers,s=new Set),s.has(o)||(s.add(o),e.observerAdded&&e.observerAdded(s.size,o))}return o}function removeFluidObserver(e,o){let s=e[$observers];if(s&&s.has(o)){const a=s.size-1;a?s.delete(o):e[$observers]=null,e.observerRemoved&&e.observerRemoved(a,o)}}const setHidden=(e,o,s)=>Object.defineProperty(e,o,{value:s,writable:!0,configurable:!0}),numberRegex=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,colorRegex=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,unitRegex=new RegExp(`(${numberRegex.source})(%|[a-z]+)`,"i"),rgbaRegex=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,variableToRgba=e=>{const[o,s]=parseCSSVariable(e);if(!o||isSSR())return e;const a=window.getComputedStyle(document.documentElement).getPropertyValue(o);if(a)return a.trim();if(s&&s.startsWith("--")){const $=window.getComputedStyle(document.documentElement).getPropertyValue(s);return $||e}else{if(s&&cssVariableRegex.test(s))return variableToRgba(s);if(s)return s}return e},parseCSSVariable=e=>{const o=cssVariableRegex.exec(e);if(!o)return[,];const[,s,a]=o;return[s,a]};let namedColorRegex;const rgbaRound=(e,o,s,a,$)=>`rgba(${Math.round(o)}, ${Math.round(s)}, ${Math.round(a)}, ${$})`,createStringInterpolator=e=>{namedColorRegex||(namedColorRegex=colors$1?new RegExp(`(${Object.keys(colors$1).join("|")})(?!\\w)`,"g"):/^\b$/);const o=e.output.map(c=>getFluidValue(c).replace(cssVariableRegex,variableToRgba).replace(colorRegex,colorToRgba).replace(namedColorRegex,colorToRgba)),s=o.map(c=>c.match(numberRegex).map(Number)),$=s[0].map((c,nt)=>s.map(at=>{if(!(nt in at))throw Error('The arity of each "output" value must be equal');return at[nt]})).map(c=>createInterpolator(_extends$2({},e,{output:c})));return c=>{var nt;const at=!unitRegex.test(o[0])&&((nt=o.find(et=>unitRegex.test(et)))==null?void 0:nt.replace(numberRegex,""));let lt=0;return o[0].replace(numberRegex,()=>`${$[lt++](c)}${at||""}`).replace(rgbaRegex,rgbaRound)}},prefix="react-spring: ",once$1=e=>{const o=e;let s=!1;if(typeof o!="function")throw new TypeError(`${prefix}once requires a function parameter`);return(...a)=>{s||(o(...a),s=!0)}},warnInterpolate=once$1(console.warn);function deprecateInterpolate(){warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`)}const warnDirectCall=once$1(console.warn);function deprecateDirectCall(){warnDirectCall(`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function isAnimatedString(e){return is$1.str(e)&&(e[0]=="#"||/\d/.test(e)||!isSSR()&&cssVariableRegex.test(e)||e in(colors$1||{}))}const useIsomorphicLayoutEffect=isSSR()?reactExports.useEffect:reactExports.useLayoutEffect,useIsMounted=()=>{const e=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function useForceUpdate(){const e=reactExports.useState()[1],o=useIsMounted();return()=>{o.current&&e(Math.random())}}function useMemoOne(e,o){const[s]=reactExports.useState(()=>({inputs:o,result:e()})),a=reactExports.useRef(),$=a.current;let c=$;return c?o&&c.inputs&&areInputsEqual(o,c.inputs)||(c={inputs:o,result:e()}):c=s,reactExports.useEffect(()=>{a.current=c,$==s&&(s.inputs=s.result=void 0)},[c]),c.result}function areInputsEqual(e,o){if(e.length!==o.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==o[s])return!1;return!0}const useOnce=e=>reactExports.useEffect(e,emptyDeps),emptyDeps=[];function usePrev(e){const o=reactExports.useRef();return reactExports.useEffect(()=>{o.current=e}),o.current}const $node=Symbol.for("Animated:node"),isAnimated=e=>!!e&&e[$node]===e,getAnimated=e=>e&&e[$node],setAnimated=(e,o)=>defineHidden(e,$node,o),getPayload=e=>e&&e[$node]&&e[$node].getPayload();class Animated{constructor(){this.payload=void 0,setAnimated(this,this)}getPayload(){return this.payload||[]}}class AnimatedValue extends Animated{constructor(o){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=o,is$1.num(this._value)&&(this.lastPosition=this._value)}static create(o){return new AnimatedValue(o)}getPayload(){return[this]}getValue(){return this._value}setValue(o,s){return is$1.num(o)&&(this.lastPosition=o,s&&(o=Math.round(o/s)*s,this.done&&(this.lastPosition=o))),this._value===o?!1:(this._value=o,!0)}reset(){const{done:o}=this;this.done=!1,is$1.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,o&&(this.lastVelocity=null),this.v0=null)}}class AnimatedString extends AnimatedValue{constructor(o){super(0),this._string=null,this._toString=void 0,this._toString=createInterpolator({output:[o,o]})}static create(o){return new AnimatedString(o)}getValue(){let o=this._string;return o??(this._string=this._toString(this._value))}setValue(o){if(is$1.str(o)){if(o==this._string)return!1;this._string=o,this._value=1}else if(super.setValue(o))this._string=null;else return!1;return!0}reset(o){o&&(this._toString=createInterpolator({output:[this.getValue(),o]})),this._value=0,super.reset()}}const TreeContext={dependencies:null};class AnimatedObject extends Animated{constructor(o){super(),this.source=o,this.setValue(o)}getValue(o){const s={};return eachProp(this.source,(a,$)=>{isAnimated(a)?s[$]=a.getValue(o):hasFluidValue(a)?s[$]=getFluidValue(a):o||(s[$]=a)}),s}setValue(o){this.source=o,this.payload=this._makePayload(o)}reset(){this.payload&&each$1(this.payload,o=>o.reset())}_makePayload(o){if(o){const s=new Set;return eachProp(o,this._addToPayload,s),Array.from(s)}}_addToPayload(o){TreeContext.dependencies&&hasFluidValue(o)&&TreeContext.dependencies.add(o);const s=getPayload(o);s&&each$1(s,a=>this.add(a))}}class AnimatedArray extends AnimatedObject{constructor(o){super(o)}static create(o){return new AnimatedArray(o)}getValue(){return this.source.map(o=>o.getValue())}setValue(o){const s=this.getPayload();return o.length==s.length?s.map((a,$)=>a.setValue(o[$])).some(Boolean):(super.setValue(o.map(makeAnimated)),!0)}}function makeAnimated(e){return(isAnimatedString(e)?AnimatedString:AnimatedValue).create(e)}function getAnimatedType(e){const o=getAnimated(e);return o?o.constructor:is$1.arr(e)?AnimatedArray:isAnimatedString(e)?AnimatedString:AnimatedValue}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},_extends$1.apply(this,arguments)}const withAnimated=(e,o)=>{const s=!is$1.fun(e)||e.prototype&&e.prototype.isReactComponent;return reactExports.forwardRef((a,$)=>{const c=reactExports.useRef(null),nt=s&&reactExports.useCallback(pt=>{c.current=updateRef($,pt)},[$]),[at,lt]=getAnimatedState(a,o),et=useForceUpdate(),it=()=>{const pt=c.current;if(s&&!pt)return;(pt?o.applyAnimatedValues(pt,at.getValue(!0)):!1)===!1&&et()},st=new PropsObserver(it,lt),ct=reactExports.useRef();useIsomorphicLayoutEffect(()=>(ct.current=st,each$1(lt,pt=>addFluidObserver(pt,st)),()=>{ct.current&&(each$1(ct.current.deps,pt=>removeFluidObserver(pt,ct.current)),raf.cancel(ct.current.update))})),reactExports.useEffect(it,[]),useOnce(()=>()=>{const pt=ct.current;each$1(pt.deps,gt=>removeFluidObserver(gt,pt))});const ft=o.getComponentProps(at.getValue());return reactExports.createElement(e,_extends$1({},ft,{ref:nt}))})};class PropsObserver{constructor(o,s){this.update=o,this.deps=s}eventObserved(o){o.type=="change"&&raf.write(this.update)}}function getAnimatedState(e,o){const s=new Set;return TreeContext.dependencies=s,e.style&&(e=_extends$1({},e,{style:o.createAnimatedStyle(e.style)})),e=new AnimatedObject(e),TreeContext.dependencies=null,[e,s]}function updateRef(e,o){return e&&(is$1.fun(e)?e(o):e.current=o),o}const cacheKey=Symbol.for("AnimatedComponent"),createHost=(e,{applyAnimatedValues:o=()=>!1,createAnimatedStyle:s=$=>new AnimatedObject($),getComponentProps:a=$=>$}={})=>{const $={applyAnimatedValues:o,createAnimatedStyle:s,getComponentProps:a},c=nt=>{const at=getDisplayName(nt)||"Anonymous";return is$1.str(nt)?nt=c[nt]||(c[nt]=withAnimated(nt,$)):nt=nt[cacheKey]||(nt[cacheKey]=withAnimated(nt,$)),nt.displayName=`Animated(${at})`,nt};return eachProp(e,(nt,at)=>{is$1.arr(e)&&(at=getDisplayName(nt)),c[at]=c(nt)}),{animated:c}},getDisplayName=e=>is$1.str(e)?e:e&&is$1.str(e.displayName)?e.displayName:is$1.fun(e)&&e.name||null;function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},_extends.apply(this,arguments)}function callProp(e,...o){return is$1.fun(e)?e(...o):e}const matchProp=(e,o)=>e===!0||!!(o&&e&&(is$1.fun(e)?e(o):toArray$3(e).includes(o))),resolveProp=(e,o)=>is$1.obj(e)?o&&e[o]:e,getDefaultProp=(e,o)=>e.default===!0?e[o]:e.default?e.default[o]:void 0,noopTransform=e=>e,getDefaultProps=(e,o=noopTransform)=>{let s=DEFAULT_PROPS;e.default&&e.default!==!0&&(e=e.default,s=Object.keys(e));const a={};for(const $ of s){const c=o(e[$],$);is$1.und(c)||(a[$]=c)}return a},DEFAULT_PROPS=["config","onProps","onStart","onChange","onPause","onResume","onRest"],RESERVED_PROPS={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function getForwardProps(e){const o={};let s=0;if(eachProp(e,(a,$)=>{RESERVED_PROPS[$]||(o[$]=a,s++)}),s)return o}function inferTo(e){const o=getForwardProps(e);if(o){const s={to:o};return eachProp(e,(a,$)=>$ in o||(s[$]=a)),s}return _extends({},e)}function computeGoal(e){return e=getFluidValue(e),is$1.arr(e)?e.map(computeGoal):isAnimatedString(e)?globals.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function hasProps(e){for(const o in e)return!0;return!1}function isAsyncTo(e){return is$1.fun(e)||is$1.arr(e)&&is$1.obj(e[0])}function detachRefs(e,o){var s;(s=e.ref)==null||s.delete(e),o?.delete(e)}function replaceRef(e,o){if(o&&e.ref!==o){var s;(s=e.ref)==null||s.delete(e),o.add(e),e.ref=o}}const config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},defaults$3=_extends({},config.default,{mass:1,damping:1,easing:easings.linear,clamp:!1});class AnimationConfig{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,defaults$3)}}function mergeConfig$1(e,o,s){s&&(s=_extends({},s),sanitizeConfig(s,o),o=_extends({},s,o)),sanitizeConfig(e,o),Object.assign(e,o);for(const nt in defaults$3)e[nt]==null&&(e[nt]=defaults$3[nt]);let{mass:a,frequency:$,damping:c}=e;return is$1.und($)||($<.01&&($=.01),c<0&&(c=0),e.tension=Math.pow(2*Math.PI/$,2)*a,e.friction=4*Math.PI*c*a/$),e}function sanitizeConfig(e,o){if(!is$1.und(o.decay))e.duration=void 0;else{const s=!is$1.und(o.tension)||!is$1.und(o.friction);(s||!is$1.und(o.frequency)||!is$1.und(o.damping)||!is$1.und(o.mass))&&(e.duration=void 0,e.decay=void 0),s&&(e.frequency=void 0)}}const emptyArray=[];class Animation{constructor(){this.changed=!1,this.values=emptyArray,this.toValues=null,this.fromValues=emptyArray,this.to=void 0,this.from=void 0,this.config=new AnimationConfig,this.immediate=!1}}function scheduleProps(e,{key:o,props:s,defaultProps:a,state:$,actions:c}){return new Promise((nt,at)=>{var lt;let et,it,st=matchProp((lt=s.cancel)!=null?lt:a?.cancel,o);if(st)pt();else{is$1.und(s.pause)||($.paused=matchProp(s.pause,o));let gt=a?.pause;gt!==!0&&(gt=$.paused||matchProp(gt,o)),et=callProp(s.delay||0,o),gt?($.resumeQueue.add(ft),c.pause()):(c.resume(),ft())}function ct(){$.resumeQueue.add(ft),$.timeouts.delete(it),it.cancel(),et=it.time-raf.now()}function ft(){et>0&&!globals.skipAnimation?($.delayed=!0,it=raf.setTimeout(pt,et),$.pauseQueue.add(ct),$.timeouts.add(it)):pt()}function pt(){$.delayed&&($.delayed=!1),$.pauseQueue.delete(ct),$.timeouts.delete(it),e<=($.cancelId||0)&&(st=!0);try{c.start(_extends({},s,{callId:e,cancel:st}),nt)}catch(gt){at(gt)}}})}const getCombinedResult=(e,o)=>o.length==1?o[0]:o.some(s=>s.cancelled)?getCancelledResult(e.get()):o.every(s=>s.noop)?getNoopResult(e.get()):getFinishedResult(e.get(),o.every(s=>s.finished)),getNoopResult=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),getFinishedResult=(e,o,s=!1)=>({value:e,finished:o,cancelled:s}),getCancelledResult=e=>({value:e,cancelled:!0,finished:!1});function runAsync(e,o,s,a){const{callId:$,parentId:c,onRest:nt}=o,{asyncTo:at,promise:lt}=s;return!c&&e===at&&!o.reset?lt:s.promise=(async()=>{s.asyncId=$,s.asyncTo=e;const et=getDefaultProps(o,(wt,vt)=>vt==="onRest"?void 0:wt);let it,st;const ct=new Promise((wt,vt)=>(it=wt,st=vt)),ft=wt=>{const vt=$<=(s.cancelId||0)&&getCancelledResult(a)||$!==s.asyncId&&getFinishedResult(a,!1);if(vt)throw wt.result=vt,st(wt),wt},pt=(wt,vt)=>{const _t=new BailSignal,$t=new SkipAnimationSignal;return(async()=>{if(globals.skipAnimation)throw stopAsync(s),$t.result=getFinishedResult(a,!1),st($t),$t;ft(_t);const Pt=is$1.obj(wt)?_extends({},wt):_extends({},vt,{to:wt});Pt.parentId=$,eachProp(et,(Lt,Ft)=>{is$1.und(Pt[Ft])&&(Pt[Ft]=Lt)});const Nt=await a.start(Pt);return ft(_t),s.paused&&await new Promise(Lt=>{s.resumeQueue.add(Lt)}),Nt})()};let gt;if(globals.skipAnimation)return stopAsync(s),getFinishedResult(a,!1);try{let wt;is$1.arr(e)?wt=(async vt=>{for(const _t of vt)await pt(_t)})(e):wt=Promise.resolve(e(pt,a.stop.bind(a))),await Promise.all([wt.then(it),ct]),gt=getFinishedResult(a.get(),!0,!1)}catch(wt){if(wt instanceof BailSignal)gt=wt.result;else if(wt instanceof SkipAnimationSignal)gt=wt.result;else throw wt}finally{$==s.asyncId&&(s.asyncId=c,s.asyncTo=c?at:void 0,s.promise=c?lt:void 0)}return is$1.fun(nt)&&raf.batchedUpdates(()=>{nt(gt,a,a.item)}),gt})()}function stopAsync(e,o){flush(e.timeouts,s=>s.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,o&&(e.cancelId=o)}class BailSignal extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class SkipAnimationSignal extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const isFrameValue=e=>e instanceof FrameValue;let nextId$1=1;class FrameValue extends FluidValue{constructor(...o){super(...o),this.id=nextId$1++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(o){this._priority!=o&&(this._priority=o,this._onPriorityChange(o))}get(){const o=getAnimated(this);return o&&o.getValue()}to(...o){return globals.to(this,o)}interpolate(...o){return deprecateInterpolate(),globals.to(this,o)}toJSON(){return this.get()}observerAdded(o){o==1&&this._attach()}observerRemoved(o){o==0&&this._detach()}_attach(){}_detach(){}_onChange(o,s=!1){callFluidObservers(this,{type:"change",parent:this,value:o,idle:s})}_onPriorityChange(o){this.idle||frameLoop.sort(this),callFluidObservers(this,{type:"priority",parent:this,priority:o})}}const $P=Symbol.for("SpringPhase"),HAS_ANIMATED=1,IS_ANIMATING=2,IS_PAUSED=4,hasAnimated=e=>(e[$P]&HAS_ANIMATED)>0,isAnimating=e=>(e[$P]&IS_ANIMATING)>0,isPaused=e=>(e[$P]&IS_PAUSED)>0,setActiveBit=(e,o)=>o?e[$P]|=IS_ANIMATING|HAS_ANIMATED:e[$P]&=~IS_ANIMATING,setPausedBit=(e,o)=>o?e[$P]|=IS_PAUSED:e[$P]&=~IS_PAUSED;class SpringValue extends FrameValue{constructor(o,s){if(super(),this.key=void 0,this.animation=new Animation,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!is$1.und(o)||!is$1.und(s)){const a=is$1.obj(o)?_extends({},o):_extends({},s,{from:o});is$1.und(a.default)&&(a.default=!0),this.start(a)}}get idle(){return!(isAnimating(this)||this._state.asyncTo)||isPaused(this)}get goal(){return getFluidValue(this.animation.to)}get velocity(){const o=getAnimated(this);return o instanceof AnimatedValue?o.lastVelocity||0:o.getPayload().map(s=>s.lastVelocity||0)}get hasAnimated(){return hasAnimated(this)}get isAnimating(){return isAnimating(this)}get isPaused(){return isPaused(this)}get isDelayed(){return this._state.delayed}advance(o){let s=!0,a=!1;const $=this.animation;let{config:c,toValues:nt}=$;const at=getPayload($.to);!at&&hasFluidValue($.to)&&(nt=toArray$3(getFluidValue($.to))),$.values.forEach((it,st)=>{if(it.done)return;const ct=it.constructor==AnimatedString?1:at?at[st].lastPosition:nt[st];let ft=$.immediate,pt=ct;if(!ft){if(pt=it.lastPosition,c.tension<=0){it.done=!0;return}let gt=it.elapsedTime+=o;const wt=$.fromValues[st],vt=it.v0!=null?it.v0:it.v0=is$1.arr(c.velocity)?c.velocity[st]:c.velocity;let _t;const $t=c.precision||(wt==ct?.005:Math.min(1,Math.abs(ct-wt)*.001));if(is$1.und(c.duration))if(c.decay){const Pt=c.decay===!0?.998:c.decay,Nt=Math.exp(-(1-Pt)*gt);pt=wt+vt/(1-Pt)*(1-Nt),ft=Math.abs(it.lastPosition-pt)<=$t,_t=vt*Nt}else{_t=it.lastVelocity==null?vt:it.lastVelocity;const Pt=c.restVelocity||$t/10,Nt=c.clamp?0:c.bounce,Lt=!is$1.und(Nt),Ft=wt==ct?it.v0>0:wt<ct;let Jt,_r=!1;const wr=1,tn=Math.ceil(o/wr);for(let Wt=0;Wt<tn&&(Jt=Math.abs(_t)>Pt,!(!Jt&&(ft=Math.abs(ct-pt)<=$t,ft)));++Wt){Lt&&(_r=pt==ct||pt>ct==Ft,_r&&(_t=-_t*Nt,pt=ct));const Yr=-c.tension*1e-6*(pt-ct),Ot=-c.friction*.001*_t,gr=(Yr+Ot)/c.mass;_t=_t+gr*wr,pt=pt+_t*wr}}else{let Pt=1;c.duration>0&&(this._memoizedDuration!==c.duration&&(this._memoizedDuration=c.duration,it.durationProgress>0&&(it.elapsedTime=c.duration*it.durationProgress,gt=it.elapsedTime+=o)),Pt=(c.progress||0)+gt/this._memoizedDuration,Pt=Pt>1?1:Pt<0?0:Pt,it.durationProgress=Pt),pt=wt+c.easing(Pt)*(ct-wt),_t=(pt-it.lastPosition)/o,ft=Pt==1}it.lastVelocity=_t,Number.isNaN(pt)&&(console.warn("Got NaN while animating:",this),ft=!0)}at&&!at[st].done&&(ft=!1),ft?it.done=!0:s=!1,it.setValue(pt,c.round)&&(a=!0)});const lt=getAnimated(this),et=lt.getValue();if(s){const it=getFluidValue($.to);(et!==it||a)&&!c.decay?(lt.setValue(it),this._onChange(it)):a&&c.decay&&this._onChange(et),this._stop()}else a&&this._onChange(et)}set(o){return raf.batchedUpdates(()=>{this._stop(),this._focus(o),this._set(o)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(isAnimating(this)){const{to:o,config:s}=this.animation;raf.batchedUpdates(()=>{this._onStart(),s.decay||this._set(o,!1),this._stop()})}return this}update(o){return(this.queue||(this.queue=[])).push(o),this}start(o,s){let a;return is$1.und(o)?(a=this.queue||[],this.queue=[]):a=[is$1.obj(o)?o:_extends({},s,{to:o})],Promise.all(a.map($=>this._update($))).then($=>getCombinedResult(this,$))}stop(o){const{to:s}=this.animation;return this._focus(this.get()),stopAsync(this._state,o&&this._lastCallId),raf.batchedUpdates(()=>this._stop(s,o)),this}reset(){this._update({reset:!0})}eventObserved(o){o.type=="change"?this._start():o.type=="priority"&&(this.priority=o.priority+1)}_prepareNode(o){const s=this.key||"";let{to:a,from:$}=o;a=is$1.obj(a)?a[s]:a,(a==null||isAsyncTo(a))&&(a=void 0),$=is$1.obj($)?$[s]:$,$==null&&($=void 0);const c={to:a,from:$};return hasAnimated(this)||(o.reverse&&([a,$]=[$,a]),$=getFluidValue($),is$1.und($)?getAnimated(this)||this._set(a):this._set($)),c}_update(o,s){let a=_extends({},o);const{key:$,defaultProps:c}=this;a.default&&Object.assign(c,getDefaultProps(a,(lt,et)=>/^on/.test(et)?resolveProp(lt,$):lt)),mergeActiveFn(this,a,"onProps"),sendEvent(this,"onProps",a,this);const nt=this._prepareNode(a);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const at=this._state;return scheduleProps(++this._lastCallId,{key:$,props:a,defaultProps:c,state:at,actions:{pause:()=>{isPaused(this)||(setPausedBit(this,!0),flushCalls(at.pauseQueue),sendEvent(this,"onPause",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},resume:()=>{isPaused(this)&&(setPausedBit(this,!1),isAnimating(this)&&this._resume(),flushCalls(at.resumeQueue),sendEvent(this,"onResume",getFinishedResult(this,checkFinished(this,this.animation.to)),this))},start:this._merge.bind(this,nt)}}).then(lt=>{if(a.loop&&lt.finished&&!(s&&lt.noop)){const et=createLoopUpdate(a);if(et)return this._update(et,!0)}return lt})}_merge(o,s,a){if(s.cancel)return this.stop(!0),a(getCancelledResult(this));const $=!is$1.und(o.to),c=!is$1.und(o.from);if($||c)if(s.callId>this._lastToId)this._lastToId=s.callId;else return a(getCancelledResult(this));const{key:nt,defaultProps:at,animation:lt}=this,{to:et,from:it}=lt;let{to:st=et,from:ct=it}=o;c&&!$&&(!s.default||is$1.und(st))&&(st=ct),s.reverse&&([st,ct]=[ct,st]);const ft=!isEqual$1(ct,it);ft&&(lt.from=ct),ct=getFluidValue(ct);const pt=!isEqual$1(st,et);pt&&this._focus(st);const gt=isAsyncTo(s.to),{config:wt}=lt,{decay:vt,velocity:_t}=wt;($||c)&&(wt.velocity=0),s.config&&!gt&&mergeConfig$1(wt,callProp(s.config,nt),s.config!==at.config?callProp(at.config,nt):void 0);let $t=getAnimated(this);if(!$t||is$1.und(st))return a(getFinishedResult(this,!0));const Pt=is$1.und(s.reset)?c&&!s.default:!is$1.und(ct)&&matchProp(s.reset,nt),Nt=Pt?ct:this.get(),Lt=computeGoal(st),Ft=is$1.num(Lt)||is$1.arr(Lt)||isAnimatedString(Lt),Jt=!gt&&(!Ft||matchProp(at.immediate||s.immediate,nt));if(pt){const Wt=getAnimatedType(st);if(Wt!==$t.constructor)if(Jt)$t=this._set(Lt);else throw Error(`Cannot animate between ${$t.constructor.name} and ${Wt.name}, as the "to" prop suggests`)}const _r=$t.constructor;let wr=hasFluidValue(st),tn=!1;if(!wr){const Wt=Pt||!hasAnimated(this)&&ft;(pt||Wt)&&(tn=isEqual$1(computeGoal(Nt),Lt),wr=!tn),(!isEqual$1(lt.immediate,Jt)&&!Jt||!isEqual$1(wt.decay,vt)||!isEqual$1(wt.velocity,_t))&&(wr=!0)}if(tn&&isAnimating(this)&&(lt.changed&&!Pt?wr=!0:wr||this._stop(et)),!gt&&((wr||hasFluidValue(et))&&(lt.values=$t.getPayload(),lt.toValues=hasFluidValue(st)?null:_r==AnimatedString?[1]:toArray$3(Lt)),lt.immediate!=Jt&&(lt.immediate=Jt,!Jt&&!Pt&&this._set(et)),wr)){const{onRest:Wt}=lt;each$1(ACTIVE_EVENTS,Ot=>mergeActiveFn(this,s,Ot));const Yr=getFinishedResult(this,checkFinished(this,et));flushCalls(this._pendingCalls,Yr),this._pendingCalls.add(a),lt.changed&&raf.batchedUpdates(()=>{lt.changed=!Pt,Wt?.(Yr,this),Pt?callProp(at.onRest,Yr):lt.onStart==null||lt.onStart(Yr,this)})}Pt&&this._set(Nt),gt?a(runAsync(s.to,s,this._state,this)):wr?this._start():isAnimating(this)&&!pt?this._pendingCalls.add(a):a(getNoopResult(Nt))}_focus(o){const s=this.animation;o!==s.to&&(getFluidObservers(this)&&this._detach(),s.to=o,getFluidObservers(this)&&this._attach())}_attach(){let o=0;const{to:s}=this.animation;hasFluidValue(s)&&(addFluidObserver(s,this),isFrameValue(s)&&(o=s.priority+1)),this.priority=o}_detach(){const{to:o}=this.animation;hasFluidValue(o)&&removeFluidObserver(o,this)}_set(o,s=!0){const a=getFluidValue(o);if(!is$1.und(a)){const $=getAnimated(this);if(!$||!isEqual$1(a,$.getValue())){const c=getAnimatedType(a);!$||$.constructor!=c?setAnimated(this,c.create(a)):$.setValue(a),$&&raf.batchedUpdates(()=>{this._onChange(a,s)})}}return getAnimated(this)}_onStart(){const o=this.animation;o.changed||(o.changed=!0,sendEvent(this,"onStart",getFinishedResult(this,checkFinished(this,o.to)),this))}_onChange(o,s){s||(this._onStart(),callProp(this.animation.onChange,o,this)),callProp(this.defaultProps.onChange,o,this),super._onChange(o,s)}_start(){const o=this.animation;getAnimated(this).reset(getFluidValue(o.to)),o.immediate||(o.fromValues=o.values.map(s=>s.lastPosition)),isAnimating(this)||(setActiveBit(this,!0),isPaused(this)||this._resume())}_resume(){globals.skipAnimation?this.finish():frameLoop.start(this)}_stop(o,s){if(isAnimating(this)){setActiveBit(this,!1);const a=this.animation;each$1(a.values,c=>{c.done=!0}),a.toValues&&(a.onChange=a.onPause=a.onResume=void 0),callFluidObservers(this,{type:"idle",parent:this});const $=s?getCancelledResult(this.get()):getFinishedResult(this.get(),checkFinished(this,o??a.to));flushCalls(this._pendingCalls,$),a.changed&&(a.changed=!1,sendEvent(this,"onRest",$,this))}}}function checkFinished(e,o){const s=computeGoal(o),a=computeGoal(e.get());return isEqual$1(a,s)}function createLoopUpdate(e,o=e.loop,s=e.to){let a=callProp(o);if(a){const $=a!==!0&&inferTo(a),c=($||e).reverse,nt=!$||$.reset;return createUpdate(_extends({},e,{loop:o,default:!1,pause:void 0,to:!c||isAsyncTo(s)?s:void 0,from:nt?e.from:void 0,reset:nt},$))}}function createUpdate(e){const{to:o,from:s}=e=inferTo(e),a=new Set;return is$1.obj(o)&&findDefined(o,a),is$1.obj(s)&&findDefined(s,a),e.keys=a.size?Array.from(a):null,e}function declareUpdate(e){const o=createUpdate(e);return is$1.und(o.default)&&(o.default=getDefaultProps(o)),o}function findDefined(e,o){eachProp(e,(s,a)=>s!=null&&o.add(a))}const ACTIVE_EVENTS=["onStart","onRest","onChange","onPause","onResume"];function mergeActiveFn(e,o,s){e.animation[s]=o[s]!==getDefaultProp(o,s)?resolveProp(o[s],e.key):void 0}function sendEvent(e,o,...s){var a,$,c,nt;(a=($=e.animation)[o])==null||a.call($,...s),(c=(nt=e.defaultProps)[o])==null||c.call(nt,...s)}const BATCHED_EVENTS=["onStart","onChange","onRest"];let nextId=1,Controller$1=class{constructor(o,s){this.id=nextId++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),s&&(this._flush=s),o&&this.start(_extends({default:!0},o))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(o=>o.idle&&!o.isDelayed&&!o.isPaused)}get item(){return this._item}set item(o){this._item=o}get(){const o={};return this.each((s,a)=>o[a]=s.get()),o}set(o){for(const s in o){const a=o[s];is$1.und(a)||this.springs[s].set(a)}}update(o){return o&&this.queue.push(createUpdate(o)),this}start(o){let{queue:s}=this;return o?s=toArray$3(o).map(createUpdate):this.queue=[],this._flush?this._flush(this,s):(prepareKeys(this,s),flushUpdateQueue(this,s))}stop(o,s){if(o!==!!o&&(s=o),s){const a=this.springs;each$1(toArray$3(s),$=>a[$].stop(!!o))}else stopAsync(this._state,this._lastAsyncId),this.each(a=>a.stop(!!o));return this}pause(o){if(is$1.und(o))this.start({pause:!0});else{const s=this.springs;each$1(toArray$3(o),a=>s[a].pause())}return this}resume(o){if(is$1.und(o))this.start({pause:!1});else{const s=this.springs;each$1(toArray$3(o),a=>s[a].resume())}return this}each(o){eachProp(this.springs,o)}_onFrame(){const{onStart:o,onChange:s,onRest:a}=this._events,$=this._active.size>0,c=this._changed.size>0;($&&!this._started||c&&!this._started)&&(this._started=!0,flush(o,([lt,et])=>{et.value=this.get(),lt(et,this,this._item)}));const nt=!$&&this._started,at=c||nt&&a.size?this.get():null;c&&s.size&&flush(s,([lt,et])=>{et.value=at,lt(et,this,this._item)}),nt&&(this._started=!1,flush(a,([lt,et])=>{et.value=at,lt(et,this,this._item)}))}eventObserved(o){if(o.type=="change")this._changed.add(o.parent),o.idle||this._active.add(o.parent);else if(o.type=="idle")this._active.delete(o.parent);else return;raf.onFrame(this._onFrame)}};function flushUpdateQueue(e,o){return Promise.all(o.map(s=>flushUpdate(e,s))).then(s=>getCombinedResult(e,s))}async function flushUpdate(e,o,s){const{keys:a,to:$,from:c,loop:nt,onRest:at,onResolve:lt}=o,et=is$1.obj(o.default)&&o.default;nt&&(o.loop=!1),$===!1&&(o.to=null),c===!1&&(o.from=null);const it=is$1.arr($)||is$1.fun($)?$:void 0;it?(o.to=void 0,o.onRest=void 0,et&&(et.onRest=void 0)):each$1(BATCHED_EVENTS,gt=>{const wt=o[gt];if(is$1.fun(wt)){const vt=e._events[gt];o[gt]=({finished:_t,cancelled:$t})=>{const Pt=vt.get(wt);Pt?(_t||(Pt.finished=!1),$t&&(Pt.cancelled=!0)):vt.set(wt,{value:null,finished:_t||!1,cancelled:$t||!1})},et&&(et[gt]=o[gt])}});const st=e._state;o.pause===!st.paused?(st.paused=o.pause,flushCalls(o.pause?st.pauseQueue:st.resumeQueue)):st.paused&&(o.pause=!0);const ct=(a||Object.keys(e.springs)).map(gt=>e.springs[gt].start(o)),ft=o.cancel===!0||getDefaultProp(o,"cancel")===!0;(it||ft&&st.asyncId)&&ct.push(scheduleProps(++e._lastAsyncId,{props:o,state:st,actions:{pause:noop$3,resume:noop$3,start(gt,wt){ft?(stopAsync(st,e._lastAsyncId),wt(getCancelledResult(e))):(gt.onRest=at,wt(runAsync(it,gt,st,e)))}}})),st.paused&&await new Promise(gt=>{st.resumeQueue.add(gt)});const pt=getCombinedResult(e,await Promise.all(ct));if(nt&&pt.finished&&!(s&&pt.noop)){const gt=createLoopUpdate(o,nt,$);if(gt)return prepareKeys(e,[gt]),flushUpdate(e,gt,!0)}return lt&&raf.batchedUpdates(()=>lt(pt,e,e.item)),pt}function getSprings(e,o){const s=_extends({},e.springs);return o&&each$1(toArray$3(o),a=>{is$1.und(a.keys)&&(a=createUpdate(a)),is$1.obj(a.to)||(a=_extends({},a,{to:void 0})),prepareSprings(s,a,$=>createSpring($))}),setSprings(e,s),s}function setSprings(e,o){eachProp(o,(s,a)=>{e.springs[a]||(e.springs[a]=s,addFluidObserver(s,e))})}function createSpring(e,o){const s=new SpringValue;return s.key=e,o&&addFluidObserver(s,o),s}function prepareSprings(e,o,s){o.keys&&each$1(o.keys,a=>{(e[a]||(e[a]=s(a)))._prepareNode(o)})}function prepareKeys(e,o){each$1(o,s=>{prepareSprings(e.springs,s,a=>createSpring(a,e))})}function _objectWithoutPropertiesLoose$2(e,o){if(e==null)return{};var s={},a=Object.keys(e),$,c;for(c=0;c<a.length;c++)$=a[c],!(o.indexOf($)>=0)&&(s[$]=e[$]);return s}const _excluded$6=["children"],SpringContext=e=>{let{children:o}=e,s=_objectWithoutPropertiesLoose$2(e,_excluded$6);const a=reactExports.useContext(ctx),$=s.pause||!!a.pause,c=s.immediate||!!a.immediate;s=useMemoOne(()=>({pause:$,immediate:c}),[$,c]);const{Provider:nt}=ctx;return reactExports.createElement(nt,{value:s},o)},ctx=makeContext(SpringContext,{});SpringContext.Provider=ctx.Provider;SpringContext.Consumer=ctx.Consumer;function makeContext(e,o){return Object.assign(e,reactExports.createContext(o)),e.Provider._context=e,e.Consumer._context=e,e}const SpringRef=()=>{const e=[],o=function($){deprecateDirectCall();const c=[];return each$1(e,(nt,at)=>{if(is$1.und($))c.push(nt.start());else{const lt=s($,nt,at);lt&&c.push(nt.start(lt))}}),c};o.current=e,o.add=function(a){e.includes(a)||e.push(a)},o.delete=function(a){const $=e.indexOf(a);~$&&e.splice($,1)},o.pause=function(){return each$1(e,a=>a.pause(...arguments)),this},o.resume=function(){return each$1(e,a=>a.resume(...arguments)),this},o.set=function(a){each$1(e,$=>$.set(a))},o.start=function(a){const $=[];return each$1(e,(c,nt)=>{if(is$1.und(a))$.push(c.start());else{const at=this._getProps(a,c,nt);at&&$.push(c.start(at))}}),$},o.stop=function(){return each$1(e,a=>a.stop(...arguments)),this},o.update=function(a){return each$1(e,($,c)=>$.update(this._getProps(a,$,c))),this};const s=function($,c,nt){return is$1.fun($)?$(nt,c):$};return o._getProps=s,o};function useSprings(e,o,s){const a=is$1.fun(o)&&o;a&&!s&&(s=[]);const $=reactExports.useMemo(()=>a||arguments.length==3?SpringRef():void 0,[]),c=reactExports.useRef(0),nt=useForceUpdate(),at=reactExports.useMemo(()=>({ctrls:[],queue:[],flush(vt,_t){const $t=getSprings(vt,_t);return c.current>0&&!at.queue.length&&!Object.keys($t).some(Nt=>!vt.springs[Nt])?flushUpdateQueue(vt,_t):new Promise(Nt=>{setSprings(vt,$t),at.queue.push(()=>{Nt(flushUpdateQueue(vt,_t))}),nt()})}}),[]),lt=reactExports.useRef([...at.ctrls]),et=[],it=usePrev(e)||0;reactExports.useMemo(()=>{each$1(lt.current.slice(e,it),vt=>{detachRefs(vt,$),vt.stop(!0)}),lt.current.length=e,st(it,e)},[e]),reactExports.useMemo(()=>{st(0,Math.min(it,e))},s);function st(vt,_t){for(let $t=vt;$t<_t;$t++){const Pt=lt.current[$t]||(lt.current[$t]=new Controller$1(null,at.flush)),Nt=a?a($t,Pt):o[$t];Nt&&(et[$t]=declareUpdate(Nt))}}const ct=lt.current.map((vt,_t)=>getSprings(vt,et[_t])),ft=reactExports.useContext(SpringContext),pt=usePrev(ft),gt=ft!==pt&&hasProps(ft);useIsomorphicLayoutEffect(()=>{c.current++,at.ctrls=lt.current;const{queue:vt}=at;vt.length&&(at.queue=[],each$1(vt,_t=>_t())),each$1(lt.current,(_t,$t)=>{$?.add(_t),gt&&_t.start({default:ft});const Pt=et[$t];Pt&&(replaceRef(_t,Pt.ref),_t.ref?_t.queue.push(Pt):_t.start(Pt))})}),useOnce(()=>()=>{each$1(at.ctrls,vt=>vt.stop(!0))});const wt=ct.map(vt=>_extends({},vt));return $?[wt,$]:wt}function useSpring(e,o){const s=is$1.fun(e),[[a],$]=useSprings(1,s?e:[e],s?[]:o);return s||arguments.length==2?[a,$]:a}let TransitionPhase;(function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"})(TransitionPhase||(TransitionPhase={}));class Interpolation extends FrameValue{constructor(o,s){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=o,this.calc=createInterpolator(...s);const a=this._get(),$=getAnimatedType(a);setAnimated(this,$.create(a))}advance(o){const s=this._get(),a=this.get();isEqual$1(s,a)||(getAnimated(this).setValue(s),this._onChange(s,this.idle)),!this.idle&&checkIdle(this._active)&&becomeIdle(this)}_get(){const o=is$1.arr(this.source)?this.source.map(getFluidValue):toArray$3(getFluidValue(this.source));return this.calc(...o)}_start(){this.idle&&!checkIdle(this._active)&&(this.idle=!1,each$1(getPayload(this),o=>{o.done=!1}),globals.skipAnimation?(raf.batchedUpdates(()=>this.advance()),becomeIdle(this)):frameLoop.start(this))}_attach(){let o=1;each$1(toArray$3(this.source),s=>{hasFluidValue(s)&&addFluidObserver(s,this),isFrameValue(s)&&(s.idle||this._active.add(s),o=Math.max(o,s.priority+1))}),this.priority=o,this._start()}_detach(){each$1(toArray$3(this.source),o=>{hasFluidValue(o)&&removeFluidObserver(o,this)}),this._active.clear(),becomeIdle(this)}eventObserved(o){o.type=="change"?o.idle?this.advance():(this._active.add(o.parent),this._start()):o.type=="idle"?this._active.delete(o.parent):o.type=="priority"&&(this.priority=toArray$3(this.source).reduce((s,a)=>Math.max(s,(isFrameValue(a)?a.priority:0)+1),0))}}function isIdle(e){return e.idle!==!1}function checkIdle(e){return!e.size||Array.from(e).every(isIdle)}function becomeIdle(e){e.idle||(e.idle=!0,each$1(getPayload(e),o=>{o.done=!0}),callFluidObservers(e,{type:"idle",parent:e}))}globals.assign({createStringInterpolator,to:(e,o)=>new Interpolation(e,o)});function _objectWithoutPropertiesLoose$1(e,o){if(e==null)return{};var s={},a=Object.keys(e),$,c;for(c=0;c<a.length;c++)$=a[c],!(o.indexOf($)>=0)&&(s[$]=e[$]);return s}const _excluded$2=["style","children","scrollTop","scrollLeft","viewBox"],isCustomPropRE=/^--/;function dangerousStyleValue(e,o){return o==null||typeof o=="boolean"||o===""?"":typeof o=="number"&&o!==0&&!isCustomPropRE.test(e)&&!(isUnitlessNumber.hasOwnProperty(e)&&isUnitlessNumber[e])?o+"px":(""+o).trim()}const attributeCache={};function applyAnimatedValues(e,o){if(!e.nodeType||!e.setAttribute)return!1;const s=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",a=o,{style:$,children:c,scrollTop:nt,scrollLeft:at,viewBox:lt}=a,et=_objectWithoutPropertiesLoose$1(a,_excluded$2),it=Object.values(et),st=Object.keys(et).map(ct=>s||e.hasAttribute(ct)?ct:attributeCache[ct]||(attributeCache[ct]=ct.replace(/([A-Z])/g,ft=>"-"+ft.toLowerCase())));c!==void 0&&(e.textContent=c);for(let ct in $)if($.hasOwnProperty(ct)){const ft=dangerousStyleValue(ct,$[ct]);isCustomPropRE.test(ct)?e.style.setProperty(ct,ft):e.style[ct]=ft}st.forEach((ct,ft)=>{e.setAttribute(ct,it[ft])}),nt!==void 0&&(e.scrollTop=nt),at!==void 0&&(e.scrollLeft=at),lt!==void 0&&e.setAttribute("viewBox",lt)}let isUnitlessNumber={animationIterationCount:!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,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};const prefixKey=(e,o)=>e+o.charAt(0).toUpperCase()+o.substring(1),prefixes=["Webkit","Ms","Moz","O"];isUnitlessNumber=Object.keys(isUnitlessNumber).reduce((e,o)=>(prefixes.forEach(s=>e[prefixKey(s,o)]=e[o]),e),isUnitlessNumber);const _excluded$1=["x","y","z"],domTransforms=/^(matrix|translate|scale|rotate|skew)/,pxTransforms=/^(translate)/,degTransforms=/^(rotate|skew)/,addUnit=(e,o)=>is$1.num(e)&&e!==0?e+o:e,isValueIdentity=(e,o)=>is$1.arr(e)?e.every(s=>isValueIdentity(s,o)):is$1.num(e)?e===o:parseFloat(e)===o;class AnimatedStyle extends AnimatedObject{constructor(o){let{x:s,y:a,z:$}=o,c=_objectWithoutPropertiesLoose$1(o,_excluded$1);const nt=[],at=[];(s||a||$)&&(nt.push([s||0,a||0,$||0]),at.push(lt=>[`translate3d(${lt.map(et=>addUnit(et,"px")).join(",")})`,isValueIdentity(lt,0)])),eachProp(c,(lt,et)=>{if(et==="transform")nt.push([lt||""]),at.push(it=>[it,it===""]);else if(domTransforms.test(et)){if(delete c[et],is$1.und(lt))return;const it=pxTransforms.test(et)?"px":degTransforms.test(et)?"deg":"";nt.push(toArray$3(lt)),at.push(et==="rotate3d"?([st,ct,ft,pt])=>[`rotate3d(${st},${ct},${ft},${addUnit(pt,it)})`,isValueIdentity(pt,0)]:st=>[`${et}(${st.map(ct=>addUnit(ct,it)).join(",")})`,isValueIdentity(st,et.startsWith("scale")?1:0)])}}),nt.length&&(c.transform=new FluidTransform(nt,at)),super(c)}}class FluidTransform extends FluidValue{constructor(o,s){super(),this._value=null,this.inputs=o,this.transforms=s}get(){return this._value||(this._value=this._get())}_get(){let o="",s=!0;return each$1(this.inputs,(a,$)=>{const c=getFluidValue(a[0]),[nt,at]=this.transforms[$](is$1.arr(c)?c:a.map(getFluidValue));o+=" "+nt,s=s&&at}),s?"none":o}observerAdded(o){o==1&&each$1(this.inputs,s=>each$1(s,a=>hasFluidValue(a)&&addFluidObserver(a,this)))}observerRemoved(o){o==0&&each$1(this.inputs,s=>each$1(s,a=>hasFluidValue(a)&&removeFluidObserver(a,this)))}eventObserved(o){o.type=="change"&&(this._value=null),callFluidObservers(this,o)}}const primitives=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],_excluded$3=["scrollTop","scrollLeft"];globals.assign({batchedUpdates:reactDomExports.unstable_batchedUpdates,createStringInterpolator,colors});const host=createHost(primitives,{applyAnimatedValues,createAnimatedStyle:e=>new AnimatedStyle(e),getComponentProps:e=>_objectWithoutPropertiesLoose$1(e,_excluded$3)}),animated=host.animated;function resolveContainer(e){return(typeof e=="function"?e():e)||document.body}function renderToContainer(e,o){if(canUseDom&&e){const s=resolveContainer(e);return reactDomExports.createPortal(o,s)}return o}function useInitialized(e){const o=reactExports.useRef(e);return e&&(o.current=!0),!!o.current}const ShouldRender=e=>useShouldRender(e.active,e.forceRender,e.destroyOnClose)?e.children:null;function useShouldRender(e,o,s){const a=useInitialized(e);return o||e?!0:a?!s:!1}const eventToPropRecord={click:"onClick",touchstart:"onTouchStart"};function withStopPropagation(e,o){const s=Object.assign({},o.props);for(const a of e){const $=eventToPropRecord[a];s[$]=function(c){var nt,at;c.stopPropagation(),(at=(nt=o.props)[$])===null||at===void 0||at.call(nt,c)}}return t.cloneElement(o,s)}const classPrefix$1="adm-mask",opacityRecord={default:.55,thin:.35,thick:.75},colorRecord={black:"0, 0, 0",white:"255, 255, 255"},defaultProps$1={visible:!0,destroyOnClose:!1,forceRender:!1,color:"black",opacity:"default",disableBodyScroll:!0,getContainer:null,stopPropagation:["click"]},Mask=e=>{const o=mergeProps(defaultProps$1,e),{locale:s}=useConfig(),a=reactExports.useRef(null);useLockScroll(a,o.visible&&o.disableBodyScroll);const $=reactExports.useMemo(()=>{var it;const st=(it=opacityRecord[o.opacity])!==null&&it!==void 0?it:o.opacity,ct=colorRecord[o.color];return ct?`rgba(${ct}, ${st})`:o.color},[o.color,o.opacity]),[c,nt]=reactExports.useState(o.visible),at=useUnmountedRef(),{opacity:lt}=useSpring({opacity:o.visible?1:0,config:{precision:.01,mass:1,tension:250,friction:30,clamp:!0},onStart:()=>{nt(!0)},onRest:()=>{var it,st;at.current||(nt(o.visible),o.visible?(it=o.afterShow)===null||it===void 0||it.call(o):(st=o.afterClose)===null||st===void 0||st.call(o))}}),et=withStopPropagation(o.stopPropagation,withNativeProps(o,t.createElement(animated.div,{className:classPrefix$1,ref:a,"aria-hidden":!0,style:Object.assign(Object.assign({},o.style),{background:$,opacity:lt,display:c?void 0:"none"}),onClick:it=>{var st;it.target===it.currentTarget&&((st=o.onMaskClick)===null||st===void 0||st.call(o,it))}},o.onMaskClick&&t.createElement("div",{className:`${classPrefix$1}-aria-button`,role:"button","aria-label":s.Mask.name,onClick:o.onMaskClick}),t.createElement("div",{className:`${classPrefix$1}-content`},o.children))));return t.createElement(ShouldRender,{active:c,forceRender:o.forceRender,destroyOnClose:o.destroyOnClose},renderToContainer(o.getContainer,et))};function CloseOutline(e){return reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),reactExports.createElement("g",{id:"CloseOutline-CloseOutline",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},reactExports.createElement("g",{id:"CloseOutline-编组"},reactExports.createElement("rect",{id:"CloseOutline-矩形",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),reactExports.createElement("path",{d:"M10.6085104,8.11754663 L24.1768397,21.8195031 L24.1768397,21.8195031 L37.7443031,8.1175556 C37.8194278,8.04168616 37.9217669,7.999 38.0285372,7.999 L41.1040268,7.999 C41.3249407,7.999 41.5040268,8.1780861 41.5040268,8.399 C41.5040268,8.50440471 41.4624226,8.60554929 41.3882578,8.68044752 L26.2773302,23.9408235 L26.2773302,23.9408235 L41.5021975,39.3175645 C41.65763,39.4745475 41.6563731,39.7278104 41.4993901,39.8832429 C41.4244929,39.9574004 41.3233534,39.999 41.2179546,39.999 L38.1434012,39.999 C38.0366291,39.999 37.9342885,39.9563124 37.8591634,39.8804408 L24.1768397,26.0621438 L24.1768397,26.0621438 L10.4936501,39.8804497 C10.4185257,39.9563159 10.3161889,39.999 10.2094212,39.999 L7.13584526,39.999 C6.91493136,39.999 6.73584526,39.8199139 6.73584526,39.599 C6.73584526,39.4936017 6.77744443,39.3924627 6.85160121,39.3175656 L22.0763492,23.9408235 L22.0763492,23.9408235 L6.96554081,8.68044639 C6.81010226,8.52346929 6.81134951,8.27020637 6.9683266,8.11476782 C7.04322474,8.04060377 7.14436883,7.999 7.24977299,7.999 L10.3242852,7.999 C10.4310511,7.999 10.5333863,8.04168267 10.6085104,8.11754663 Z",id:"CloseOutline-路径",fill:"currentColor",fillRule:"nonzero"}))))}const defaultPopupBaseProps={closeOnMaskClick:!1,closeIcon:t.createElement(CloseOutline,null),destroyOnClose:!1,disableBodyScroll:!0,forceRender:!1,getContainer:()=>document.body,mask:!0,showCloseButton:!1,stopPropagation:["click"],visible:!1};function useInnerVisible(e){const[o,s]=reactExports.useState(e);return useIsomorphicLayoutEffect$1(()=>{s(e)},[e]),o}function clamp(e,o,s){return Math.max(o,Math.min(e,s))}const V={toVector(e,o){return e===void 0&&(e=o),Array.isArray(e)?e:[e,e]},add(e,o){return[e[0]+o[0],e[1]+o[1]]},sub(e,o){return[e[0]-o[0],e[1]-o[1]]},addTo(e,o){e[0]+=o[0],e[1]+=o[1]},subTo(e,o){e[0]-=o[0],e[1]-=o[1]}};function rubberband(e,o,s){return o===0||Math.abs(o)===1/0?Math.pow(e,s*5):e*o*s/(o+s*e)}function rubberbandIfOutOfBounds(e,o,s,a=.15){return a===0?clamp(e,o,s):e<o?-rubberband(o-e,s-o,a)+o:e>s?+rubberband(e-s,s-o,a)+s:e}function computeRubberband(e,[o,s],[a,$]){const[[c,nt],[at,lt]]=e;return[rubberbandIfOutOfBounds(o,c,nt,a),rubberbandIfOutOfBounds(s,at,lt,$)]}function _toPrimitive(e,o){if(typeof e!="object"||e===null)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var a=s.call(e,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}function _toPropertyKey(e){var o=_toPrimitive(e,"string");return typeof o=="symbol"?o:String(o)}function _defineProperty(e,o,s){return o=_toPropertyKey(o),o in e?Object.defineProperty(e,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[o]=s,e}function ownKeys(e,o){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);o&&(a=a.filter(function($){return Object.getOwnPropertyDescriptor(e,$).enumerable})),s.push.apply(s,a)}return s}function _objectSpread2(e){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?ownKeys(Object(s),!0).forEach(function(a){_defineProperty(e,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ownKeys(Object(s)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(s,a))})}return e}const EVENT_TYPE_MAP={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function capitalize(e){return e?e[0].toUpperCase()+e.slice(1):""}const actionsWithoutCaptureSupported=["enter","leave"];function hasCapture(e=!1,o){return e&&!actionsWithoutCaptureSupported.includes(o)}function toHandlerProp(e,o="",s=!1){const a=EVENT_TYPE_MAP[e],$=a&&a[o]||o;return"on"+capitalize(e)+capitalize($)+(hasCapture(s,$)?"Capture":"")}const pointerCaptureEvents=["gotpointercapture","lostpointercapture"];function parseProp(e){let o=e.substring(2).toLowerCase();const s=!!~o.indexOf("passive");s&&(o=o.replace("passive",""));const a=pointerCaptureEvents.includes(o)?"capturecapture":"capture",$=!!~o.indexOf(a);return $&&(o=o.replace("capture","")),{device:o,capture:$,passive:s}}function toDomEventType(e,o=""){const s=EVENT_TYPE_MAP[e],a=s&&s[o]||o;return e+a}function isTouch(e){return"touches"in e}function getPointerType(e){return isTouch(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function getCurrentTargetTouchList(e){return Array.from(e.touches).filter(o=>{var s,a;return o.target===e.currentTarget||((s=e.currentTarget)===null||s===void 0||(a=s.contains)===null||a===void 0?void 0:a.call(s,o.target))})}function getTouchList(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function getValueEvent(e){return isTouch(e)?getTouchList(e)[0]:e}function touchIds(e){return getCurrentTargetTouchList(e).map(o=>o.identifier)}function pointerId(e){const o=getValueEvent(e);return isTouch(e)?o.identifier:o.pointerId}function pointerValues(e){const o=getValueEvent(e);return[o.clientX,o.clientY]}function getEventDetails(e){const o={};if("buttons"in e&&(o.buttons=e.buttons),"shiftKey"in e){const{shiftKey:s,altKey:a,metaKey:$,ctrlKey:c}=e;Object.assign(o,{shiftKey:s,altKey:a,metaKey:$,ctrlKey:c})}return o}function call(e,...o){return typeof e=="function"?e(...o):e}function noop$2(){}function chain$1(...e){return e.length===0?noop$2:e.length===1?e[0]:function(){let o;for(const s of e)o=s.apply(this,arguments)||o;return o}}function assignDefault(e,o){return Object.assign({},o,e||{})}const BEFORE_LAST_KINEMATICS_DELAY=32;class Engine{constructor(o,s,a){this.ctrl=o,this.args=s,this.key=a,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(o){this.ctrl.state[this.key]=o}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:o,shared:s,ingKey:a,args:$}=this;s[a]=o._active=o.active=o._blocked=o._force=!1,o._step=[!1,!1],o.intentional=!1,o._movement=[0,0],o._distance=[0,0],o._direction=[0,0],o._delta=[0,0],o._bounds=[[-1/0,1/0],[-1/0,1/0]],o.args=$,o.axis=void 0,o.memo=void 0,o.elapsedTime=o.timeDelta=0,o.direction=[0,0],o.distance=[0,0],o.overflow=[0,0],o._movementBound=[!1,!1],o.velocity=[0,0],o.movement=[0,0],o.delta=[0,0],o.timeStamp=0}start(o){const s=this.state,a=this.config;s._active||(this.reset(),this.computeInitial(),s._active=!0,s.target=o.target,s.currentTarget=o.currentTarget,s.lastOffset=a.from?call(a.from,s):s.offset,s.offset=s.lastOffset,s.startTime=s.timeStamp=o.timeStamp)}computeValues(o){const s=this.state;s._values=o,s.values=this.config.transform(o)}computeInitial(){const o=this.state;o._initial=o._values,o.initial=o.values}compute(o){const{state:s,config:a,shared:$}=this;s.args=this.args;let c=0;if(o&&(s.event=o,a.preventDefault&&o.cancelable&&s.event.preventDefault(),s.type=o.type,$.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,$.locked=!!document.pointerLockElement,Object.assign($,getEventDetails(o)),$.down=$.pressed=$.buttons%2===1||$.touches>0,c=o.timeStamp-s.timeStamp,s.timeStamp=o.timeStamp,s.elapsedTime=s.timeStamp-s.startTime),s._active){const Lt=s._delta.map(Math.abs);V.addTo(s._distance,Lt)}this.axisIntent&&this.axisIntent(o);const[nt,at]=s._movement,[lt,et]=a.threshold,{_step:it,values:st}=s;if(a.hasCustomTransform?(it[0]===!1&&(it[0]=Math.abs(nt)>=lt&&st[0]),it[1]===!1&&(it[1]=Math.abs(at)>=et&&st[1])):(it[0]===!1&&(it[0]=Math.abs(nt)>=lt&&Math.sign(nt)*lt),it[1]===!1&&(it[1]=Math.abs(at)>=et&&Math.sign(at)*et)),s.intentional=it[0]!==!1||it[1]!==!1,!s.intentional)return;const ct=[0,0];if(a.hasCustomTransform){const[Lt,Ft]=st;ct[0]=it[0]!==!1?Lt-it[0]:0,ct[1]=it[1]!==!1?Ft-it[1]:0}else ct[0]=it[0]!==!1?nt-it[0]:0,ct[1]=it[1]!==!1?at-it[1]:0;this.restrictToAxis&&!s._blocked&&this.restrictToAxis(ct);const ft=s.offset,pt=s._active&&!s._blocked||s.active;pt&&(s.first=s._active&&!s.active,s.last=!s._active&&s.active,s.active=$[this.ingKey]=s._active,o&&(s.first&&("bounds"in a&&(s._bounds=call(a.bounds,s)),this.setup&&this.setup()),s.movement=ct,this.computeOffset()));const[gt,wt]=s.offset,[[vt,_t],[$t,Pt]]=s._bounds;s.overflow=[gt<vt?-1:gt>_t?1:0,wt<$t?-1:wt>Pt?1:0],s._movementBound[0]=s.overflow[0]?s._movementBound[0]===!1?s._movement[0]:s._movementBound[0]:!1,s._movementBound[1]=s.overflow[1]?s._movementBound[1]===!1?s._movement[1]:s._movementBound[1]:!1;const Nt=s._active?a.rubberband||[0,0]:[0,0];if(s.offset=computeRubberband(s._bounds,s.offset,Nt),s.delta=V.sub(s.offset,ft),this.computeMovement(),pt&&(!s.last||c>BEFORE_LAST_KINEMATICS_DELAY)){s.delta=V.sub(s.offset,ft);const Lt=s.delta.map(Math.abs);V.addTo(s.distance,Lt),s.direction=s.delta.map(Math.sign),s._direction=s._delta.map(Math.sign),!s.first&&c>0&&(s.velocity=[Lt[0]/c,Lt[1]/c],s.timeDelta=c)}}emit(){const o=this.state,s=this.shared,a=this.config;if(o._active||this.clean(),(o._blocked||!o.intentional)&&!o._force&&!a.triggerAllEvents)return;const $=this.handler(_objectSpread2(_objectSpread2(_objectSpread2({},s),o),{},{[this.aliasKey]:o.values}));$!==void 0&&(o.memo=$)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function selectAxis([e,o],s){const a=Math.abs(e),$=Math.abs(o);if(a>$&&a>s)return"x";if($>a&&$>s)return"y"}class CoordinatesEngine extends Engine{constructor(...o){super(...o),_defineProperty(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V.sub(this.state.offset,this.state.lastOffset)}axisIntent(o){const s=this.state,a=this.config;if(!s.axis&&o){const $=typeof a.axisThreshold=="object"?a.axisThreshold[getPointerType(o)]:a.axisThreshold;s.axis=selectAxis(s._movement,$)}s._blocked=(a.lockDirection||!!a.axis)&&!s.axis||!!a.axis&&a.axis!==s.axis}restrictToAxis(o){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":o[1]=0;break;case"y":o[0]=0;break}}}const identity$1=e=>e,DEFAULT_RUBBERBAND=.15,commonConfigResolver={enabled(e=!0){return e},eventOptions(e,o,s){return _objectSpread2(_objectSpread2({},s.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[DEFAULT_RUBBERBAND,DEFAULT_RUBBERBAND];case!1:return[0,0];default:return V.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return V.toVector(e)},transform(e,o,s){const a=e||s.shared.transform;return this.hasCustomTransform=!!a,a||identity$1},threshold(e){return V.toVector(e,0)}},DEFAULT_AXIS_THRESHOLD=0,coordinatesConfigResolver=_objectSpread2(_objectSpread2({},commonConfigResolver),{},{axis(e,o,{axis:s}){if(this.lockDirection=s==="lock",!this.lockDirection)return s},axisThreshold(e=DEFAULT_AXIS_THRESHOLD){return e},bounds(e={}){if(typeof e=="function")return c=>coordinatesConfigResolver.bounds(e(c));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:o=-1/0,right:s=1/0,top:a=-1/0,bottom:$=1/0}=e;return[[o,s],[a,$]]}}),KEYS_DELTA_MAP={ArrowRight:(e,o=1)=>[e*o,0],ArrowLeft:(e,o=1)=>[-1*e*o,0],ArrowUp:(e,o=1)=>[0,-1*e*o],ArrowDown:(e,o=1)=>[0,e*o]};class DragEngine extends CoordinatesEngine{constructor(...o){super(...o),_defineProperty(this,"ingKey","dragging")}reset(){super.reset();const o=this.state;o._pointerId=void 0,o._pointerActive=!1,o._keyboardActive=!1,o._preventScroll=!1,o._delayed=!1,o.swipe=[0,0],o.tap=!1,o.canceled=!1,o.cancel=this.cancel.bind(this)}setup(){const o=this.state;if(o._bounds instanceof HTMLElement){const s=o._bounds.getBoundingClientRect(),a=o.currentTarget.getBoundingClientRect(),$={left:s.left-a.left+o.offset[0],right:s.right-a.right+o.offset[0],top:s.top-a.top+o.offset[1],bottom:s.bottom-a.bottom+o.offset[1]};o._bounds=coordinatesConfigResolver.bounds($)}}cancel(){const o=this.state;o.canceled||(o.canceled=!0,o._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(o){const s=this.config,a=this.state;if(o.buttons!=null&&(Array.isArray(s.pointerButtons)?!s.pointerButtons.includes(o.buttons):s.pointerButtons!==-1&&s.pointerButtons!==o.buttons))return;const $=this.ctrl.setEventIds(o);s.pointerCapture&&o.target.setPointerCapture(o.pointerId),!($&&$.size>1&&a._pointerActive)&&(this.start(o),this.setupPointer(o),a._pointerId=pointerId(o),a._pointerActive=!0,this.computeValues(pointerValues(o)),this.computeInitial(),s.preventScrollAxis&&getPointerType(o)!=="mouse"?(a._active=!1,this.setupScrollPrevention(o)):s.delay>0?(this.setupDelayTrigger(o),s.triggerAllEvents&&(this.compute(o),this.emit())):this.startPointerDrag(o))}startPointerDrag(o){const s=this.state;s._active=!0,s._preventScroll=!0,s._delayed=!1,this.compute(o),this.emit()}pointerMove(o){const s=this.state,a=this.config;if(!s._pointerActive)return;const $=pointerId(o);if(s._pointerId!==void 0&&$!==s._pointerId)return;const c=pointerValues(o);if(document.pointerLockElement===o.target?s._delta=[o.movementX,o.movementY]:(s._delta=V.sub(c,s._values),this.computeValues(c)),V.addTo(s._movement,s._delta),this.compute(o),s._delayed&&s.intentional){this.timeoutStore.remove("dragDelay"),s.active=!1,this.startPointerDrag(o);return}if(a.preventScrollAxis&&!s._preventScroll)if(s.axis)if(s.axis===a.preventScrollAxis||a.preventScrollAxis==="xy"){s._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(o);return}else return;this.emit()}pointerUp(o){this.ctrl.setEventIds(o);try{this.config.pointerCapture&&o.target.hasPointerCapture(o.pointerId)&&o.target.releasePointerCapture(o.pointerId)}catch{}const s=this.state,a=this.config;if(!s._active||!s._pointerActive)return;const $=pointerId(o);if(s._pointerId!==void 0&&$!==s._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(o);const[c,nt]=s._distance;if(s.tap=c<=a.tapsThreshold&&nt<=a.tapsThreshold,s.tap&&a.filterTaps)s._force=!0;else{const[at,lt]=s._delta,[et,it]=s._movement,[st,ct]=a.swipe.velocity,[ft,pt]=a.swipe.distance,gt=a.swipe.duration;if(s.elapsedTime<gt){const wt=Math.abs(at/s.timeDelta),vt=Math.abs(lt/s.timeDelta);wt>st&&Math.abs(et)>ft&&(s.swipe[0]=Math.sign(at)),vt>ct&&Math.abs(it)>pt&&(s.swipe[1]=Math.sign(lt))}}this.emit()}pointerClick(o){!this.state.tap&&o.detail>0&&(o.preventDefault(),o.stopPropagation())}setupPointer(o){const s=this.config,a=s.device;s.pointerLock&&o.currentTarget.requestPointerLock(),s.pointerCapture||(this.eventStore.add(this.sharedConfig.window,a,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,a,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,a,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(o){this.state._preventScroll&&o.cancelable&&o.preventDefault()}setupScrollPrevention(o){this.state._preventScroll=!1,persistEvent(o);const s=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",s),this.eventStore.add(this.sharedConfig.window,"touch","cancel",s),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,o)}setupDelayTrigger(o){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(o)},this.config.delay)}keyDown(o){const s=KEYS_DELTA_MAP[o.key];if(s){const a=this.state,$=o.shiftKey?10:o.altKey?.1:1;this.start(o),a._delta=s(this.config.keyboardDisplacement,$),a._keyboardActive=!0,V.addTo(a._movement,a._delta),this.compute(o),this.emit()}}keyUp(o){o.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(o),this.emit())}bind(o){const s=this.config.device;o(s,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(o(s,"change",this.pointerMove.bind(this)),o(s,"end",this.pointerUp.bind(this)),o(s,"cancel",this.pointerUp.bind(this)),o("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(o("key","down",this.keyDown.bind(this)),o("key","up",this.keyUp.bind(this))),this.config.filterTaps&&o("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function persistEvent(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const isBrowser=typeof window<"u"&&window.document&&window.document.createElement;function supportsTouchEvents(){return isBrowser&&"ontouchstart"in window}function isTouchScreen(){return supportsTouchEvents()||isBrowser&&window.navigator.maxTouchPoints>1}function supportsPointerEvents(){return isBrowser&&"onpointerdown"in window}function supportsPointerLock(){return isBrowser&&"exitPointerLock"in window.document}function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch{return!1}}const SUPPORT={isBrowser,gesture:supportsGestureEvents(),touch:supportsTouchEvents(),touchscreen:isTouchScreen(),pointer:supportsPointerEvents(),pointerLock:supportsPointerLock()},DEFAULT_PREVENT_SCROLL_DELAY=250,DEFAULT_DRAG_DELAY=180,DEFAULT_SWIPE_VELOCITY=.5,DEFAULT_SWIPE_DISTANCE=50,DEFAULT_SWIPE_DURATION=250,DEFAULT_KEYBOARD_DISPLACEMENT=10,DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{device(e,o,{pointer:{touch:s=!1,lock:a=!1,mouse:$=!1}={}}){return this.pointerLock=a&&SUPPORT.pointerLock,SUPPORT.touch&&s?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!$?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(e,o,{preventScroll:s}){if(this.preventScrollDelay=typeof s=="number"?s:s||s===void 0&&e?DEFAULT_PREVENT_SCROLL_DELAY:void 0,!(!SUPPORT.touchscreen||s===!1))return e||(s!==void 0?"y":void 0)},pointerCapture(e,o,{pointer:{capture:s=!0,buttons:a=1,keys:$=!0}={}}){return this.pointerButtons=a,this.keys=$,!this.pointerLock&&this.device==="pointer"&&s},threshold(e,o,{filterTaps:s=!1,tapsThreshold:a=3,axis:$=void 0}){const c=V.toVector(e,s?a:$?1:0);return this.filterTaps=s,this.tapsThreshold=a,c},swipe({velocity:e=DEFAULT_SWIPE_VELOCITY,distance:o=DEFAULT_SWIPE_DISTANCE,duration:s=DEFAULT_SWIPE_DURATION}={}){return{velocity:this.transform(V.toVector(e)),distance:this.transform(V.toVector(o)),duration:s}},delay(e=0){switch(e){case!0:return DEFAULT_DRAG_DELAY;case!1:return 0;default:return e}},axisThreshold(e){return e?_objectSpread2(_objectSpread2({},DEFAULT_DRAG_AXIS_THRESHOLD),e):DEFAULT_DRAG_AXIS_THRESHOLD},keyboardDisplacement(e=DEFAULT_KEYBOARD_DISPLACEMENT){return e}});_objectSpread2(_objectSpread2({},commonConfigResolver),{},{device(e,o,{shared:s,pointer:{touch:a=!1}={}}){if(s.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&a)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(e,o,{scaleBounds:s={},angleBounds:a={}}){const $=nt=>{const at=assignDefault(call(s,nt),{min:-1/0,max:1/0});return[at.min,at.max]},c=nt=>{const at=assignDefault(call(a,nt),{min:-1/0,max:1/0});return[at.min,at.max]};return typeof s!="function"&&typeof a!="function"?[$(),c()]:nt=>[$(nt),c(nt)]},threshold(e,o,s){return this.lockDirection=s.axis==="lock",V.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(e=!0)=>e});_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(e=!0)=>e});const EngineMap=new Map,ConfigResolverMap=new Map;function registerAction(e){EngineMap.set(e.key,e.engine),ConfigResolverMap.set(e.key,e.resolver)}const dragAction={key:"drag",engine:DragEngine,resolver:dragConfigResolver};function _objectWithoutPropertiesLoose(e,o){if(e==null)return{};var s={},a=Object.keys(e),$,c;for(c=0;c<a.length;c++)$=a[c],!(o.indexOf($)>=0)&&(s[$]=e[$]);return s}function _objectWithoutProperties(e,o){if(e==null)return{};var s=_objectWithoutPropertiesLoose(e,o),a,$;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for($=0;$<c.length;$++)a=c[$],!(o.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(s[a]=e[a])}return s}const sharedConfigResolver={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=SUPPORT.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:o=!1}={}){return{passive:e,capture:o}},transform(e){return e}},_excluded=["target","eventOptions","window","enabled","transform"];function resolveWith(e={},o){const s={};for(const[a,$]of Object.entries(o))switch(typeof $){case"function":s[a]=$.call(s,e[a],a,e);break;case"object":s[a]=resolveWith(e[a],$);break;case"boolean":$&&(s[a]=e[a]);break}return s}function parse(e,o,s={}){const a=e,{target:$,eventOptions:c,window:nt,enabled:at,transform:lt}=a,et=_objectWithoutProperties(a,_excluded);if(s.shared=resolveWith({target:$,eventOptions:c,window:nt,enabled:at,transform:lt},sharedConfigResolver),o){const it=ConfigResolverMap.get(o);s[o]=resolveWith(_objectSpread2({shared:s.shared},et),it)}else for(const it in et){const st=ConfigResolverMap.get(it);st&&(s[it]=resolveWith(_objectSpread2({shared:s.shared},et[it]),st))}return s}class EventStore{constructor(o,s){_defineProperty(this,"_listeners",new Set),this._ctrl=o,this._gestureKey=s}add(o,s,a,$,c){const nt=this._listeners,at=toDomEventType(s,a),lt=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},et=_objectSpread2(_objectSpread2({},lt),c);o.addEventListener(at,$,et);const it=()=>{o.removeEventListener(at,$,et),nt.delete(it)};return nt.add(it),it}clean(){this._listeners.forEach(o=>o()),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty(this,"_timeouts",new Map)}add(o,s,a=140,...$){this.remove(o),this._timeouts.set(o,window.setTimeout(s,a,...$))}remove(o){const s=this._timeouts.get(o);s&&window.clearTimeout(s)}clean(){this._timeouts.forEach(o=>void window.clearTimeout(o)),this._timeouts.clear()}}class Controller{constructor(o){_defineProperty(this,"gestures",new Set),_defineProperty(this,"_targetEventStore",new EventStore(this)),_defineProperty(this,"gestureEventStores",{}),_defineProperty(this,"gestureTimeoutStores",{}),_defineProperty(this,"handlers",{}),_defineProperty(this,"config",{}),_defineProperty(this,"pointerIds",new Set),_defineProperty(this,"touchIds",new Set),_defineProperty(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),resolveGestures(this,o)}setEventIds(o){if(isTouch(o))return this.touchIds=new Set(touchIds(o)),this.touchIds;if("pointerId"in o)return o.type==="pointerup"||o.type==="pointercancel"?this.pointerIds.delete(o.pointerId):o.type==="pointerdown"&&this.pointerIds.add(o.pointerId),this.pointerIds}applyHandlers(o,s){this.handlers=o,this.nativeHandlers=s}applyConfig(o,s){this.config=parse(o,s,this.config)}clean(){this._targetEventStore.clean();for(const o of this.gestures)this.gestureEventStores[o].clean(),this.gestureTimeoutStores[o].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...o){const s=this.config.shared,a={};let $;if(!(s.target&&($=s.target(),!$))){if(s.enabled){for(const nt of this.gestures){const at=this.config[nt],lt=bindToProps(a,at.eventOptions,!!$);if(at.enabled){const et=EngineMap.get(nt);new et(this,o,nt).bind(lt)}}const c=bindToProps(a,s.eventOptions,!!$);for(const nt in this.nativeHandlers)c(nt,"",at=>this.nativeHandlers[nt](_objectSpread2(_objectSpread2({},this.state.shared),{},{event:at,args:o})),void 0,!0)}for(const c in a)a[c]=chain$1(...a[c]);if(!$)return a;for(const c in a){const{device:nt,capture:at,passive:lt}=parseProp(c);this._targetEventStore.add($,nt,"",a[c],{capture:at,passive:lt})}}}}function setupGesture(e,o){e.gestures.add(o),e.gestureEventStores[o]=new EventStore(e,o),e.gestureTimeoutStores[o]=new TimeoutStore}function resolveGestures(e,o){o.drag&&setupGesture(e,"drag"),o.wheel&&setupGesture(e,"wheel"),o.scroll&&setupGesture(e,"scroll"),o.move&&setupGesture(e,"move"),o.pinch&&setupGesture(e,"pinch"),o.hover&&setupGesture(e,"hover")}const bindToProps=(e,o,s)=>(a,$,c,nt={},at=!1)=>{var lt,et;const it=(lt=nt.capture)!==null&&lt!==void 0?lt:o.capture,st=(et=nt.passive)!==null&&et!==void 0?et:o.passive;let ct=at?a:toHandlerProp(a,$,it);s&&st&&(ct+="Passive"),e[ct]=e[ct]||[],e[ct].push(c)};function useRecognizers(e,o={},s,a){const $=t.useMemo(()=>new Controller(e),[]);if($.applyHandlers(e,a),$.applyConfig(o,s),t.useEffect($.effect.bind($)),t.useEffect(()=>$.clean.bind($),[]),o.target===void 0)return $.bind.bind($)}function useDrag(e,o){return registerAction(dragAction),useRecognizers({drag:e},o||{},"drag")}const classPrefix="adm-popup",defaultProps=Object.assign(Object.assign({},defaultPopupBaseProps),{closeOnSwipe:!1,position:"bottom"}),Popup=e=>{const{locale:o,popup:s={}}=useConfig(),a=mergeProps(defaultProps,s,e),$=classNames(`${classPrefix}-body`,a.bodyClassName,`${classPrefix}-body-position-${a.position}`),[c,nt]=reactExports.useState(a.visible),at=reactExports.useRef(null);useLockScroll(at,a.disableBodyScroll&&c?"strict":!1),useIsomorphicLayoutEffect$1(()=>{a.visible&&nt(!0)},[a.visible]);const lt=useUnmountedRef(),{percent:et}=useSpring({percent:a.visible?0:100,config:{precision:.1,mass:.4,tension:300,friction:30},onRest:()=>{var ft,pt;lt.current||(nt(a.visible),a.visible?(ft=a.afterShow)===null||ft===void 0||ft.call(a):(pt=a.afterClose)===null||pt===void 0||pt.call(a))}}),it=useDrag(({swipe:[,ft]})=>{var pt;a.closeOnSwipe&&(ft===1&&a.position==="bottom"||ft===-1&&a.position==="top")&&((pt=a.onClose)===null||pt===void 0||pt.call(a))},{axis:"y",enabled:["top","bottom"].includes(a.position)}),st=useInnerVisible(c&&a.visible),ct=withStopPropagation(a.stopPropagation,withNativeProps(a,t.createElement("div",Object.assign({className:classPrefix,onClick:a.onClick,style:{display:c?void 0:"none",touchAction:["top","bottom"].includes(a.position)?"none":"auto"}},it()),a.mask&&t.createElement(Mask,{visible:st,forceRender:a.forceRender,destroyOnClose:a.destroyOnClose,onMaskClick:ft=>{var pt,gt;(pt=a.onMaskClick)===null||pt===void 0||pt.call(a,ft),a.closeOnMaskClick&&((gt=a.onClose)===null||gt===void 0||gt.call(a))},className:a.maskClassName,style:a.maskStyle,disableBodyScroll:!1,stopPropagation:a.stopPropagation}),t.createElement(animated.div,{className:$,style:Object.assign(Object.assign({},a.bodyStyle),{pointerEvents:et.to(ft=>ft===0?"unset":"none"),transform:et.to(ft=>a.position==="bottom"?`translate(0, ${ft}%)`:a.position==="top"?`translate(0, -${ft}%)`:a.position==="left"?`translate(-${ft}%, 0)`:a.position==="right"?`translate(${ft}%, 0)`:"none")}),ref:at},a.showCloseButton&&t.createElement("a",{className:classNames(`${classPrefix}-close-icon`,"adm-plain-anchor"),onClick:()=>{var ft;(ft=a.onClose)===null||ft===void 0||ft.call(a)},role:"button","aria-label":o.common.close},a.closeIcon),a.children))));return t.createElement(ShouldRender,{active:c,forceRender:a.forceRender,destroyOnClose:a.destroyOnClose},renderToContainer(a.getContainer,ct))};function bind$1(e,o){return function(){return e.apply(o,arguments)}}const{toString:toString$3}=Object.prototype,{getPrototypeOf}=Object,kindOf=(e=>o=>{const s=toString$3.call(o);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),o=>kindOf(o)===e),typeOfTest=e=>o=>typeof o===e,{isArray:isArray$2}=Array,isUndefined$2=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined$2(e)&&e.constructor!==null&&!isUndefined$2(e.constructor)&&isFunction$3(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer$1=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let o;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?o=ArrayBuffer.isView(e):o=e&&e.buffer&&isArrayBuffer$1(e.buffer),o}const isString$2=typeOfTest("string"),isFunction$3=typeOfTest("function"),isNumber$2=typeOfTest("number"),isObject$2=e=>e!==null&&typeof e=="object",isBoolean$1=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const o=getPrototypeOf(e);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},isDate$2=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject$2(e)&&isFunction$3(e.pipe),isFormData=e=>{let o;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction$3(e.append)&&((o=kindOf(e))==="formdata"||o==="object"&&isFunction$3(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,o,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let a,$;if(typeof e!="object"&&(e=[e]),isArray$2(e))for(a=0,$=e.length;a<$;a++)o.call(null,e[a],a,e);else{const c=s?Object.getOwnPropertyNames(e):Object.keys(e),nt=c.length;let at;for(a=0;a<nt;a++)at=c[a],o.call(null,e[at],at,e)}}function findKey$1(e,o){o=o.toLowerCase();const s=Object.keys(e);let a=s.length,$;for(;a-- >0;)if($=s[a],o===$.toLowerCase())return $;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=e=>!isUndefined$2(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},o={},s=(a,$)=>{const c=e&&findKey$1(o,$)||$;isPlainObject(o[c])&&isPlainObject(a)?o[c]=merge(o[c],a):isPlainObject(a)?o[c]=merge({},a):isArray$2(a)?o[c]=a.slice():o[c]=a};for(let a=0,$=arguments.length;a<$;a++)arguments[a]&&forEach(arguments[a],s);return o}const extend$2=(e,o,s,{allOwnKeys:a}={})=>(forEach(o,($,c)=>{s&&isFunction$3($)?e[c]=bind$1($,s):e[c]=$},{allOwnKeys:a}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,o,s,a)=>{e.prototype=Object.create(o.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:o.prototype}),s&&Object.assign(e.prototype,s)},toFlatObject=(e,o,s,a)=>{let $,c,nt;const at={};if(o=o||{},e==null)return o;do{for($=Object.getOwnPropertyNames(e),c=$.length;c-- >0;)nt=$[c],(!a||a(nt,e,o))&&!at[nt]&&(o[nt]=e[nt],at[nt]=!0);e=s!==!1&&getPrototypeOf(e)}while(e&&(!s||s(e,o))&&e!==Object.prototype);return o},endsWith=(e,o,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=o.length;const a=e.indexOf(o,s);return a!==-1&&a===s},toArray$2=e=>{if(!e)return null;if(isArray$2(e))return e;let o=e.length;if(!isNumber$2(o))return null;const s=new Array(o);for(;o-- >0;)s[o]=e[o];return s},isTypedArray$2=(e=>o=>e&&o instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,o)=>{const a=(e&&e[Symbol.iterator]).call(e);let $;for(;($=a.next())&&!$.done;){const c=$.value;o.call(e,c[0],c[1])}},matchAll=(e,o)=>{let s;const a=[];for(;(s=e.exec(o))!==null;)a.push(s);return a},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,a,$){return a.toUpperCase()+$}),hasOwnProperty$2=(({hasOwnProperty:e})=>(o,s)=>e.call(o,s))(Object.prototype),isRegExp$1=kindOfTest("RegExp"),reduceDescriptors=(e,o)=>{const s=Object.getOwnPropertyDescriptors(e),a={};forEach(s,($,c)=>{let nt;(nt=o($,c,e))!==!1&&(a[c]=nt||$)}),Object.defineProperties(e,a)},freezeMethods=e=>{reduceDescriptors(e,(o,s)=>{if(isFunction$3(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const a=e[s];if(isFunction$3(a)){if(o.enumerable=!1,"writable"in o){o.writable=!1;return}o.set||(o.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},toObjectSet=(e,o)=>{const s={},a=$=>{$.forEach(c=>{s[c]=!0})};return isArray$2(e)?a(e):a(String(e).split(o)),s},noop$1=()=>{},toFiniteNumber=(e,o)=>e!=null&&Number.isFinite(e=+e)?e:o,ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(e=16,o=ALPHABET.ALPHA_DIGIT)=>{let s="";const{length:a}=o;for(;e--;)s+=o[Math.random()*a|0];return s};function isSpecCompliantForm(e){return!!(e&&isFunction$3(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const toJSONObject=e=>{const o=new Array(10),s=(a,$)=>{if(isObject$2(a)){if(o.indexOf(a)>=0)return;if(!("toJSON"in a)){o[$]=a;const c=isArray$2(a)?[]:{};return forEach(a,(nt,at)=>{const lt=s(nt,$+1);!isUndefined$2(lt)&&(c[at]=lt)}),o[$]=void 0,c}}return a};return s(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject$2(e)||isFunction$3(e))&&isFunction$3(e.then)&&isFunction$3(e.catch),_setImmediate=((e,o)=>e?setImmediate:o?((s,a)=>(_global.addEventListener("message",({source:$,data:c})=>{$===_global&&c===s&&a.length&&a.shift()()},!1),$=>{a.push($),_global.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",isFunction$3(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,utils$1={isArray:isArray$2,isArrayBuffer:isArrayBuffer$1,isBuffer,isFormData,isArrayBufferView,isString:isString$2,isNumber:isNumber$2,isBoolean:isBoolean$1,isObject:isObject$2,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined:isUndefined$2,isDate:isDate$2,isFile,isBlob,isRegExp:isRegExp$1,isFunction:isFunction$3,isStream,isURLSearchParams,isTypedArray:isTypedArray$2,isFileList,forEach,merge,extend:extend$2,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray:toArray$2,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$2,hasOwnProp:hasOwnProperty$2,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap};function AxiosError(e,o,s,a,$){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",o&&(this.code=o),s&&(this.config=s),a&&(this.request=a),$&&(this.response=$,this.status=$.status?$.status:null)}utils$1.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(e,o,s,a,$,c)=>{const nt=Object.create(prototype$1);return utils$1.toFlatObject(e,nt,function(lt){return lt!==Error.prototype},at=>at!=="isAxiosError"),AxiosError.call(nt,e.message,o,s,a,$),nt.cause=e,nt.name=e.name,c&&Object.assign(nt,c),nt};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,o,s){return e?e.concat(o).map(function($,c){return $=removeBrackets($),!s&&c?"["+$+"]":$}).join(s?".":""):o}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(o){return/^is[A-Z]/.test(o)});function toFormData(e,o,s){if(!utils$1.isObject(e))throw new TypeError("target must be an object");o=o||new FormData,s=utils$1.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(gt,wt){return!utils$1.isUndefined(wt[gt])});const a=s.metaTokens,$=s.visitor||it,c=s.dots,nt=s.indexes,lt=(s.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(o);if(!utils$1.isFunction($))throw new TypeError("visitor must be a function");function et(pt){if(pt===null)return"";if(utils$1.isDate(pt))return pt.toISOString();if(!lt&&utils$1.isBlob(pt))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(pt)||utils$1.isTypedArray(pt)?lt&&typeof Blob=="function"?new Blob([pt]):Buffer.from(pt):pt}function it(pt,gt,wt){let vt=pt;if(pt&&!wt&&typeof pt=="object"){if(utils$1.endsWith(gt,"{}"))gt=a?gt:gt.slice(0,-2),pt=JSON.stringify(pt);else if(utils$1.isArray(pt)&&isFlatArray(pt)||(utils$1.isFileList(pt)||utils$1.endsWith(gt,"[]"))&&(vt=utils$1.toArray(pt)))return gt=removeBrackets(gt),vt.forEach(function($t,Pt){!(utils$1.isUndefined($t)||$t===null)&&o.append(nt===!0?renderKey([gt],Pt,c):nt===null?gt:gt+"[]",et($t))}),!1}return isVisitable(pt)?!0:(o.append(renderKey(wt,gt,c),et(pt)),!1)}const st=[],ct=Object.assign(predicates,{defaultVisitor:it,convertValue:et,isVisitable});function ft(pt,gt){if(!utils$1.isUndefined(pt)){if(st.indexOf(pt)!==-1)throw Error("Circular reference detected in "+gt.join("."));st.push(pt),utils$1.forEach(pt,function(vt,_t){(!(utils$1.isUndefined(vt)||vt===null)&&$.call(o,vt,utils$1.isString(_t)?_t.trim():_t,gt,ct))===!0&&ft(vt,gt?gt.concat(_t):[_t])}),st.pop()}}if(!utils$1.isObject(e))throw new TypeError("data must be an object");return ft(e),o}function encode$2(e){const o={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return o[a]})}function AxiosURLSearchParams(e,o){this._pairs=[],e&&toFormData(e,this,o)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(o,s){this._pairs.push([o,s])};prototype.toString=function(o){const s=o?function(a){return o.call(this,a,encode$2)}:encode$2;return this._pairs.map(function($){return s($[0])+"="+s($[1])},"").join("&")};function encode$1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,o,s){if(!o)return e;const a=s&&s.encode||encode$1,$=s&&s.serialize;let c;if($?c=$(o,s):c=utils$1.isURLSearchParams(o)?o.toString():new AxiosURLSearchParams(o,s).toString(a),c){const nt=e.indexOf("#");nt!==-1&&(e=e.slice(0,nt)),e+=(e.indexOf("?")===-1?"?":"&")+c}return e}class InterceptorManager{constructor(){this.handlers=[]}use(o,s,a){return this.handlers.push({fulfilled:o,rejected:s,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(o){this.handlers[o]&&(this.handlers[o]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(o){utils$1.forEach(this.handlers,function(a){a!==null&&o(a)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,o){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(s,a,$,c){return platform.isNode&&utils$1.isBuffer(s)?(this.append(a,s.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)}},o))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map(o=>o[0]==="[]"?"":o[1]||o[0])}function arrayToObject(e){const o={},s=Object.keys(e);let a;const $=s.length;let c;for(a=0;a<$;a++)c=s[a],o[c]=e[c];return o}function formDataToJSON(e){function o(s,a,$,c){let nt=s[c++];if(nt==="__proto__")return!0;const at=Number.isFinite(+nt),lt=c>=s.length;return nt=!nt&&utils$1.isArray($)?$.length:nt,lt?(utils$1.hasOwnProp($,nt)?$[nt]=[$[nt],a]:$[nt]=a,!at):((!$[nt]||!utils$1.isObject($[nt]))&&($[nt]=[]),o(s,a,$[nt],c)&&utils$1.isArray($[nt])&&($[nt]=arrayToObject($[nt])),!at)}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const s={};return utils$1.forEachEntry(e,(a,$)=>{o(parsePropPath(a),$,s,0)}),s}return null}function stringifySafely(e,o,s){if(utils$1.isString(e))try{return(o||JSON.parse)(e),utils$1.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(0,JSON.stringify)(e)}const defaults$2={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const a=s.getContentType()||"",$=a.indexOf("application/json")>-1,c=utils$1.isObject(o);if(c&&utils$1.isHTMLForm(o)&&(o=new FormData(o)),utils$1.isFormData(o))return $?JSON.stringify(formDataToJSON(o)):o;if(utils$1.isArrayBuffer(o)||utils$1.isBuffer(o)||utils$1.isStream(o)||utils$1.isFile(o)||utils$1.isBlob(o)||utils$1.isReadableStream(o))return o;if(utils$1.isArrayBufferView(o))return o.buffer;if(utils$1.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let at;if(c){if(a.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(o,this.formSerializer).toString();if((at=utils$1.isFileList(o))||a.indexOf("multipart/form-data")>-1){const lt=this.env&&this.env.FormData;return toFormData(at?{"files[]":o}:o,lt&&new lt,this.formSerializer)}}return c||$?(s.setContentType("application/json",!1),stringifySafely(o)):o}],transformResponse:[function(o){const s=this.transitional||defaults$2.transitional,a=s&&s.forcedJSONParsing,$=this.responseType==="json";if(utils$1.isResponse(o)||utils$1.isReadableStream(o))return o;if(o&&utils$1.isString(o)&&(a&&!this.responseType||$)){const nt=!(s&&s.silentJSONParsing)&&$;try{return JSON.parse(o)}catch(at){if(nt)throw at.name==="SyntaxError"?AxiosError.from(at,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):at}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],e=>{defaults$2.headers[e]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const o={};let s,a,$;return e&&e.split(`
`).forEach(function(nt){$=nt.indexOf(":"),s=nt.substring(0,$).trim().toLowerCase(),a=nt.substring($+1).trim(),!(!s||o[s]&&ignoreDuplicateOf[s])&&(s==="set-cookie"?o[s]?o[s].push(a):o[s]=[a]:o[s]=o[s]?o[s]+", "+a:a)}),o},$internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){const o=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=s.exec(e);)o[a[1]]=a[2];return o}const isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,o,s,a,$){if(utils$1.isFunction(a))return a.call(this,o,s);if($&&(o=s),!!utils$1.isString(o)){if(utils$1.isString(a))return o.indexOf(a)!==-1;if(utils$1.isRegExp(a))return a.test(o)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(o,s,a)=>s.toUpperCase()+a)}function buildAccessors(e,o){const s=utils$1.toCamelCase(" "+o);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+s,{value:function($,c,nt){return this[a].call(this,o,$,c,nt)},configurable:!0})})}class AxiosHeaders{constructor(o){o&&this.set(o)}set(o,s,a){const $=this;function c(at,lt,et){const it=normalizeHeader(lt);if(!it)throw new Error("header name must be a non-empty string");const st=utils$1.findKey($,it);(!st||$[st]===void 0||et===!0||et===void 0&&$[st]!==!1)&&($[st||lt]=normalizeValue(at))}const nt=(at,lt)=>utils$1.forEach(at,(et,it)=>c(et,it,lt));if(utils$1.isPlainObject(o)||o instanceof this.constructor)nt(o,s);else if(utils$1.isString(o)&&(o=o.trim())&&!isValidHeaderName(o))nt(parseHeaders(o),s);else if(utils$1.isHeaders(o))for(const[at,lt]of o.entries())c(lt,at,a);else o!=null&&c(s,o,a);return this}get(o,s){if(o=normalizeHeader(o),o){const a=utils$1.findKey(this,o);if(a){const $=this[a];if(!s)return $;if(s===!0)return parseTokens($);if(utils$1.isFunction(s))return s.call(this,$,a);if(utils$1.isRegExp(s))return s.exec($);throw new TypeError("parser must be boolean|regexp|function")}}}has(o,s){if(o=normalizeHeader(o),o){const a=utils$1.findKey(this,o);return!!(a&&this[a]!==void 0&&(!s||matchHeaderValue(this,this[a],a,s)))}return!1}delete(o,s){const a=this;let $=!1;function c(nt){if(nt=normalizeHeader(nt),nt){const at=utils$1.findKey(a,nt);at&&(!s||matchHeaderValue(a,a[at],at,s))&&(delete a[at],$=!0)}}return utils$1.isArray(o)?o.forEach(c):c(o),$}clear(o){const s=Object.keys(this);let a=s.length,$=!1;for(;a--;){const c=s[a];(!o||matchHeaderValue(this,this[c],c,o,!0))&&(delete this[c],$=!0)}return $}normalize(o){const s=this,a={};return utils$1.forEach(this,($,c)=>{const nt=utils$1.findKey(a,c);if(nt){s[nt]=normalizeValue($),delete s[c];return}const at=o?formatHeader(c):String(c).trim();at!==c&&delete s[c],s[at]=normalizeValue($),a[at]=!0}),this}concat(...o){return this.constructor.concat(this,...o)}toJSON(o){const s=Object.create(null);return utils$1.forEach(this,(a,$)=>{a!=null&&a!==!1&&(s[$]=o&&utils$1.isArray(a)?a.join(", "):a)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([o,s])=>o+": "+s).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(o){return o instanceof this?o:new this(o)}static concat(o,...s){const a=new this(o);return s.forEach($=>a.set($)),a}static accessor(o){const a=(this[$internals]=this[$internals]={accessors:{}}).accessors,$=this.prototype;function c(nt){const at=normalizeHeader(nt);a[at]||(buildAccessors($,nt),a[at]=!0)}return utils$1.isArray(o)?o.forEach(c):c(o),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:e},o)=>{let s=o[0].toUpperCase()+o.slice(1);return{get:()=>e,set(a){this[s]=a}}});utils$1.freezeMethods(AxiosHeaders);function transformData(e,o){const s=this||defaults$2,a=o||s,$=AxiosHeaders.from(a.headers);let c=a.data;return utils$1.forEach(e,function(at){c=at.call(s,c,$.normalize(),o?o.status:void 0)}),$.normalize(),c}function isCancel(e){return!!(e&&e.__CANCEL__)}function CanceledError(e,o,s){AxiosError.call(this,e??"canceled",AxiosError.ERR_CANCELED,o,s),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(e,o,s){const a=s.config.validateStatus;!s.status||!a||a(s.status)?e(s):o(new AxiosError("Request failed with status code "+s.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function parseProtocol(e){const o=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return o&&o[1]||""}function speedometer(e,o){e=e||10;const s=new Array(e),a=new Array(e);let $=0,c=0,nt;return o=o!==void 0?o:1e3,function(lt){const et=Date.now(),it=a[c];nt||(nt=et),s[$]=lt,a[$]=et;let st=c,ct=0;for(;st!==$;)ct+=s[st++],st=st%e;if($=($+1)%e,$===c&&(c=(c+1)%e),et-nt<o)return;const ft=it&&et-it;return ft?Math.round(ct*1e3/ft):void 0}}function throttle$2(e,o){let s=0,a=1e3/o,$,c;const nt=(et,it=Date.now())=>{s=it,$=null,c&&(clearTimeout(c),c=null),e.apply(null,et)};return[(...et)=>{const it=Date.now(),st=it-s;st>=a?nt(et,it):($=et,c||(c=setTimeout(()=>{c=null,nt($)},a-st)))},()=>$&&nt($)]}const progressEventReducer=(e,o,s=3)=>{let a=0;const $=speedometer(50,250);return throttle$2(c=>{const nt=c.loaded,at=c.lengthComputable?c.total:void 0,lt=nt-a,et=$(lt),it=nt<=at;a=nt;const st={loaded:nt,total:at,progress:at?nt/at:void 0,bytes:lt,rate:et||void 0,estimated:et&&at&&it?(at-nt)/et:void 0,event:c,lengthComputable:at!=null,[o?"download":"upload"]:!0};e(st)},s)},progressEventDecorator=(e,o)=>{const s=e!=null;return[a=>o[0]({lengthComputable:s,total:e,loaded:a}),o[1]]},asyncDecorator=e=>(...o)=>utils$1.asap(()=>e(...o)),isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const o=platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent),s=document.createElement("a");let a;function $(c){let nt=c;return o&&(s.setAttribute("href",nt),nt=s.href),s.setAttribute("href",nt),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return a=$(window.location.href),function(nt){const at=utils$1.isString(nt)?$(nt):nt;return at.protocol===a.protocol&&at.host===a.host}}():function(){return function(){return!0}}(),cookies=platform.hasStandardBrowserEnv?{write(e,o,s,a,$,c){const nt=[e+"="+encodeURIComponent(o)];utils$1.isNumber(s)&&nt.push("expires="+new Date(s).toGMTString()),utils$1.isString(a)&&nt.push("path="+a),utils$1.isString($)&&nt.push("domain="+$),c===!0&&nt.push("secure"),document.cookie=nt.join("; ")},read(e){const o=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,o){return o?e.replace(/\/?\/$/,"")+"/"+o.replace(/^\/+/,""):e}function buildFullPath(e,o){return e&&!isAbsoluteURL(o)?combineURLs(e,o):o}const headersToObject=e=>e instanceof AxiosHeaders?{...e}:e;function mergeConfig(e,o){o=o||{};const s={};function a(et,it,st){return utils$1.isPlainObject(et)&&utils$1.isPlainObject(it)?utils$1.merge.call({caseless:st},et,it):utils$1.isPlainObject(it)?utils$1.merge({},it):utils$1.isArray(it)?it.slice():it}function $(et,it,st){if(utils$1.isUndefined(it)){if(!utils$1.isUndefined(et))return a(void 0,et,st)}else return a(et,it,st)}function c(et,it){if(!utils$1.isUndefined(it))return a(void 0,it)}function nt(et,it){if(utils$1.isUndefined(it)){if(!utils$1.isUndefined(et))return a(void 0,et)}else return a(void 0,it)}function at(et,it,st){if(st in o)return a(et,it);if(st in e)return a(void 0,et)}const lt={url:c,method:c,data:c,baseURL:nt,transformRequest:nt,transformResponse:nt,paramsSerializer:nt,timeout:nt,timeoutMessage:nt,withCredentials:nt,withXSRFToken:nt,adapter:nt,responseType:nt,xsrfCookieName:nt,xsrfHeaderName:nt,onUploadProgress:nt,onDownloadProgress:nt,decompress:nt,maxContentLength:nt,maxBodyLength:nt,beforeRedirect:nt,transport:nt,httpAgent:nt,httpsAgent:nt,cancelToken:nt,socketPath:nt,responseEncoding:nt,validateStatus:at,headers:(et,it)=>$(headersToObject(et),headersToObject(it),!0)};return utils$1.forEach(Object.keys(Object.assign({},e,o)),function(it){const st=lt[it]||$,ct=st(e[it],o[it],it);utils$1.isUndefined(ct)&&st!==at||(s[it]=ct)}),s}const resolveConfig=e=>{const o=mergeConfig({},e);let{data:s,withXSRFToken:a,xsrfHeaderName:$,xsrfCookieName:c,headers:nt,auth:at}=o;o.headers=nt=AxiosHeaders.from(nt),o.url=buildURL(buildFullPath(o.baseURL,o.url),e.params,e.paramsSerializer),at&&nt.set("Authorization","Basic "+btoa((at.username||"")+":"+(at.password?unescape(encodeURIComponent(at.password)):"")));let lt;if(utils$1.isFormData(s)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)nt.setContentType(void 0);else if((lt=nt.getContentType())!==!1){const[et,...it]=lt?lt.split(";").map(st=>st.trim()).filter(Boolean):[];nt.setContentType([et||"multipart/form-data",...it].join("; "))}}if(platform.hasStandardBrowserEnv&&(a&&utils$1.isFunction(a)&&(a=a(o)),a||a!==!1&&isURLSameOrigin(o.url))){const et=$&&c&&cookies.read(c);et&&nt.set($,et)}return o},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(s,a){const $=resolveConfig(e);let c=$.data;const nt=AxiosHeaders.from($.headers).normalize();let{responseType:at,onUploadProgress:lt,onDownloadProgress:et}=$,it,st,ct,ft,pt;function gt(){ft&&ft(),pt&&pt(),$.cancelToken&&$.cancelToken.unsubscribe(it),$.signal&&$.signal.removeEventListener("abort",it)}let wt=new XMLHttpRequest;wt.open($.method.toUpperCase(),$.url,!0),wt.timeout=$.timeout;function vt(){if(!wt)return;const $t=AxiosHeaders.from("getAllResponseHeaders"in wt&&wt.getAllResponseHeaders()),Nt={data:!at||at==="text"||at==="json"?wt.responseText:wt.response,status:wt.status,statusText:wt.statusText,headers:$t,config:e,request:wt};settle(function(Ft){s(Ft),gt()},function(Ft){a(Ft),gt()},Nt),wt=null}"onloadend"in wt?wt.onloadend=vt:wt.onreadystatechange=function(){!wt||wt.readyState!==4||wt.status===0&&!(wt.responseURL&&wt.responseURL.indexOf("file:")===0)||setTimeout(vt)},wt.onabort=function(){wt&&(a(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,wt)),wt=null)},wt.onerror=function(){a(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,wt)),wt=null},wt.ontimeout=function(){let Pt=$.timeout?"timeout of "+$.timeout+"ms exceeded":"timeout exceeded";const Nt=$.transitional||transitionalDefaults;$.timeoutErrorMessage&&(Pt=$.timeoutErrorMessage),a(new AxiosError(Pt,Nt.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,wt)),wt=null},c===void 0&&nt.setContentType(null),"setRequestHeader"in wt&&utils$1.forEach(nt.toJSON(),function(Pt,Nt){wt.setRequestHeader(Nt,Pt)}),utils$1.isUndefined($.withCredentials)||(wt.withCredentials=!!$.withCredentials),at&&at!=="json"&&(wt.responseType=$.responseType),et&&([ct,pt]=progressEventReducer(et,!0),wt.addEventListener("progress",ct)),lt&&wt.upload&&([st,ft]=progressEventReducer(lt),wt.upload.addEventListener("progress",st),wt.upload.addEventListener("loadend",ft)),($.cancelToken||$.signal)&&(it=$t=>{wt&&(a(!$t||$t.type?new CanceledError(null,e,wt):$t),wt.abort(),wt=null)},$.cancelToken&&$.cancelToken.subscribe(it),$.signal&&($.signal.aborted?it():$.signal.addEventListener("abort",it)));const _t=parseProtocol($.url);if(_t&&platform.protocols.indexOf(_t)===-1){a(new AxiosError("Unsupported protocol "+_t+":",AxiosError.ERR_BAD_REQUEST,e));return}wt.send(c||null)})},composeSignals=(e,o)=>{const{length:s}=e=e?e.filter(Boolean):[];if(o||s){let a=new AbortController,$;const c=function(et){if(!$){$=!0,at();const it=et instanceof Error?et:this.reason;a.abort(it instanceof AxiosError?it:new CanceledError(it instanceof Error?it.message:it))}};let nt=o&&setTimeout(()=>{nt=null,c(new AxiosError(`timeout ${o} of ms exceeded`,AxiosError.ETIMEDOUT))},o);const at=()=>{e&&(nt&&clearTimeout(nt),nt=null,e.forEach(et=>{et.unsubscribe?et.unsubscribe(c):et.removeEventListener("abort",c)}),e=null)};e.forEach(et=>et.addEventListener("abort",c));const{signal:lt}=a;return lt.unsubscribe=()=>utils$1.asap(at),lt}},streamChunk=function*(e,o){let s=e.byteLength;if(s<o){yield e;return}let a=0,$;for(;a<s;)$=a+o,yield e.slice(a,$),a=$},readBytes=async function*(e,o){for await(const s of readStream(e))yield*streamChunk(s,o)},readStream=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const o=e.getReader();try{for(;;){const{done:s,value:a}=await o.read();if(s)break;yield a}}finally{await o.cancel()}},trackStream=(e,o,s,a)=>{const $=readBytes(e,o);let c=0,nt,at=lt=>{nt||(nt=!0,a&&a(lt))};return new ReadableStream({async pull(lt){try{const{done:et,value:it}=await $.next();if(et){at(),lt.close();return}let st=it.byteLength;if(s){let ct=c+=st;s(ct)}lt.enqueue(new Uint8Array(it))}catch(et){throw at(et),et}},cancel(lt){return at(lt),$.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(e=>o=>e.encode(o))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test=(e,...o)=>{try{return!!e(...o)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let e=!1;const o=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!o}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(e=>e.body)};isFetchSupported&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(o=>{!resolvers[o]&&(resolvers[o]=utils$1.isFunction(e[o])?s=>s[o]():(s,a)=>{throw new AxiosError(`Response type '${o}' is not supported`,AxiosError.ERR_NOT_SUPPORT,a)})})})(new Response);const getBodyLength=async e=>{if(e==null)return 0;if(utils$1.isBlob(e))return e.size;if(utils$1.isSpecCompliantForm(e))return(await new Request(platform.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(e)||utils$1.isArrayBuffer(e))return e.byteLength;if(utils$1.isURLSearchParams(e)&&(e=e+""),utils$1.isString(e))return(await encodeText(e)).byteLength},resolveBodyLength=async(e,o)=>{const s=utils$1.toFiniteNumber(e.getContentLength());return s??getBodyLength(o)},fetchAdapter=isFetchSupported&&(async e=>{let{url:o,method:s,data:a,signal:$,cancelToken:c,timeout:nt,onDownloadProgress:at,onUploadProgress:lt,responseType:et,headers:it,withCredentials:st="same-origin",fetchOptions:ct}=resolveConfig(e);et=et?(et+"").toLowerCase():"text";let ft=composeSignals([$,c&&c.toAbortSignal()],nt),pt;const gt=ft&&ft.unsubscribe&&(()=>{ft.unsubscribe()});let wt;try{if(lt&&supportsRequestStream&&s!=="get"&&s!=="head"&&(wt=await resolveBodyLength(it,a))!==0){let Nt=new Request(o,{method:"POST",body:a,duplex:"half"}),Lt;if(utils$1.isFormData(a)&&(Lt=Nt.headers.get("content-type"))&&it.setContentType(Lt),Nt.body){const[Ft,Jt]=progressEventDecorator(wt,progressEventReducer(asyncDecorator(lt)));a=trackStream(Nt.body,DEFAULT_CHUNK_SIZE,Ft,Jt)}}utils$1.isString(st)||(st=st?"include":"omit");const vt="credentials"in Request.prototype;pt=new Request(o,{...ct,signal:ft,method:s.toUpperCase(),headers:it.normalize().toJSON(),body:a,duplex:"half",credentials:vt?st:void 0});let _t=await fetch(pt);const $t=supportsResponseStream&&(et==="stream"||et==="response");if(supportsResponseStream&&(at||$t&&gt)){const Nt={};["status","statusText","headers"].forEach(_r=>{Nt[_r]=_t[_r]});const Lt=utils$1.toFiniteNumber(_t.headers.get("content-length")),[Ft,Jt]=at&&progressEventDecorator(Lt,progressEventReducer(asyncDecorator(at),!0))||[];_t=new Response(trackStream(_t.body,DEFAULT_CHUNK_SIZE,Ft,()=>{Jt&&Jt(),gt&&gt()}),Nt)}et=et||"text";let Pt=await resolvers[utils$1.findKey(resolvers,et)||"text"](_t,e);return!$t&&gt&&gt(),await new Promise((Nt,Lt)=>{settle(Nt,Lt,{data:Pt,headers:AxiosHeaders.from(_t.headers),status:_t.status,statusText:_t.statusText,config:e,request:pt})})}catch(vt){throw gt&&gt(),vt&&vt.name==="TypeError"&&/fetch/i.test(vt.message)?Object.assign(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,pt),{cause:vt.cause||vt}):AxiosError.from(vt,vt&&vt.code,e,pt)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(e,o)=>{if(e){try{Object.defineProperty(e,"name",{value:o})}catch{}Object.defineProperty(e,"adapterName",{value:o})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||e===null||e===!1,adapters={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:o}=e;let s,a;const $={};for(let c=0;c<o;c++){s=e[c];let nt;if(a=s,!isResolvedHandle(s)&&(a=knownAdapters[(nt=String(s)).toLowerCase()],a===void 0))throw new AxiosError(`Unknown adapter '${nt}'`);if(a)break;$[nt||"#"+c]=a}if(!a){const c=Object.entries($).map(([at,lt])=>`adapter ${at} `+(lt===!1?"is not supported by the environment":"is not available in the build"));let nt=o?c.length>1?`since :
`+c.map(renderReason).join(`
`):" "+renderReason(c[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+nt,"ERR_NOT_SUPPORT")}return a},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError(null,e)}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders.from(e.headers),e.data=transformData.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(e.adapter||defaults$2.adapter)(e).then(function(a){return throwIfCancellationRequested(e),a.data=transformData.call(e,e.transformResponse,a),a.headers=AxiosHeaders.from(a.headers),a},function(a){return isCancel(a)||(throwIfCancellationRequested(e),a&&a.response&&(a.response.data=transformData.call(e,e.transformResponse,a.response),a.response.headers=AxiosHeaders.from(a.response.headers))),Promise.reject(a)})}const VERSION$1="1.7.7",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,o)=>{validators$1[e]=function(a){return typeof a===e||"a"+(o<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function(o,s,a){function $(c,nt){return"[Axios v"+VERSION$1+"] Transitional option '"+c+"'"+nt+(a?". "+a:"")}return(c,nt,at)=>{if(o===!1)throw new AxiosError($(nt," has been removed"+(s?" in "+s:"")),AxiosError.ERR_DEPRECATED);return s&&!deprecatedWarnings[nt]&&(deprecatedWarnings[nt]=!0,console.warn($(nt," has been deprecated since v"+s+" and will be removed in the near future"))),o?o(c,nt,at):!0}};function assertOptions(e,o,s){if(typeof e!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let $=a.length;for(;$-- >0;){const c=a[$],nt=o[c];if(nt){const at=e[c],lt=at===void 0||nt(at,c,e);if(lt!==!0)throw new AxiosError("option "+c+" must be "+lt,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new AxiosError("Unknown option "+c,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(o){this.defaults=o,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(o,s){try{return await this._request(o,s)}catch(a){if(a instanceof Error){let $;Error.captureStackTrace?Error.captureStackTrace($={}):$=new Error;const c=$.stack?$.stack.replace(/^.+\n/,""):"";try{a.stack?c&&!String(a.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(a.stack+=`
`+c):a.stack=c}catch{}}throw a}}_request(o,s){typeof o=="string"?(s=s||{},s.url=o):s=o||{},s=mergeConfig(this.defaults,s);const{transitional:a,paramsSerializer:$,headers:c}=s;a!==void 0&&validator.assertOptions(a,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),$!=null&&(utils$1.isFunction($)?s.paramsSerializer={serialize:$}:validator.assertOptions($,{encode:validators.function,serialize:validators.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let nt=c&&utils$1.merge(c.common,c[s.method]);c&&utils$1.forEach(["delete","get","head","post","put","patch","common"],pt=>{delete c[pt]}),s.headers=AxiosHeaders.concat(nt,c);const at=[];let lt=!0;this.interceptors.request.forEach(function(gt){typeof gt.runWhen=="function"&&gt.runWhen(s)===!1||(lt=lt&&gt.synchronous,at.unshift(gt.fulfilled,gt.rejected))});const et=[];this.interceptors.response.forEach(function(gt){et.push(gt.fulfilled,gt.rejected)});let it,st=0,ct;if(!lt){const pt=[dispatchRequest.bind(this),void 0];for(pt.unshift.apply(pt,at),pt.push.apply(pt,et),ct=pt.length,it=Promise.resolve(s);st<ct;)it=it.then(pt[st++],pt[st++]);return it}ct=at.length;let ft=s;for(st=0;st<ct;){const pt=at[st++],gt=at[st++];try{ft=pt(ft)}catch(wt){gt.call(this,wt);break}}try{it=dispatchRequest.call(this,ft)}catch(pt){return Promise.reject(pt)}for(st=0,ct=et.length;st<ct;)it=it.then(et[st++],et[st++]);return it}getUri(o){o=mergeConfig(this.defaults,o);const s=buildFullPath(o.baseURL,o.url);return buildURL(s,o.params,o.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function(o){Axios.prototype[o]=function(s,a){return this.request(mergeConfig(a||{},{method:o,url:s,data:(a||{}).data}))}});utils$1.forEach(["post","put","patch"],function(o){function s(a){return function(c,nt,at){return this.request(mergeConfig(at||{},{method:o,headers:a?{"Content-Type":"multipart/form-data"}:{},url:c,data:nt}))}}Axios.prototype[o]=s(),Axios.prototype[o+"Form"]=s(!0)});class CancelToken{constructor(o){if(typeof o!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(c){s=c});const a=this;this.promise.then($=>{if(!a._listeners)return;let c=a._listeners.length;for(;c-- >0;)a._listeners[c]($);a._listeners=null}),this.promise.then=$=>{let c;const nt=new Promise(at=>{a.subscribe(at),c=at}).then($);return nt.cancel=function(){a.unsubscribe(c)},nt},o(function(c,nt,at){a.reason||(a.reason=new CanceledError(c,nt,at),s(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(o){if(this.reason){o(this.reason);return}this._listeners?this._listeners.push(o):this._listeners=[o]}unsubscribe(o){if(!this._listeners)return;const s=this._listeners.indexOf(o);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const o=new AbortController,s=a=>{o.abort(a)};return this.subscribe(s),o.signal.unsubscribe=()=>this.unsubscribe(s),o.signal}static source(){let o;return{token:new CancelToken(function($){o=$}),cancel:o}}}function spread(e){return function(s){return e.apply(null,s)}}function isAxiosError(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([e,o])=>{HttpStatusCode[o]=e});function createInstance(e){const o=new Axios(e),s=bind$1(Axios.prototype.request,o);return utils$1.extend(s,Axios.prototype,o,{allOwnKeys:!0}),utils$1.extend(s,o,null,{allOwnKeys:!0}),s.create=function($){return createInstance(mergeConfig(e,$))},s}const axios=createInstance(defaults$2);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION$1;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(o){return Promise.all(o)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;var define_process_env_default={};let env=null;try{process==null||define_process_env_default==null?env=import.meta:env=define_process_env_default}catch{env={VITE_API_BASE_URL:"http://localhost/api/",VITE_WEB_SITE:"/appstore_panel/dist",VITE_MARKETPLACE_SITE:"http://localhost"},env={}}env.GITHUB_CLIENT_ID;const API_BASE_URL=env.VITE_API_BASE_URL||"https://huaxiaobao.net/api/",WEB_SITE=env.VITE_WEB_SITE||"/appstore_panel/dist",MARKETPLACE_SITE=env.VITE_MARKETPLACE_SITE||"https://huaxiaobao.net",MARKET_API_BASE_URL=MARKETPLACE_SITE+"/api";env.GOOGLE_ANALYTICS_MEASUREMENT_ID;env.GOOGLE_ANALYTICS_API_SECRET;env.NEXT_PUBLIC_MIXPANEL_AUTH_ID;const baseUrl=()=>API_BASE_URL,api=axios.create({baseURL:API_BASE_URL,headers:{common:{"Content-Type":"application/json"}},proxy:{host:"http://www.huaxiaobao.net",port:8081}});axios.create({baseURL:MARKET_API_BASE_URL,headers:{common:{"Content-Type":"application/json"}}});api.interceptors.request.use(e=>{if(typeof window<"u"){let o=api$1.get("accessToken");o||(o=localStorage.getItem("accessTokenHuaxiaobao")),o!=null&&o!=""&&(e.headers.Authorization=`Bearer ${o}`)}return e});function mitt(e){return{all:e=e||new Map,on:function(o,s){var a=e.get(o);a?a.push(s):e.set(o,[s])},off:function(o,s){var a=e.get(o);a&&(s?a.splice(a.indexOf(s)>>>0,1):e.set(o,[]))},emit:function(o,s){var a=e.get(o);a&&a.slice().map(function($){$(s)}),(a=e.get("*"))&&a.slice().map(function($){$(o,s)})}}}const emitter=mitt(),EventBus={on:emitter.on,off:emitter.off,emit:emitter.emit};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jszip_min={exports:{}};/*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/(function(e,o){(function(s){e.exports=s()})(function(){return function s(a,$,c){function nt(et,it){if(!$[et]){if(!a[et]){var st=typeof commonjsRequire=="function"&&commonjsRequire;if(!it&&st)return st(et,!0);if(at)return at(et,!0);var ct=new Error("Cannot find module '"+et+"'");throw ct.code="MODULE_NOT_FOUND",ct}var ft=$[et]={exports:{}};a[et][0].call(ft.exports,function(pt){var gt=a[et][1][pt];return nt(gt||pt)},ft,ft.exports,s,a,$,c)}return $[et].exports}for(var at=typeof commonjsRequire=="function"&&commonjsRequire,lt=0;lt<c.length;lt++)nt(c[lt]);return nt}({1:[function(s,a,$){var c=s("./utils"),nt=s("./support"),at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";$.encode=function(lt){for(var et,it,st,ct,ft,pt,gt,wt=[],vt=0,_t=lt.length,$t=_t,Pt=c.getTypeOf(lt)!=="string";vt<lt.length;)$t=_t-vt,st=Pt?(et=lt[vt++],it=vt<_t?lt[vt++]:0,vt<_t?lt[vt++]:0):(et=lt.charCodeAt(vt++),it=vt<_t?lt.charCodeAt(vt++):0,vt<_t?lt.charCodeAt(vt++):0),ct=et>>2,ft=(3&et)<<4|it>>4,pt=1<$t?(15&it)<<2|st>>6:64,gt=2<$t?63&st:64,wt.push(at.charAt(ct)+at.charAt(ft)+at.charAt(pt)+at.charAt(gt));return wt.join("")},$.decode=function(lt){var et,it,st,ct,ft,pt,gt=0,wt=0,vt="data:";if(lt.substr(0,vt.length)===vt)throw new Error("Invalid base64 input, it looks like a data url.");var _t,$t=3*(lt=lt.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(lt.charAt(lt.length-1)===at.charAt(64)&&$t--,lt.charAt(lt.length-2)===at.charAt(64)&&$t--,$t%1!=0)throw new Error("Invalid base64 input, bad content length.");for(_t=nt.uint8array?new Uint8Array(0|$t):new Array(0|$t);gt<lt.length;)et=at.indexOf(lt.charAt(gt++))<<2|(ct=at.indexOf(lt.charAt(gt++)))>>4,it=(15&ct)<<4|(ft=at.indexOf(lt.charAt(gt++)))>>2,st=(3&ft)<<6|(pt=at.indexOf(lt.charAt(gt++))),_t[wt++]=et,ft!==64&&(_t[wt++]=it),pt!==64&&(_t[wt++]=st);return _t}},{"./support":30,"./utils":32}],2:[function(s,a,$){var c=s("./external"),nt=s("./stream/DataWorker"),at=s("./stream/Crc32Probe"),lt=s("./stream/DataLengthProbe");function et(it,st,ct,ft,pt){this.compressedSize=it,this.uncompressedSize=st,this.crc32=ct,this.compression=ft,this.compressedContent=pt}et.prototype={getContentWorker:function(){var it=new nt(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new lt("data_length")),st=this;return it.on("end",function(){if(this.streamInfo.data_length!==st.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),it},getCompressedWorker:function(){return new nt(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},et.createWorkerFrom=function(it,st,ct){return it.pipe(new at).pipe(new lt("uncompressedSize")).pipe(st.compressWorker(ct)).pipe(new lt("compressedSize")).withStreamInfo("compression",st)},a.exports=et},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(s,a,$){var c=s("./stream/GenericWorker");$.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},$.DEFLATE=s("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(s,a,$){var c=s("./utils"),nt=function(){for(var at,lt=[],et=0;et<256;et++){at=et;for(var it=0;it<8;it++)at=1&at?3988292384^at>>>1:at>>>1;lt[et]=at}return lt}();a.exports=function(at,lt){return at!==void 0&&at.length?c.getTypeOf(at)!=="string"?function(et,it,st,ct){var ft=nt,pt=ct+st;et^=-1;for(var gt=ct;gt<pt;gt++)et=et>>>8^ft[255&(et^it[gt])];return-1^et}(0|lt,at,at.length,0):function(et,it,st,ct){var ft=nt,pt=ct+st;et^=-1;for(var gt=ct;gt<pt;gt++)et=et>>>8^ft[255&(et^it.charCodeAt(gt))];return-1^et}(0|lt,at,at.length,0):0}},{"./utils":32}],5:[function(s,a,$){$.base64=!1,$.binary=!1,$.dir=!1,$.createFolders=!0,$.date=null,$.compression=null,$.compressionOptions=null,$.comment=null,$.unixPermissions=null,$.dosPermissions=null},{}],6:[function(s,a,$){var c=null;c=typeof Promise<"u"?Promise:s("lie"),a.exports={Promise:c}},{lie:37}],7:[function(s,a,$){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",nt=s("pako"),at=s("./utils"),lt=s("./stream/GenericWorker"),et=c?"uint8array":"array";function it(st,ct){lt.call(this,"FlateWorker/"+st),this._pako=null,this._pakoAction=st,this._pakoOptions=ct,this.meta={}}$.magic="\b\0",at.inherits(it,lt),it.prototype.processChunk=function(st){this.meta=st.meta,this._pako===null&&this._createPako(),this._pako.push(at.transformTo(et,st.data),!1)},it.prototype.flush=function(){lt.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},it.prototype.cleanUp=function(){lt.prototype.cleanUp.call(this),this._pako=null},it.prototype._createPako=function(){this._pako=new nt[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var st=this;this._pako.onData=function(ct){st.push({data:ct,meta:st.meta})}},$.compressWorker=function(st){return new it("Deflate",st)},$.uncompressWorker=function(){return new it("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(s,a,$){function c(ft,pt){var gt,wt="";for(gt=0;gt<pt;gt++)wt+=String.fromCharCode(255&ft),ft>>>=8;return wt}function nt(ft,pt,gt,wt,vt,_t){var $t,Pt,Nt=ft.file,Lt=ft.compression,Ft=_t!==et.utf8encode,Jt=at.transformTo("string",_t(Nt.name)),_r=at.transformTo("string",et.utf8encode(Nt.name)),wr=Nt.comment,tn=at.transformTo("string",_t(wr)),Wt=at.transformTo("string",et.utf8encode(wr)),Yr=_r.length!==Nt.name.length,Ot=Wt.length!==wr.length,gr="",$o="",In="",en=Nt.dir,Lr=Nt.date,ko={crc32:0,compressedSize:0,uncompressedSize:0};pt&&!gt||(ko.crc32=ft.crc32,ko.compressedSize=ft.compressedSize,ko.uncompressedSize=ft.uncompressedSize);var Ir=0;pt&&(Ir|=8),Ft||!Yr&&!Ot||(Ir|=2048);var Dr=0,Zr=0;en&&(Dr|=16),vt==="UNIX"?(Zr=798,Dr|=function(On,zo){var Yo=On;return On||(Yo=zo?16893:33204),(65535&Yo)<<16}(Nt.unixPermissions,en)):(Zr=20,Dr|=function(On){return 63&(On||0)}(Nt.dosPermissions)),$t=Lr.getUTCHours(),$t<<=6,$t|=Lr.getUTCMinutes(),$t<<=5,$t|=Lr.getUTCSeconds()/2,Pt=Lr.getUTCFullYear()-1980,Pt<<=4,Pt|=Lr.getUTCMonth()+1,Pt<<=5,Pt|=Lr.getUTCDate(),Yr&&($o=c(1,1)+c(it(Jt),4)+_r,gr+="up"+c($o.length,2)+$o),Ot&&(In=c(1,1)+c(it(tn),4)+Wt,gr+="uc"+c(In.length,2)+In);var rn="";return rn+=`
\0`,rn+=c(Ir,2),rn+=Lt.magic,rn+=c($t,2),rn+=c(Pt,2),rn+=c(ko.crc32,4),rn+=c(ko.compressedSize,4),rn+=c(ko.uncompressedSize,4),rn+=c(Jt.length,2),rn+=c(gr.length,2),{fileRecord:st.LOCAL_FILE_HEADER+rn+Jt+gr,dirRecord:st.CENTRAL_FILE_HEADER+c(Zr,2)+rn+c(tn.length,2)+"\0\0\0\0"+c(Dr,4)+c(wt,4)+Jt+gr+tn}}var at=s("../utils"),lt=s("../stream/GenericWorker"),et=s("../utf8"),it=s("../crc32"),st=s("../signature");function ct(ft,pt,gt,wt){lt.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=pt,this.zipPlatform=gt,this.encodeFileName=wt,this.streamFiles=ft,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}at.inherits(ct,lt),ct.prototype.push=function(ft){var pt=ft.meta.percent||0,gt=this.entriesCount,wt=this._sources.length;this.accumulate?this.contentBuffer.push(ft):(this.bytesWritten+=ft.data.length,lt.prototype.push.call(this,{data:ft.data,meta:{currentFile:this.currentFile,percent:gt?(pt+100*(gt-wt-1))/gt:100}}))},ct.prototype.openedSource=function(ft){this.currentSourceOffset=this.bytesWritten,this.currentFile=ft.file.name;var pt=this.streamFiles&&!ft.file.dir;if(pt){var gt=nt(ft,pt,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:gt.fileRecord,meta:{percent:0}})}else this.accumulate=!0},ct.prototype.closedSource=function(ft){this.accumulate=!1;var pt=this.streamFiles&&!ft.file.dir,gt=nt(ft,pt,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(gt.dirRecord),pt)this.push({data:function(wt){return st.DATA_DESCRIPTOR+c(wt.crc32,4)+c(wt.compressedSize,4)+c(wt.uncompressedSize,4)}(ft),meta:{percent:100}});else for(this.push({data:gt.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},ct.prototype.flush=function(){for(var ft=this.bytesWritten,pt=0;pt<this.dirRecords.length;pt++)this.push({data:this.dirRecords[pt],meta:{percent:100}});var gt=this.bytesWritten-ft,wt=function(vt,_t,$t,Pt,Nt){var Lt=at.transformTo("string",Nt(Pt));return st.CENTRAL_DIRECTORY_END+"\0\0\0\0"+c(vt,2)+c(vt,2)+c(_t,4)+c($t,4)+c(Lt.length,2)+Lt}(this.dirRecords.length,gt,ft,this.zipComment,this.encodeFileName);this.push({data:wt,meta:{percent:100}})},ct.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},ct.prototype.registerPrevious=function(ft){this._sources.push(ft);var pt=this;return ft.on("data",function(gt){pt.processChunk(gt)}),ft.on("end",function(){pt.closedSource(pt.previous.streamInfo),pt._sources.length?pt.prepareNextSource():pt.end()}),ft.on("error",function(gt){pt.error(gt)}),this},ct.prototype.resume=function(){return!!lt.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},ct.prototype.error=function(ft){var pt=this._sources;if(!lt.prototype.error.call(this,ft))return!1;for(var gt=0;gt<pt.length;gt++)try{pt[gt].error(ft)}catch{}return!0},ct.prototype.lock=function(){lt.prototype.lock.call(this);for(var ft=this._sources,pt=0;pt<ft.length;pt++)ft[pt].lock()},a.exports=ct},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(s,a,$){var c=s("../compressions"),nt=s("./ZipFileWorker");$.generateWorker=function(at,lt,et){var it=new nt(lt.streamFiles,et,lt.platform,lt.encodeFileName),st=0;try{at.forEach(function(ct,ft){st++;var pt=function(_t,$t){var Pt=_t||$t,Nt=c[Pt];if(!Nt)throw new Error(Pt+" is not a valid compression method !");return Nt}(ft.options.compression,lt.compression),gt=ft.options.compressionOptions||lt.compressionOptions||{},wt=ft.dir,vt=ft.date;ft._compressWorker(pt,gt).withStreamInfo("file",{name:ct,dir:wt,date:vt,comment:ft.comment||"",unixPermissions:ft.unixPermissions,dosPermissions:ft.dosPermissions}).pipe(it)}),it.entriesCount=st}catch(ct){it.error(ct)}return it}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(s,a,$){function c(){if(!(this instanceof c))return new c;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var nt=new c;for(var at in this)typeof this[at]!="function"&&(nt[at]=this[at]);return nt}}(c.prototype=s("./object")).loadAsync=s("./load"),c.support=s("./support"),c.defaults=s("./defaults"),c.version="3.10.1",c.loadAsync=function(nt,at){return new c().loadAsync(nt,at)},c.external=s("./external"),a.exports=c},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(s,a,$){var c=s("./utils"),nt=s("./external"),at=s("./utf8"),lt=s("./zipEntries"),et=s("./stream/Crc32Probe"),it=s("./nodejsUtils");function st(ct){return new nt.Promise(function(ft,pt){var gt=ct.decompressed.getContentWorker().pipe(new et);gt.on("error",function(wt){pt(wt)}).on("end",function(){gt.streamInfo.crc32!==ct.decompressed.crc32?pt(new Error("Corrupted zip : CRC32 mismatch")):ft()}).resume()})}a.exports=function(ct,ft){var pt=this;return ft=c.extend(ft||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:at.utf8decode}),it.isNode&&it.isStream(ct)?nt.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):c.prepareContent("the loaded zip file",ct,!0,ft.optimizedBinaryString,ft.base64).then(function(gt){var wt=new lt(ft);return wt.load(gt),wt}).then(function(gt){var wt=[nt.Promise.resolve(gt)],vt=gt.files;if(ft.checkCRC32)for(var _t=0;_t<vt.length;_t++)wt.push(st(vt[_t]));return nt.Promise.all(wt)}).then(function(gt){for(var wt=gt.shift(),vt=wt.files,_t=0;_t<vt.length;_t++){var $t=vt[_t],Pt=$t.fileNameStr,Nt=c.resolve($t.fileNameStr);pt.file(Nt,$t.decompressed,{binary:!0,optimizedBinaryString:!0,date:$t.date,dir:$t.dir,comment:$t.fileCommentStr.length?$t.fileCommentStr:null,unixPermissions:$t.unixPermissions,dosPermissions:$t.dosPermissions,createFolders:ft.createFolders}),$t.dir||(pt.file(Nt).unsafeOriginalName=Pt)}return wt.zipComment.length&&(pt.comment=wt.zipComment),pt})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(s,a,$){var c=s("../utils"),nt=s("../stream/GenericWorker");function at(lt,et){nt.call(this,"Nodejs stream input adapter for "+lt),this._upstreamEnded=!1,this._bindStream(et)}c.inherits(at,nt),at.prototype._bindStream=function(lt){var et=this;(this._stream=lt).pause(),lt.on("data",function(it){et.push({data:it,meta:{percent:0}})}).on("error",function(it){et.isPaused?this.generatedError=it:et.error(it)}).on("end",function(){et.isPaused?et._upstreamEnded=!0:et.end()})},at.prototype.pause=function(){return!!nt.prototype.pause.call(this)&&(this._stream.pause(),!0)},at.prototype.resume=function(){return!!nt.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},a.exports=at},{"../stream/GenericWorker":28,"../utils":32}],13:[function(s,a,$){var c=s("readable-stream").Readable;function nt(at,lt,et){c.call(this,lt),this._helper=at;var it=this;at.on("data",function(st,ct){it.push(st)||it._helper.pause(),et&&et(ct)}).on("error",function(st){it.emit("error",st)}).on("end",function(){it.push(null)})}s("../utils").inherits(nt,c),nt.prototype._read=function(){this._helper.resume()},a.exports=nt},{"../utils":32,"readable-stream":16}],14:[function(s,a,$){a.exports={isNode:typeof Buffer<"u",newBufferFrom:function(c,nt){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(c,nt);if(typeof c=="number")throw new Error('The "data" argument must not be a number');return new Buffer(c,nt)},allocBuffer:function(c){if(Buffer.alloc)return Buffer.alloc(c);var nt=new Buffer(c);return nt.fill(0),nt},isBuffer:function(c){return Buffer.isBuffer(c)},isStream:function(c){return c&&typeof c.on=="function"&&typeof c.pause=="function"&&typeof c.resume=="function"}}},{}],15:[function(s,a,$){function c(Nt,Lt,Ft){var Jt,_r=at.getTypeOf(Lt),wr=at.extend(Ft||{},it);wr.date=wr.date||new Date,wr.compression!==null&&(wr.compression=wr.compression.toUpperCase()),typeof wr.unixPermissions=="string"&&(wr.unixPermissions=parseInt(wr.unixPermissions,8)),wr.unixPermissions&&16384&wr.unixPermissions&&(wr.dir=!0),wr.dosPermissions&&16&wr.dosPermissions&&(wr.dir=!0),wr.dir&&(Nt=vt(Nt)),wr.createFolders&&(Jt=wt(Nt))&&_t.call(this,Jt,!0);var tn=_r==="string"&&wr.binary===!1&&wr.base64===!1;Ft&&Ft.binary!==void 0||(wr.binary=!tn),(Lt instanceof st&&Lt.uncompressedSize===0||wr.dir||!Lt||Lt.length===0)&&(wr.base64=!1,wr.binary=!0,Lt="",wr.compression="STORE",_r="string");var Wt=null;Wt=Lt instanceof st||Lt instanceof lt?Lt:pt.isNode&&pt.isStream(Lt)?new gt(Nt,Lt):at.prepareContent(Nt,Lt,wr.binary,wr.optimizedBinaryString,wr.base64);var Yr=new ct(Nt,Wt,wr);this.files[Nt]=Yr}var nt=s("./utf8"),at=s("./utils"),lt=s("./stream/GenericWorker"),et=s("./stream/StreamHelper"),it=s("./defaults"),st=s("./compressedObject"),ct=s("./zipObject"),ft=s("./generate"),pt=s("./nodejsUtils"),gt=s("./nodejs/NodejsStreamInputAdapter"),wt=function(Nt){Nt.slice(-1)==="/"&&(Nt=Nt.substring(0,Nt.length-1));var Lt=Nt.lastIndexOf("/");return 0<Lt?Nt.substring(0,Lt):""},vt=function(Nt){return Nt.slice(-1)!=="/"&&(Nt+="/"),Nt},_t=function(Nt,Lt){return Lt=Lt!==void 0?Lt:it.createFolders,Nt=vt(Nt),this.files[Nt]||c.call(this,Nt,null,{dir:!0,createFolders:Lt}),this.files[Nt]};function $t(Nt){return Object.prototype.toString.call(Nt)==="[object RegExp]"}var Pt={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(Nt){var Lt,Ft,Jt;for(Lt in this.files)Jt=this.files[Lt],(Ft=Lt.slice(this.root.length,Lt.length))&&Lt.slice(0,this.root.length)===this.root&&Nt(Ft,Jt)},filter:function(Nt){var Lt=[];return this.forEach(function(Ft,Jt){Nt(Ft,Jt)&&Lt.push(Jt)}),Lt},file:function(Nt,Lt,Ft){if(arguments.length!==1)return Nt=this.root+Nt,c.call(this,Nt,Lt,Ft),this;if($t(Nt)){var Jt=Nt;return this.filter(function(wr,tn){return!tn.dir&&Jt.test(wr)})}var _r=this.files[this.root+Nt];return _r&&!_r.dir?_r:null},folder:function(Nt){if(!Nt)return this;if($t(Nt))return this.filter(function(_r,wr){return wr.dir&&Nt.test(_r)});var Lt=this.root+Nt,Ft=_t.call(this,Lt),Jt=this.clone();return Jt.root=Ft.name,Jt},remove:function(Nt){Nt=this.root+Nt;var Lt=this.files[Nt];if(Lt||(Nt.slice(-1)!=="/"&&(Nt+="/"),Lt=this.files[Nt]),Lt&&!Lt.dir)delete this.files[Nt];else for(var Ft=this.filter(function(_r,wr){return wr.name.slice(0,Nt.length)===Nt}),Jt=0;Jt<Ft.length;Jt++)delete this.files[Ft[Jt].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(Nt){var Lt,Ft={};try{if((Ft=at.extend(Nt||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:nt.utf8encode})).type=Ft.type.toLowerCase(),Ft.compression=Ft.compression.toUpperCase(),Ft.type==="binarystring"&&(Ft.type="string"),!Ft.type)throw new Error("No output type specified.");at.checkSupport(Ft.type),Ft.platform!=="darwin"&&Ft.platform!=="freebsd"&&Ft.platform!=="linux"&&Ft.platform!=="sunos"||(Ft.platform="UNIX"),Ft.platform==="win32"&&(Ft.platform="DOS");var Jt=Ft.comment||this.comment||"";Lt=ft.generateWorker(this,Ft,Jt)}catch(_r){(Lt=new lt("error")).error(_r)}return new et(Lt,Ft.type||"string",Ft.mimeType)},generateAsync:function(Nt,Lt){return this.generateInternalStream(Nt).accumulate(Lt)},generateNodeStream:function(Nt,Lt){return(Nt=Nt||{}).type||(Nt.type="nodebuffer"),this.generateInternalStream(Nt).toNodejsStream(Lt)}};a.exports=Pt},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(s,a,$){a.exports=s("stream")},{stream:void 0}],17:[function(s,a,$){var c=s("./DataReader");function nt(at){c.call(this,at);for(var lt=0;lt<this.data.length;lt++)at[lt]=255&at[lt]}s("../utils").inherits(nt,c),nt.prototype.byteAt=function(at){return this.data[this.zero+at]},nt.prototype.lastIndexOfSignature=function(at){for(var lt=at.charCodeAt(0),et=at.charCodeAt(1),it=at.charCodeAt(2),st=at.charCodeAt(3),ct=this.length-4;0<=ct;--ct)if(this.data[ct]===lt&&this.data[ct+1]===et&&this.data[ct+2]===it&&this.data[ct+3]===st)return ct-this.zero;return-1},nt.prototype.readAndCheckSignature=function(at){var lt=at.charCodeAt(0),et=at.charCodeAt(1),it=at.charCodeAt(2),st=at.charCodeAt(3),ct=this.readData(4);return lt===ct[0]&&et===ct[1]&&it===ct[2]&&st===ct[3]},nt.prototype.readData=function(at){if(this.checkOffset(at),at===0)return[];var lt=this.data.slice(this.zero+this.index,this.zero+this.index+at);return this.index+=at,lt},a.exports=nt},{"../utils":32,"./DataReader":18}],18:[function(s,a,$){var c=s("../utils");function nt(at){this.data=at,this.length=at.length,this.index=0,this.zero=0}nt.prototype={checkOffset:function(at){this.checkIndex(this.index+at)},checkIndex:function(at){if(this.length<this.zero+at||at<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+at+"). Corrupted zip ?")},setIndex:function(at){this.checkIndex(at),this.index=at},skip:function(at){this.setIndex(this.index+at)},byteAt:function(){},readInt:function(at){var lt,et=0;for(this.checkOffset(at),lt=this.index+at-1;lt>=this.index;lt--)et=(et<<8)+this.byteAt(lt);return this.index+=at,et},readString:function(at){return c.transformTo("string",this.readData(at))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var at=this.readInt(4);return new Date(Date.UTC(1980+(at>>25&127),(at>>21&15)-1,at>>16&31,at>>11&31,at>>5&63,(31&at)<<1))}},a.exports=nt},{"../utils":32}],19:[function(s,a,$){var c=s("./Uint8ArrayReader");function nt(at){c.call(this,at)}s("../utils").inherits(nt,c),nt.prototype.readData=function(at){this.checkOffset(at);var lt=this.data.slice(this.zero+this.index,this.zero+this.index+at);return this.index+=at,lt},a.exports=nt},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(s,a,$){var c=s("./DataReader");function nt(at){c.call(this,at)}s("../utils").inherits(nt,c),nt.prototype.byteAt=function(at){return this.data.charCodeAt(this.zero+at)},nt.prototype.lastIndexOfSignature=function(at){return this.data.lastIndexOf(at)-this.zero},nt.prototype.readAndCheckSignature=function(at){return at===this.readData(4)},nt.prototype.readData=function(at){this.checkOffset(at);var lt=this.data.slice(this.zero+this.index,this.zero+this.index+at);return this.index+=at,lt},a.exports=nt},{"../utils":32,"./DataReader":18}],21:[function(s,a,$){var c=s("./ArrayReader");function nt(at){c.call(this,at)}s("../utils").inherits(nt,c),nt.prototype.readData=function(at){if(this.checkOffset(at),at===0)return new Uint8Array(0);var lt=this.data.subarray(this.zero+this.index,this.zero+this.index+at);return this.index+=at,lt},a.exports=nt},{"../utils":32,"./ArrayReader":17}],22:[function(s,a,$){var c=s("../utils"),nt=s("../support"),at=s("./ArrayReader"),lt=s("./StringReader"),et=s("./NodeBufferReader"),it=s("./Uint8ArrayReader");a.exports=function(st){var ct=c.getTypeOf(st);return c.checkSupport(ct),ct!=="string"||nt.uint8array?ct==="nodebuffer"?new et(st):nt.uint8array?new it(c.transformTo("uint8array",st)):new at(c.transformTo("array",st)):new lt(st)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(s,a,$){$.LOCAL_FILE_HEADER="PK",$.CENTRAL_FILE_HEADER="PK",$.CENTRAL_DIRECTORY_END="PK",$.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",$.ZIP64_CENTRAL_DIRECTORY_END="PK",$.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(s,a,$){var c=s("./GenericWorker"),nt=s("../utils");function at(lt){c.call(this,"ConvertWorker to "+lt),this.destType=lt}nt.inherits(at,c),at.prototype.processChunk=function(lt){this.push({data:nt.transformTo(this.destType,lt.data),meta:lt.meta})},a.exports=at},{"../utils":32,"./GenericWorker":28}],25:[function(s,a,$){var c=s("./GenericWorker"),nt=s("../crc32");function at(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s("../utils").inherits(at,c),at.prototype.processChunk=function(lt){this.streamInfo.crc32=nt(lt.data,this.streamInfo.crc32||0),this.push(lt)},a.exports=at},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(s,a,$){var c=s("../utils"),nt=s("./GenericWorker");function at(lt){nt.call(this,"DataLengthProbe for "+lt),this.propName=lt,this.withStreamInfo(lt,0)}c.inherits(at,nt),at.prototype.processChunk=function(lt){if(lt){var et=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=et+lt.data.length}nt.prototype.processChunk.call(this,lt)},a.exports=at},{"../utils":32,"./GenericWorker":28}],27:[function(s,a,$){var c=s("../utils"),nt=s("./GenericWorker");function at(lt){nt.call(this,"DataWorker");var et=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,lt.then(function(it){et.dataIsReady=!0,et.data=it,et.max=it&&it.length||0,et.type=c.getTypeOf(it),et.isPaused||et._tickAndRepeat()},function(it){et.error(it)})}c.inherits(at,nt),at.prototype.cleanUp=function(){nt.prototype.cleanUp.call(this),this.data=null},at.prototype.resume=function(){return!!nt.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},at.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},at.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var lt=null,et=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":lt=this.data.substring(this.index,et);break;case"uint8array":lt=this.data.subarray(this.index,et);break;case"array":case"nodebuffer":lt=this.data.slice(this.index,et)}return this.index=et,this.push({data:lt,meta:{percent:this.max?this.index/this.max*100:0}})},a.exports=at},{"../utils":32,"./GenericWorker":28}],28:[function(s,a,$){function c(nt){this.name=nt||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(nt){this.emit("data",nt)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(nt){this.emit("error",nt)}return!0},error:function(nt){return!this.isFinished&&(this.isPaused?this.generatedError=nt:(this.isFinished=!0,this.emit("error",nt),this.previous&&this.previous.error(nt),this.cleanUp()),!0)},on:function(nt,at){return this._listeners[nt].push(at),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(nt,at){if(this._listeners[nt])for(var lt=0;lt<this._listeners[nt].length;lt++)this._listeners[nt][lt].call(this,at)},pipe:function(nt){return nt.registerPrevious(this)},registerPrevious:function(nt){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=nt.streamInfo,this.mergeStreamInfo(),this.previous=nt;var at=this;return nt.on("data",function(lt){at.processChunk(lt)}),nt.on("end",function(){at.end()}),nt.on("error",function(lt){at.error(lt)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var nt=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),nt=!0),this.previous&&this.previous.resume(),!nt},flush:function(){},processChunk:function(nt){this.push(nt)},withStreamInfo:function(nt,at){return this.extraStreamInfo[nt]=at,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var nt in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,nt)&&(this.streamInfo[nt]=this.extraStreamInfo[nt])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var nt="Worker "+this.name;return this.previous?this.previous+" -> "+nt:nt}},a.exports=c},{}],29:[function(s,a,$){var c=s("../utils"),nt=s("./ConvertWorker"),at=s("./GenericWorker"),lt=s("../base64"),et=s("../support"),it=s("../external"),st=null;if(et.nodestream)try{st=s("../nodejs/NodejsStreamOutputAdapter")}catch{}function ct(pt,gt){return new it.Promise(function(wt,vt){var _t=[],$t=pt._internalType,Pt=pt._outputType,Nt=pt._mimeType;pt.on("data",function(Lt,Ft){_t.push(Lt),gt&&gt(Ft)}).on("error",function(Lt){_t=[],vt(Lt)}).on("end",function(){try{var Lt=function(Ft,Jt,_r){switch(Ft){case"blob":return c.newBlob(c.transformTo("arraybuffer",Jt),_r);case"base64":return lt.encode(Jt);default:return c.transformTo(Ft,Jt)}}(Pt,function(Ft,Jt){var _r,wr=0,tn=null,Wt=0;for(_r=0;_r<Jt.length;_r++)Wt+=Jt[_r].length;switch(Ft){case"string":return Jt.join("");case"array":return Array.prototype.concat.apply([],Jt);case"uint8array":for(tn=new Uint8Array(Wt),_r=0;_r<Jt.length;_r++)tn.set(Jt[_r],wr),wr+=Jt[_r].length;return tn;case"nodebuffer":return Buffer.concat(Jt);default:throw new Error("concat : unsupported type '"+Ft+"'")}}($t,_t),Nt);wt(Lt)}catch(Ft){vt(Ft)}_t=[]}).resume()})}function ft(pt,gt,wt){var vt=gt;switch(gt){case"blob":case"arraybuffer":vt="uint8array";break;case"base64":vt="string"}try{this._internalType=vt,this._outputType=gt,this._mimeType=wt,c.checkSupport(vt),this._worker=pt.pipe(new nt(vt)),pt.lock()}catch(_t){this._worker=new at("error"),this._worker.error(_t)}}ft.prototype={accumulate:function(pt){return ct(this,pt)},on:function(pt,gt){var wt=this;return pt==="data"?this._worker.on(pt,function(vt){gt.call(wt,vt.data,vt.meta)}):this._worker.on(pt,function(){c.delay(gt,arguments,wt)}),this},resume:function(){return c.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(pt){if(c.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new st(this,{objectMode:this._outputType!=="nodebuffer"},pt)}},a.exports=ft},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(s,a,$){if($.base64=!0,$.array=!0,$.string=!0,$.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",$.nodebuffer=typeof Buffer<"u",$.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")$.blob=!1;else{var c=new ArrayBuffer(0);try{$.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var nt=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);nt.append(c),$.blob=nt.getBlob("application/zip").size===0}catch{$.blob=!1}}}try{$.nodestream=!!s("readable-stream").Readable}catch{$.nodestream=!1}},{"readable-stream":16}],31:[function(s,a,$){for(var c=s("./utils"),nt=s("./support"),at=s("./nodejsUtils"),lt=s("./stream/GenericWorker"),et=new Array(256),it=0;it<256;it++)et[it]=252<=it?6:248<=it?5:240<=it?4:224<=it?3:192<=it?2:1;et[254]=et[254]=1;function st(){lt.call(this,"utf-8 decode"),this.leftOver=null}function ct(){lt.call(this,"utf-8 encode")}$.utf8encode=function(ft){return nt.nodebuffer?at.newBufferFrom(ft,"utf-8"):function(pt){var gt,wt,vt,_t,$t,Pt=pt.length,Nt=0;for(_t=0;_t<Pt;_t++)(64512&(wt=pt.charCodeAt(_t)))==55296&&_t+1<Pt&&(64512&(vt=pt.charCodeAt(_t+1)))==56320&&(wt=65536+(wt-55296<<10)+(vt-56320),_t++),Nt+=wt<128?1:wt<2048?2:wt<65536?3:4;for(gt=nt.uint8array?new Uint8Array(Nt):new Array(Nt),_t=$t=0;$t<Nt;_t++)(64512&(wt=pt.charCodeAt(_t)))==55296&&_t+1<Pt&&(64512&(vt=pt.charCodeAt(_t+1)))==56320&&(wt=65536+(wt-55296<<10)+(vt-56320),_t++),wt<128?gt[$t++]=wt:(wt<2048?gt[$t++]=192|wt>>>6:(wt<65536?gt[$t++]=224|wt>>>12:(gt[$t++]=240|wt>>>18,gt[$t++]=128|wt>>>12&63),gt[$t++]=128|wt>>>6&63),gt[$t++]=128|63&wt);return gt}(ft)},$.utf8decode=function(ft){return nt.nodebuffer?c.transformTo("nodebuffer",ft).toString("utf-8"):function(pt){var gt,wt,vt,_t,$t=pt.length,Pt=new Array(2*$t);for(gt=wt=0;gt<$t;)if((vt=pt[gt++])<128)Pt[wt++]=vt;else if(4<(_t=et[vt]))Pt[wt++]=65533,gt+=_t-1;else{for(vt&=_t===2?31:_t===3?15:7;1<_t&&gt<$t;)vt=vt<<6|63&pt[gt++],_t--;1<_t?Pt[wt++]=65533:vt<65536?Pt[wt++]=vt:(vt-=65536,Pt[wt++]=55296|vt>>10&1023,Pt[wt++]=56320|1023&vt)}return Pt.length!==wt&&(Pt.subarray?Pt=Pt.subarray(0,wt):Pt.length=wt),c.applyFromCharCode(Pt)}(ft=c.transformTo(nt.uint8array?"uint8array":"array",ft))},c.inherits(st,lt),st.prototype.processChunk=function(ft){var pt=c.transformTo(nt.uint8array?"uint8array":"array",ft.data);if(this.leftOver&&this.leftOver.length){if(nt.uint8array){var gt=pt;(pt=new Uint8Array(gt.length+this.leftOver.length)).set(this.leftOver,0),pt.set(gt,this.leftOver.length)}else pt=this.leftOver.concat(pt);this.leftOver=null}var wt=function(_t,$t){var Pt;for(($t=$t||_t.length)>_t.length&&($t=_t.length),Pt=$t-1;0<=Pt&&(192&_t[Pt])==128;)Pt--;return Pt<0||Pt===0?$t:Pt+et[_t[Pt]]>$t?Pt:$t}(pt),vt=pt;wt!==pt.length&&(nt.uint8array?(vt=pt.subarray(0,wt),this.leftOver=pt.subarray(wt,pt.length)):(vt=pt.slice(0,wt),this.leftOver=pt.slice(wt,pt.length))),this.push({data:$.utf8decode(vt),meta:ft.meta})},st.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:$.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},$.Utf8DecodeWorker=st,c.inherits(ct,lt),ct.prototype.processChunk=function(ft){this.push({data:$.utf8encode(ft.data),meta:ft.meta})},$.Utf8EncodeWorker=ct},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(s,a,$){var c=s("./support"),nt=s("./base64"),at=s("./nodejsUtils"),lt=s("./external");function et(gt){return gt}function it(gt,wt){for(var vt=0;vt<gt.length;++vt)wt[vt]=255&gt.charCodeAt(vt);return wt}s("setimmediate"),$.newBlob=function(gt,wt){$.checkSupport("blob");try{return new Blob([gt],{type:wt})}catch{try{var vt=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return vt.append(gt),vt.getBlob(wt)}catch{throw new Error("Bug : can't construct the Blob.")}}};var st={stringifyByChunk:function(gt,wt,vt){var _t=[],$t=0,Pt=gt.length;if(Pt<=vt)return String.fromCharCode.apply(null,gt);for(;$t<Pt;)wt==="array"||wt==="nodebuffer"?_t.push(String.fromCharCode.apply(null,gt.slice($t,Math.min($t+vt,Pt)))):_t.push(String.fromCharCode.apply(null,gt.subarray($t,Math.min($t+vt,Pt)))),$t+=vt;return _t.join("")},stringifyByChar:function(gt){for(var wt="",vt=0;vt<gt.length;vt++)wt+=String.fromCharCode(gt[vt]);return wt},applyCanBeUsed:{uint8array:function(){try{return c.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return c.nodebuffer&&String.fromCharCode.apply(null,at.allocBuffer(1)).length===1}catch{return!1}}()}};function ct(gt){var wt=65536,vt=$.getTypeOf(gt),_t=!0;if(vt==="uint8array"?_t=st.applyCanBeUsed.uint8array:vt==="nodebuffer"&&(_t=st.applyCanBeUsed.nodebuffer),_t)for(;1<wt;)try{return st.stringifyByChunk(gt,vt,wt)}catch{wt=Math.floor(wt/2)}return st.stringifyByChar(gt)}function ft(gt,wt){for(var vt=0;vt<gt.length;vt++)wt[vt]=gt[vt];return wt}$.applyFromCharCode=ct;var pt={};pt.string={string:et,array:function(gt){return it(gt,new Array(gt.length))},arraybuffer:function(gt){return pt.string.uint8array(gt).buffer},uint8array:function(gt){return it(gt,new Uint8Array(gt.length))},nodebuffer:function(gt){return it(gt,at.allocBuffer(gt.length))}},pt.array={string:ct,array:et,arraybuffer:function(gt){return new Uint8Array(gt).buffer},uint8array:function(gt){return new Uint8Array(gt)},nodebuffer:function(gt){return at.newBufferFrom(gt)}},pt.arraybuffer={string:function(gt){return ct(new Uint8Array(gt))},array:function(gt){return ft(new Uint8Array(gt),new Array(gt.byteLength))},arraybuffer:et,uint8array:function(gt){return new Uint8Array(gt)},nodebuffer:function(gt){return at.newBufferFrom(new Uint8Array(gt))}},pt.uint8array={string:ct,array:function(gt){return ft(gt,new Array(gt.length))},arraybuffer:function(gt){return gt.buffer},uint8array:et,nodebuffer:function(gt){return at.newBufferFrom(gt)}},pt.nodebuffer={string:ct,array:function(gt){return ft(gt,new Array(gt.length))},arraybuffer:function(gt){return pt.nodebuffer.uint8array(gt).buffer},uint8array:function(gt){return ft(gt,new Uint8Array(gt.length))},nodebuffer:et},$.transformTo=function(gt,wt){if(wt=wt||"",!gt)return wt;$.checkSupport(gt);var vt=$.getTypeOf(wt);return pt[vt][gt](wt)},$.resolve=function(gt){for(var wt=gt.split("/"),vt=[],_t=0;_t<wt.length;_t++){var $t=wt[_t];$t==="."||$t===""&&_t!==0&&_t!==wt.length-1||($t===".."?vt.pop():vt.push($t))}return vt.join("/")},$.getTypeOf=function(gt){return typeof gt=="string"?"string":Object.prototype.toString.call(gt)==="[object Array]"?"array":c.nodebuffer&&at.isBuffer(gt)?"nodebuffer":c.uint8array&&gt instanceof Uint8Array?"uint8array":c.arraybuffer&&gt instanceof ArrayBuffer?"arraybuffer":void 0},$.checkSupport=function(gt){if(!c[gt.toLowerCase()])throw new Error(gt+" is not supported by this platform")},$.MAX_VALUE_16BITS=65535,$.MAX_VALUE_32BITS=-1,$.pretty=function(gt){var wt,vt,_t="";for(vt=0;vt<(gt||"").length;vt++)_t+="\\x"+((wt=gt.charCodeAt(vt))<16?"0":"")+wt.toString(16).toUpperCase();return _t},$.delay=function(gt,wt,vt){setImmediate(function(){gt.apply(vt||null,wt||[])})},$.inherits=function(gt,wt){function vt(){}vt.prototype=wt.prototype,gt.prototype=new vt},$.extend=function(){var gt,wt,vt={};for(gt=0;gt<arguments.length;gt++)for(wt in arguments[gt])Object.prototype.hasOwnProperty.call(arguments[gt],wt)&&vt[wt]===void 0&&(vt[wt]=arguments[gt][wt]);return vt},$.prepareContent=function(gt,wt,vt,_t,$t){return lt.Promise.resolve(wt).then(function(Pt){return c.blob&&(Pt instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(Pt))!==-1)&&typeof FileReader<"u"?new lt.Promise(function(Nt,Lt){var Ft=new FileReader;Ft.onload=function(Jt){Nt(Jt.target.result)},Ft.onerror=function(Jt){Lt(Jt.target.error)},Ft.readAsArrayBuffer(Pt)}):Pt}).then(function(Pt){var Nt=$.getTypeOf(Pt);return Nt?(Nt==="arraybuffer"?Pt=$.transformTo("uint8array",Pt):Nt==="string"&&($t?Pt=nt.decode(Pt):vt&&_t!==!0&&(Pt=function(Lt){return it(Lt,c.uint8array?new Uint8Array(Lt.length):new Array(Lt.length))}(Pt))),Pt):lt.Promise.reject(new Error("Can't read the data of '"+gt+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(s,a,$){var c=s("./reader/readerFor"),nt=s("./utils"),at=s("./signature"),lt=s("./zipEntry"),et=s("./support");function it(st){this.files=[],this.loadOptions=st}it.prototype={checkSignature:function(st){if(!this.reader.readAndCheckSignature(st)){this.reader.index-=4;var ct=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+nt.pretty(ct)+", expected "+nt.pretty(st)+")")}},isSignature:function(st,ct){var ft=this.reader.index;this.reader.setIndex(st);var pt=this.reader.readString(4)===ct;return this.reader.setIndex(ft),pt},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var st=this.reader.readData(this.zipCommentLength),ct=et.uint8array?"uint8array":"array",ft=nt.transformTo(ct,st);this.zipComment=this.loadOptions.decodeFileName(ft)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var st,ct,ft,pt=this.zip64EndOfCentralSize-44;0<pt;)st=this.reader.readInt(2),ct=this.reader.readInt(4),ft=this.reader.readData(ct),this.zip64ExtensibleData[st]={id:st,length:ct,value:ft}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var st,ct;for(st=0;st<this.files.length;st++)ct=this.files[st],this.reader.setIndex(ct.localHeaderOffset),this.checkSignature(at.LOCAL_FILE_HEADER),ct.readLocalPart(this.reader),ct.handleUTF8(),ct.processAttributes()},readCentralDir:function(){var st;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(at.CENTRAL_FILE_HEADER);)(st=new lt({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(st);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var st=this.reader.lastIndexOfSignature(at.CENTRAL_DIRECTORY_END);if(st<0)throw this.isSignature(0,at.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(st);var ct=st;if(this.checkSignature(at.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===nt.MAX_VALUE_16BITS||this.diskWithCentralDirStart===nt.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===nt.MAX_VALUE_16BITS||this.centralDirRecords===nt.MAX_VALUE_16BITS||this.centralDirSize===nt.MAX_VALUE_32BITS||this.centralDirOffset===nt.MAX_VALUE_32BITS){if(this.zip64=!0,(st=this.reader.lastIndexOfSignature(at.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(st),this.checkSignature(at.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,at.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(at.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(at.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var ft=this.centralDirOffset+this.centralDirSize;this.zip64&&(ft+=20,ft+=12+this.zip64EndOfCentralSize);var pt=ct-ft;if(0<pt)this.isSignature(ct,at.CENTRAL_FILE_HEADER)||(this.reader.zero=pt);else if(pt<0)throw new Error("Corrupted zip: missing "+Math.abs(pt)+" bytes.")},prepareReader:function(st){this.reader=c(st)},load:function(st){this.prepareReader(st),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},a.exports=it},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(s,a,$){var c=s("./reader/readerFor"),nt=s("./utils"),at=s("./compressedObject"),lt=s("./crc32"),et=s("./utf8"),it=s("./compressions"),st=s("./support");function ct(ft,pt){this.options=ft,this.loadOptions=pt}ct.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(ft){var pt,gt;if(ft.skip(22),this.fileNameLength=ft.readInt(2),gt=ft.readInt(2),this.fileName=ft.readData(this.fileNameLength),ft.skip(gt),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((pt=function(wt){for(var vt in it)if(Object.prototype.hasOwnProperty.call(it,vt)&&it[vt].magic===wt)return it[vt];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+nt.pretty(this.compressionMethod)+" unknown (inner file : "+nt.transformTo("string",this.fileName)+")");this.decompressed=new at(this.compressedSize,this.uncompressedSize,this.crc32,pt,ft.readData(this.compressedSize))},readCentralPart:function(ft){this.versionMadeBy=ft.readInt(2),ft.skip(2),this.bitFlag=ft.readInt(2),this.compressionMethod=ft.readString(2),this.date=ft.readDate(),this.crc32=ft.readInt(4),this.compressedSize=ft.readInt(4),this.uncompressedSize=ft.readInt(4);var pt=ft.readInt(2);if(this.extraFieldsLength=ft.readInt(2),this.fileCommentLength=ft.readInt(2),this.diskNumberStart=ft.readInt(2),this.internalFileAttributes=ft.readInt(2),this.externalFileAttributes=ft.readInt(4),this.localHeaderOffset=ft.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");ft.skip(pt),this.readExtraFields(ft),this.parseZIP64ExtraField(ft),this.fileComment=ft.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var ft=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),ft==0&&(this.dosPermissions=63&this.externalFileAttributes),ft==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var ft=c(this.extraFields[1].value);this.uncompressedSize===nt.MAX_VALUE_32BITS&&(this.uncompressedSize=ft.readInt(8)),this.compressedSize===nt.MAX_VALUE_32BITS&&(this.compressedSize=ft.readInt(8)),this.localHeaderOffset===nt.MAX_VALUE_32BITS&&(this.localHeaderOffset=ft.readInt(8)),this.diskNumberStart===nt.MAX_VALUE_32BITS&&(this.diskNumberStart=ft.readInt(4))}},readExtraFields:function(ft){var pt,gt,wt,vt=ft.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});ft.index+4<vt;)pt=ft.readInt(2),gt=ft.readInt(2),wt=ft.readData(gt),this.extraFields[pt]={id:pt,length:gt,value:wt};ft.setIndex(vt)},handleUTF8:function(){var ft=st.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=et.utf8decode(this.fileName),this.fileCommentStr=et.utf8decode(this.fileComment);else{var pt=this.findExtraFieldUnicodePath();if(pt!==null)this.fileNameStr=pt;else{var gt=nt.transformTo(ft,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(gt)}var wt=this.findExtraFieldUnicodeComment();if(wt!==null)this.fileCommentStr=wt;else{var vt=nt.transformTo(ft,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(vt)}}},findExtraFieldUnicodePath:function(){var ft=this.extraFields[28789];if(ft){var pt=c(ft.value);return pt.readInt(1)!==1||lt(this.fileName)!==pt.readInt(4)?null:et.utf8decode(pt.readData(ft.length-5))}return null},findExtraFieldUnicodeComment:function(){var ft=this.extraFields[25461];if(ft){var pt=c(ft.value);return pt.readInt(1)!==1||lt(this.fileComment)!==pt.readInt(4)?null:et.utf8decode(pt.readData(ft.length-5))}return null}},a.exports=ct},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(s,a,$){function c(pt,gt,wt){this.name=pt,this.dir=wt.dir,this.date=wt.date,this.comment=wt.comment,this.unixPermissions=wt.unixPermissions,this.dosPermissions=wt.dosPermissions,this._data=gt,this._dataBinary=wt.binary,this.options={compression:wt.compression,compressionOptions:wt.compressionOptions}}var nt=s("./stream/StreamHelper"),at=s("./stream/DataWorker"),lt=s("./utf8"),et=s("./compressedObject"),it=s("./stream/GenericWorker");c.prototype={internalStream:function(pt){var gt=null,wt="string";try{if(!pt)throw new Error("No output type specified.");var vt=(wt=pt.toLowerCase())==="string"||wt==="text";wt!=="binarystring"&&wt!=="text"||(wt="string"),gt=this._decompressWorker();var _t=!this._dataBinary;_t&&!vt&&(gt=gt.pipe(new lt.Utf8EncodeWorker)),!_t&&vt&&(gt=gt.pipe(new lt.Utf8DecodeWorker))}catch($t){(gt=new it("error")).error($t)}return new nt(gt,wt,"")},async:function(pt,gt){return this.internalStream(pt).accumulate(gt)},nodeStream:function(pt,gt){return this.internalStream(pt||"nodebuffer").toNodejsStream(gt)},_compressWorker:function(pt,gt){if(this._data instanceof et&&this._data.compression.magic===pt.magic)return this._data.getCompressedWorker();var wt=this._decompressWorker();return this._dataBinary||(wt=wt.pipe(new lt.Utf8EncodeWorker)),et.createWorkerFrom(wt,pt,gt)},_decompressWorker:function(){return this._data instanceof et?this._data.getContentWorker():this._data instanceof it?this._data:new at(this._data)}};for(var st=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],ct=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},ft=0;ft<st.length;ft++)c.prototype[st[ft]]=ct;a.exports=c},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(s,a,$){(function(c){var nt,at,lt=c.MutationObserver||c.WebKitMutationObserver;if(lt){var et=0,it=new lt(pt),st=c.document.createTextNode("");it.observe(st,{characterData:!0}),nt=function(){st.data=et=++et%2}}else if(c.setImmediate||c.MessageChannel===void 0)nt="document"in c&&"onreadystatechange"in c.document.createElement("script")?function(){var gt=c.document.createElement("script");gt.onreadystatechange=function(){pt(),gt.onreadystatechange=null,gt.parentNode.removeChild(gt),gt=null},c.document.documentElement.appendChild(gt)}:function(){setTimeout(pt,0)};else{var ct=new c.MessageChannel;ct.port1.onmessage=pt,nt=function(){ct.port2.postMessage(0)}}var ft=[];function pt(){var gt,wt;at=!0;for(var vt=ft.length;vt;){for(wt=ft,ft=[],gt=-1;++gt<vt;)wt[gt]();vt=ft.length}at=!1}a.exports=function(gt){ft.push(gt)!==1||at||nt()}}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(s,a,$){var c=s("immediate");function nt(){}var at={},lt=["REJECTED"],et=["FULFILLED"],it=["PENDING"];function st(vt){if(typeof vt!="function")throw new TypeError("resolver must be a function");this.state=it,this.queue=[],this.outcome=void 0,vt!==nt&&gt(this,vt)}function ct(vt,_t,$t){this.promise=vt,typeof _t=="function"&&(this.onFulfilled=_t,this.callFulfilled=this.otherCallFulfilled),typeof $t=="function"&&(this.onRejected=$t,this.callRejected=this.otherCallRejected)}function ft(vt,_t,$t){c(function(){var Pt;try{Pt=_t($t)}catch(Nt){return at.reject(vt,Nt)}Pt===vt?at.reject(vt,new TypeError("Cannot resolve promise with itself")):at.resolve(vt,Pt)})}function pt(vt){var _t=vt&&vt.then;if(vt&&(typeof vt=="object"||typeof vt=="function")&&typeof _t=="function")return function(){_t.apply(vt,arguments)}}function gt(vt,_t){var $t=!1;function Pt(Ft){$t||($t=!0,at.reject(vt,Ft))}function Nt(Ft){$t||($t=!0,at.resolve(vt,Ft))}var Lt=wt(function(){_t(Nt,Pt)});Lt.status==="error"&&Pt(Lt.value)}function wt(vt,_t){var $t={};try{$t.value=vt(_t),$t.status="success"}catch(Pt){$t.status="error",$t.value=Pt}return $t}(a.exports=st).prototype.finally=function(vt){if(typeof vt!="function")return this;var _t=this.constructor;return this.then(function($t){return _t.resolve(vt()).then(function(){return $t})},function($t){return _t.resolve(vt()).then(function(){throw $t})})},st.prototype.catch=function(vt){return this.then(null,vt)},st.prototype.then=function(vt,_t){if(typeof vt!="function"&&this.state===et||typeof _t!="function"&&this.state===lt)return this;var $t=new this.constructor(nt);return this.state!==it?ft($t,this.state===et?vt:_t,this.outcome):this.queue.push(new ct($t,vt,_t)),$t},ct.prototype.callFulfilled=function(vt){at.resolve(this.promise,vt)},ct.prototype.otherCallFulfilled=function(vt){ft(this.promise,this.onFulfilled,vt)},ct.prototype.callRejected=function(vt){at.reject(this.promise,vt)},ct.prototype.otherCallRejected=function(vt){ft(this.promise,this.onRejected,vt)},at.resolve=function(vt,_t){var $t=wt(pt,_t);if($t.status==="error")return at.reject(vt,$t.value);var Pt=$t.value;if(Pt)gt(vt,Pt);else{vt.state=et,vt.outcome=_t;for(var Nt=-1,Lt=vt.queue.length;++Nt<Lt;)vt.queue[Nt].callFulfilled(_t)}return vt},at.reject=function(vt,_t){vt.state=lt,vt.outcome=_t;for(var $t=-1,Pt=vt.queue.length;++$t<Pt;)vt.queue[$t].callRejected(_t);return vt},st.resolve=function(vt){return vt instanceof this?vt:at.resolve(new this(nt),vt)},st.reject=function(vt){var _t=new this(nt);return at.reject(_t,vt)},st.all=function(vt){var _t=this;if(Object.prototype.toString.call(vt)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $t=vt.length,Pt=!1;if(!$t)return this.resolve([]);for(var Nt=new Array($t),Lt=0,Ft=-1,Jt=new this(nt);++Ft<$t;)_r(vt[Ft],Ft);return Jt;function _r(wr,tn){_t.resolve(wr).then(function(Wt){Nt[tn]=Wt,++Lt!==$t||Pt||(Pt=!0,at.resolve(Jt,Nt))},function(Wt){Pt||(Pt=!0,at.reject(Jt,Wt))})}},st.race=function(vt){var _t=this;if(Object.prototype.toString.call(vt)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $t=vt.length,Pt=!1;if(!$t)return this.resolve([]);for(var Nt=-1,Lt=new this(nt);++Nt<$t;)Ft=vt[Nt],_t.resolve(Ft).then(function(Jt){Pt||(Pt=!0,at.resolve(Lt,Jt))},function(Jt){Pt||(Pt=!0,at.reject(Lt,Jt))});var Ft;return Lt}},{immediate:36}],38:[function(s,a,$){var c={};(0,s("./lib/utils/common").assign)(c,s("./lib/deflate"),s("./lib/inflate"),s("./lib/zlib/constants")),a.exports=c},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(s,a,$){var c=s("./zlib/deflate"),nt=s("./utils/common"),at=s("./utils/strings"),lt=s("./zlib/messages"),et=s("./zlib/zstream"),it=Object.prototype.toString,st=0,ct=-1,ft=0,pt=8;function gt(vt){if(!(this instanceof gt))return new gt(vt);this.options=nt.assign({level:ct,method:pt,chunkSize:16384,windowBits:15,memLevel:8,strategy:ft,to:""},vt||{});var _t=this.options;_t.raw&&0<_t.windowBits?_t.windowBits=-_t.windowBits:_t.gzip&&0<_t.windowBits&&_t.windowBits<16&&(_t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new et,this.strm.avail_out=0;var $t=c.deflateInit2(this.strm,_t.level,_t.method,_t.windowBits,_t.memLevel,_t.strategy);if($t!==st)throw new Error(lt[$t]);if(_t.header&&c.deflateSetHeader(this.strm,_t.header),_t.dictionary){var Pt;if(Pt=typeof _t.dictionary=="string"?at.string2buf(_t.dictionary):it.call(_t.dictionary)==="[object ArrayBuffer]"?new Uint8Array(_t.dictionary):_t.dictionary,($t=c.deflateSetDictionary(this.strm,Pt))!==st)throw new Error(lt[$t]);this._dict_set=!0}}function wt(vt,_t){var $t=new gt(_t);if($t.push(vt,!0),$t.err)throw $t.msg||lt[$t.err];return $t.result}gt.prototype.push=function(vt,_t){var $t,Pt,Nt=this.strm,Lt=this.options.chunkSize;if(this.ended)return!1;Pt=_t===~~_t?_t:_t===!0?4:0,typeof vt=="string"?Nt.input=at.string2buf(vt):it.call(vt)==="[object ArrayBuffer]"?Nt.input=new Uint8Array(vt):Nt.input=vt,Nt.next_in=0,Nt.avail_in=Nt.input.length;do{if(Nt.avail_out===0&&(Nt.output=new nt.Buf8(Lt),Nt.next_out=0,Nt.avail_out=Lt),($t=c.deflate(Nt,Pt))!==1&&$t!==st)return this.onEnd($t),!(this.ended=!0);Nt.avail_out!==0&&(Nt.avail_in!==0||Pt!==4&&Pt!==2)||(this.options.to==="string"?this.onData(at.buf2binstring(nt.shrinkBuf(Nt.output,Nt.next_out))):this.onData(nt.shrinkBuf(Nt.output,Nt.next_out)))}while((0<Nt.avail_in||Nt.avail_out===0)&&$t!==1);return Pt===4?($t=c.deflateEnd(this.strm),this.onEnd($t),this.ended=!0,$t===st):Pt!==2||(this.onEnd(st),!(Nt.avail_out=0))},gt.prototype.onData=function(vt){this.chunks.push(vt)},gt.prototype.onEnd=function(vt){vt===st&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nt.flattenChunks(this.chunks)),this.chunks=[],this.err=vt,this.msg=this.strm.msg},$.Deflate=gt,$.deflate=wt,$.deflateRaw=function(vt,_t){return(_t=_t||{}).raw=!0,wt(vt,_t)},$.gzip=function(vt,_t){return(_t=_t||{}).gzip=!0,wt(vt,_t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(s,a,$){var c=s("./zlib/inflate"),nt=s("./utils/common"),at=s("./utils/strings"),lt=s("./zlib/constants"),et=s("./zlib/messages"),it=s("./zlib/zstream"),st=s("./zlib/gzheader"),ct=Object.prototype.toString;function ft(gt){if(!(this instanceof ft))return new ft(gt);this.options=nt.assign({chunkSize:16384,windowBits:0,to:""},gt||{});var wt=this.options;wt.raw&&0<=wt.windowBits&&wt.windowBits<16&&(wt.windowBits=-wt.windowBits,wt.windowBits===0&&(wt.windowBits=-15)),!(0<=wt.windowBits&&wt.windowBits<16)||gt&&gt.windowBits||(wt.windowBits+=32),15<wt.windowBits&&wt.windowBits<48&&!(15&wt.windowBits)&&(wt.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new it,this.strm.avail_out=0;var vt=c.inflateInit2(this.strm,wt.windowBits);if(vt!==lt.Z_OK)throw new Error(et[vt]);this.header=new st,c.inflateGetHeader(this.strm,this.header)}function pt(gt,wt){var vt=new ft(wt);if(vt.push(gt,!0),vt.err)throw vt.msg||et[vt.err];return vt.result}ft.prototype.push=function(gt,wt){var vt,_t,$t,Pt,Nt,Lt,Ft=this.strm,Jt=this.options.chunkSize,_r=this.options.dictionary,wr=!1;if(this.ended)return!1;_t=wt===~~wt?wt:wt===!0?lt.Z_FINISH:lt.Z_NO_FLUSH,typeof gt=="string"?Ft.input=at.binstring2buf(gt):ct.call(gt)==="[object ArrayBuffer]"?Ft.input=new Uint8Array(gt):Ft.input=gt,Ft.next_in=0,Ft.avail_in=Ft.input.length;do{if(Ft.avail_out===0&&(Ft.output=new nt.Buf8(Jt),Ft.next_out=0,Ft.avail_out=Jt),(vt=c.inflate(Ft,lt.Z_NO_FLUSH))===lt.Z_NEED_DICT&&_r&&(Lt=typeof _r=="string"?at.string2buf(_r):ct.call(_r)==="[object ArrayBuffer]"?new Uint8Array(_r):_r,vt=c.inflateSetDictionary(this.strm,Lt)),vt===lt.Z_BUF_ERROR&&wr===!0&&(vt=lt.Z_OK,wr=!1),vt!==lt.Z_STREAM_END&&vt!==lt.Z_OK)return this.onEnd(vt),!(this.ended=!0);Ft.next_out&&(Ft.avail_out!==0&&vt!==lt.Z_STREAM_END&&(Ft.avail_in!==0||_t!==lt.Z_FINISH&&_t!==lt.Z_SYNC_FLUSH)||(this.options.to==="string"?($t=at.utf8border(Ft.output,Ft.next_out),Pt=Ft.next_out-$t,Nt=at.buf2string(Ft.output,$t),Ft.next_out=Pt,Ft.avail_out=Jt-Pt,Pt&&nt.arraySet(Ft.output,Ft.output,$t,Pt,0),this.onData(Nt)):this.onData(nt.shrinkBuf(Ft.output,Ft.next_out)))),Ft.avail_in===0&&Ft.avail_out===0&&(wr=!0)}while((0<Ft.avail_in||Ft.avail_out===0)&&vt!==lt.Z_STREAM_END);return vt===lt.Z_STREAM_END&&(_t=lt.Z_FINISH),_t===lt.Z_FINISH?(vt=c.inflateEnd(this.strm),this.onEnd(vt),this.ended=!0,vt===lt.Z_OK):_t!==lt.Z_SYNC_FLUSH||(this.onEnd(lt.Z_OK),!(Ft.avail_out=0))},ft.prototype.onData=function(gt){this.chunks.push(gt)},ft.prototype.onEnd=function(gt){gt===lt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nt.flattenChunks(this.chunks)),this.chunks=[],this.err=gt,this.msg=this.strm.msg},$.Inflate=ft,$.inflate=pt,$.inflateRaw=function(gt,wt){return(wt=wt||{}).raw=!0,pt(gt,wt)},$.ungzip=pt},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(s,a,$){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";$.assign=function(lt){for(var et=Array.prototype.slice.call(arguments,1);et.length;){var it=et.shift();if(it){if(typeof it!="object")throw new TypeError(it+"must be non-object");for(var st in it)it.hasOwnProperty(st)&&(lt[st]=it[st])}}return lt},$.shrinkBuf=function(lt,et){return lt.length===et?lt:lt.subarray?lt.subarray(0,et):(lt.length=et,lt)};var nt={arraySet:function(lt,et,it,st,ct){if(et.subarray&&lt.subarray)lt.set(et.subarray(it,it+st),ct);else for(var ft=0;ft<st;ft++)lt[ct+ft]=et[it+ft]},flattenChunks:function(lt){var et,it,st,ct,ft,pt;for(et=st=0,it=lt.length;et<it;et++)st+=lt[et].length;for(pt=new Uint8Array(st),et=ct=0,it=lt.length;et<it;et++)ft=lt[et],pt.set(ft,ct),ct+=ft.length;return pt}},at={arraySet:function(lt,et,it,st,ct){for(var ft=0;ft<st;ft++)lt[ct+ft]=et[it+ft]},flattenChunks:function(lt){return[].concat.apply([],lt)}};$.setTyped=function(lt){lt?($.Buf8=Uint8Array,$.Buf16=Uint16Array,$.Buf32=Int32Array,$.assign($,nt)):($.Buf8=Array,$.Buf16=Array,$.Buf32=Array,$.assign($,at))},$.setTyped(c)},{}],42:[function(s,a,$){var c=s("./common"),nt=!0,at=!0;try{String.fromCharCode.apply(null,[0])}catch{nt=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{at=!1}for(var lt=new c.Buf8(256),et=0;et<256;et++)lt[et]=252<=et?6:248<=et?5:240<=et?4:224<=et?3:192<=et?2:1;function it(st,ct){if(ct<65537&&(st.subarray&&at||!st.subarray&&nt))return String.fromCharCode.apply(null,c.shrinkBuf(st,ct));for(var ft="",pt=0;pt<ct;pt++)ft+=String.fromCharCode(st[pt]);return ft}lt[254]=lt[254]=1,$.string2buf=function(st){var ct,ft,pt,gt,wt,vt=st.length,_t=0;for(gt=0;gt<vt;gt++)(64512&(ft=st.charCodeAt(gt)))==55296&&gt+1<vt&&(64512&(pt=st.charCodeAt(gt+1)))==56320&&(ft=65536+(ft-55296<<10)+(pt-56320),gt++),_t+=ft<128?1:ft<2048?2:ft<65536?3:4;for(ct=new c.Buf8(_t),gt=wt=0;wt<_t;gt++)(64512&(ft=st.charCodeAt(gt)))==55296&&gt+1<vt&&(64512&(pt=st.charCodeAt(gt+1)))==56320&&(ft=65536+(ft-55296<<10)+(pt-56320),gt++),ft<128?ct[wt++]=ft:(ft<2048?ct[wt++]=192|ft>>>6:(ft<65536?ct[wt++]=224|ft>>>12:(ct[wt++]=240|ft>>>18,ct[wt++]=128|ft>>>12&63),ct[wt++]=128|ft>>>6&63),ct[wt++]=128|63&ft);return ct},$.buf2binstring=function(st){return it(st,st.length)},$.binstring2buf=function(st){for(var ct=new c.Buf8(st.length),ft=0,pt=ct.length;ft<pt;ft++)ct[ft]=st.charCodeAt(ft);return ct},$.buf2string=function(st,ct){var ft,pt,gt,wt,vt=ct||st.length,_t=new Array(2*vt);for(ft=pt=0;ft<vt;)if((gt=st[ft++])<128)_t[pt++]=gt;else if(4<(wt=lt[gt]))_t[pt++]=65533,ft+=wt-1;else{for(gt&=wt===2?31:wt===3?15:7;1<wt&&ft<vt;)gt=gt<<6|63&st[ft++],wt--;1<wt?_t[pt++]=65533:gt<65536?_t[pt++]=gt:(gt-=65536,_t[pt++]=55296|gt>>10&1023,_t[pt++]=56320|1023&gt)}return it(_t,pt)},$.utf8border=function(st,ct){var ft;for((ct=ct||st.length)>st.length&&(ct=st.length),ft=ct-1;0<=ft&&(192&st[ft])==128;)ft--;return ft<0||ft===0?ct:ft+lt[st[ft]]>ct?ft:ct}},{"./common":41}],43:[function(s,a,$){a.exports=function(c,nt,at,lt){for(var et=65535&c|0,it=c>>>16&65535|0,st=0;at!==0;){for(at-=st=2e3<at?2e3:at;it=it+(et=et+nt[lt++]|0)|0,--st;);et%=65521,it%=65521}return et|it<<16|0}},{}],44:[function(s,a,$){a.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(s,a,$){var c=function(){for(var nt,at=[],lt=0;lt<256;lt++){nt=lt;for(var et=0;et<8;et++)nt=1&nt?3988292384^nt>>>1:nt>>>1;at[lt]=nt}return at}();a.exports=function(nt,at,lt,et){var it=c,st=et+lt;nt^=-1;for(var ct=et;ct<st;ct++)nt=nt>>>8^it[255&(nt^at[ct])];return-1^nt}},{}],46:[function(s,a,$){var c,nt=s("../utils/common"),at=s("./trees"),lt=s("./adler32"),et=s("./crc32"),it=s("./messages"),st=0,ct=4,ft=0,pt=-2,gt=-1,wt=4,vt=2,_t=8,$t=9,Pt=286,Nt=30,Lt=19,Ft=2*Pt+1,Jt=15,_r=3,wr=258,tn=wr+_r+1,Wt=42,Yr=113,Ot=1,gr=2,$o=3,In=4;function en(Dt,Eo){return Dt.msg=it[Eo],Eo}function Lr(Dt){return(Dt<<1)-(4<Dt?9:0)}function ko(Dt){for(var Eo=Dt.length;0<=--Eo;)Dt[Eo]=0}function Ir(Dt){var Eo=Dt.state,Jr=Eo.pending;Jr>Dt.avail_out&&(Jr=Dt.avail_out),Jr!==0&&(nt.arraySet(Dt.output,Eo.pending_buf,Eo.pending_out,Jr,Dt.next_out),Dt.next_out+=Jr,Eo.pending_out+=Jr,Dt.total_out+=Jr,Dt.avail_out-=Jr,Eo.pending-=Jr,Eo.pending===0&&(Eo.pending_out=0))}function Dr(Dt,Eo){at._tr_flush_block(Dt,0<=Dt.block_start?Dt.block_start:-1,Dt.strstart-Dt.block_start,Eo),Dt.block_start=Dt.strstart,Ir(Dt.strm)}function Zr(Dt,Eo){Dt.pending_buf[Dt.pending++]=Eo}function rn(Dt,Eo){Dt.pending_buf[Dt.pending++]=Eo>>>8&255,Dt.pending_buf[Dt.pending++]=255&Eo}function On(Dt,Eo){var Jr,ar,er=Dt.max_chain_length,vr=Dt.strstart,_o=Dt.prev_length,nn=Dt.nice_match,Kr=Dt.strstart>Dt.w_size-tn?Dt.strstart-(Dt.w_size-tn):0,Io=Dt.window,Bo=Dt.w_mask,Ao=Dt.prev,Qo=Dt.strstart+wr,So=Io[vr+_o-1],vn=Io[vr+_o];Dt.prev_length>=Dt.good_match&&(er>>=2),nn>Dt.lookahead&&(nn=Dt.lookahead);do if(Io[(Jr=Eo)+_o]===vn&&Io[Jr+_o-1]===So&&Io[Jr]===Io[vr]&&Io[++Jr]===Io[vr+1]){vr+=2,Jr++;do;while(Io[++vr]===Io[++Jr]&&Io[++vr]===Io[++Jr]&&Io[++vr]===Io[++Jr]&&Io[++vr]===Io[++Jr]&&Io[++vr]===Io[++Jr]&&Io[++vr]===Io[++Jr]&&Io[++vr]===Io[++Jr]&&Io[++vr]===Io[++Jr]&&vr<Qo);if(ar=wr-(Qo-vr),vr=Qo-wr,_o<ar){if(Dt.match_start=Eo,nn<=(_o=ar))break;So=Io[vr+_o-1],vn=Io[vr+_o]}}while((Eo=Ao[Eo&Bo])>Kr&&--er!=0);return _o<=Dt.lookahead?_o:Dt.lookahead}function zo(Dt){var Eo,Jr,ar,er,vr,_o,nn,Kr,Io,Bo,Ao=Dt.w_size;do{if(er=Dt.window_size-Dt.lookahead-Dt.strstart,Dt.strstart>=Ao+(Ao-tn)){for(nt.arraySet(Dt.window,Dt.window,Ao,Ao,0),Dt.match_start-=Ao,Dt.strstart-=Ao,Dt.block_start-=Ao,Eo=Jr=Dt.hash_size;ar=Dt.head[--Eo],Dt.head[Eo]=Ao<=ar?ar-Ao:0,--Jr;);for(Eo=Jr=Ao;ar=Dt.prev[--Eo],Dt.prev[Eo]=Ao<=ar?ar-Ao:0,--Jr;);er+=Ao}if(Dt.strm.avail_in===0)break;if(_o=Dt.strm,nn=Dt.window,Kr=Dt.strstart+Dt.lookahead,Io=er,Bo=void 0,Bo=_o.avail_in,Io<Bo&&(Bo=Io),Jr=Bo===0?0:(_o.avail_in-=Bo,nt.arraySet(nn,_o.input,_o.next_in,Bo,Kr),_o.state.wrap===1?_o.adler=lt(_o.adler,nn,Bo,Kr):_o.state.wrap===2&&(_o.adler=et(_o.adler,nn,Bo,Kr)),_o.next_in+=Bo,_o.total_in+=Bo,Bo),Dt.lookahead+=Jr,Dt.lookahead+Dt.insert>=_r)for(vr=Dt.strstart-Dt.insert,Dt.ins_h=Dt.window[vr],Dt.ins_h=(Dt.ins_h<<Dt.hash_shift^Dt.window[vr+1])&Dt.hash_mask;Dt.insert&&(Dt.ins_h=(Dt.ins_h<<Dt.hash_shift^Dt.window[vr+_r-1])&Dt.hash_mask,Dt.prev[vr&Dt.w_mask]=Dt.head[Dt.ins_h],Dt.head[Dt.ins_h]=vr,vr++,Dt.insert--,!(Dt.lookahead+Dt.insert<_r)););}while(Dt.lookahead<tn&&Dt.strm.avail_in!==0)}function Yo(Dt,Eo){for(var Jr,ar;;){if(Dt.lookahead<tn){if(zo(Dt),Dt.lookahead<tn&&Eo===st)return Ot;if(Dt.lookahead===0)break}if(Jr=0,Dt.lookahead>=_r&&(Dt.ins_h=(Dt.ins_h<<Dt.hash_shift^Dt.window[Dt.strstart+_r-1])&Dt.hash_mask,Jr=Dt.prev[Dt.strstart&Dt.w_mask]=Dt.head[Dt.ins_h],Dt.head[Dt.ins_h]=Dt.strstart),Jr!==0&&Dt.strstart-Jr<=Dt.w_size-tn&&(Dt.match_length=On(Dt,Jr)),Dt.match_length>=_r)if(ar=at._tr_tally(Dt,Dt.strstart-Dt.match_start,Dt.match_length-_r),Dt.lookahead-=Dt.match_length,Dt.match_length<=Dt.max_lazy_match&&Dt.lookahead>=_r){for(Dt.match_length--;Dt.strstart++,Dt.ins_h=(Dt.ins_h<<Dt.hash_shift^Dt.window[Dt.strstart+_r-1])&Dt.hash_mask,Jr=Dt.prev[Dt.strstart&Dt.w_mask]=Dt.head[Dt.ins_h],Dt.head[Dt.ins_h]=Dt.strstart,--Dt.match_length!=0;);Dt.strstart++}else Dt.strstart+=Dt.match_length,Dt.match_length=0,Dt.ins_h=Dt.window[Dt.strstart],Dt.ins_h=(Dt.ins_h<<Dt.hash_shift^Dt.window[Dt.strstart+1])&Dt.hash_mask;else ar=at._tr_tally(Dt,0,Dt.window[Dt.strstart]),Dt.lookahead--,Dt.strstart++;if(ar&&(Dr(Dt,!1),Dt.strm.avail_out===0))return Ot}return Dt.insert=Dt.strstart<_r-1?Dt.strstart:_r-1,Eo===ct?(Dr(Dt,!0),Dt.strm.avail_out===0?$o:In):Dt.last_lit&&(Dr(Dt,!1),Dt.strm.avail_out===0)?Ot:gr}function jo(Dt,Eo){for(var Jr,ar,er;;){if(Dt.lookahead<tn){if(zo(Dt),Dt.lookahead<tn&&Eo===st)return Ot;if(Dt.lookahead===0)break}if(Jr=0,Dt.lookahead>=_r&&(Dt.ins_h=(Dt.ins_h<<Dt.hash_shift^Dt.window[Dt.strstart+_r-1])&Dt.hash_mask,Jr=Dt.prev[Dt.strstart&Dt.w_mask]=Dt.head[Dt.ins_h],Dt.head[Dt.ins_h]=Dt.strstart),Dt.prev_length=Dt.match_length,Dt.prev_match=Dt.match_start,Dt.match_length=_r-1,Jr!==0&&Dt.prev_length<Dt.max_lazy_match&&Dt.strstart-Jr<=Dt.w_size-tn&&(Dt.match_length=On(Dt,Jr),Dt.match_length<=5&&(Dt.strategy===1||Dt.match_length===_r&&4096<Dt.strstart-Dt.match_start)&&(Dt.match_length=_r-1)),Dt.prev_length>=_r&&Dt.match_length<=Dt.prev_length){for(er=Dt.strstart+Dt.lookahead-_r,ar=at._tr_tally(Dt,Dt.strstart-1-Dt.prev_match,Dt.prev_length-_r),Dt.lookahead-=Dt.prev_length-1,Dt.prev_length-=2;++Dt.strstart<=er&&(Dt.ins_h=(Dt.ins_h<<Dt.hash_shift^Dt.window[Dt.strstart+_r-1])&Dt.hash_mask,Jr=Dt.prev[Dt.strstart&Dt.w_mask]=Dt.head[Dt.ins_h],Dt.head[Dt.ins_h]=Dt.strstart),--Dt.prev_length!=0;);if(Dt.match_available=0,Dt.match_length=_r-1,Dt.strstart++,ar&&(Dr(Dt,!1),Dt.strm.avail_out===0))return Ot}else if(Dt.match_available){if((ar=at._tr_tally(Dt,0,Dt.window[Dt.strstart-1]))&&Dr(Dt,!1),Dt.strstart++,Dt.lookahead--,Dt.strm.avail_out===0)return Ot}else Dt.match_available=1,Dt.strstart++,Dt.lookahead--}return Dt.match_available&&(ar=at._tr_tally(Dt,0,Dt.window[Dt.strstart-1]),Dt.match_available=0),Dt.insert=Dt.strstart<_r-1?Dt.strstart:_r-1,Eo===ct?(Dr(Dt,!0),Dt.strm.avail_out===0?$o:In):Dt.last_lit&&(Dr(Dt,!1),Dt.strm.avail_out===0)?Ot:gr}function Ko(Dt,Eo,Jr,ar,er){this.good_length=Dt,this.max_lazy=Eo,this.nice_length=Jr,this.max_chain=ar,this.func=er}function Zo(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new nt.Buf16(2*Ft),this.dyn_dtree=new nt.Buf16(2*(2*Nt+1)),this.bl_tree=new nt.Buf16(2*(2*Lt+1)),ko(this.dyn_ltree),ko(this.dyn_dtree),ko(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new nt.Buf16(Jt+1),this.heap=new nt.Buf16(2*Pt+1),ko(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new nt.Buf16(2*Pt+1),ko(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Fo(Dt){var Eo;return Dt&&Dt.state?(Dt.total_in=Dt.total_out=0,Dt.data_type=vt,(Eo=Dt.state).pending=0,Eo.pending_out=0,Eo.wrap<0&&(Eo.wrap=-Eo.wrap),Eo.status=Eo.wrap?Wt:Yr,Dt.adler=Eo.wrap===2?0:1,Eo.last_flush=st,at._tr_init(Eo),ft):en(Dt,pt)}function Js(Dt){var Eo=Fo(Dt);return Eo===ft&&function(Jr){Jr.window_size=2*Jr.w_size,ko(Jr.head),Jr.max_lazy_match=c[Jr.level].max_lazy,Jr.good_match=c[Jr.level].good_length,Jr.nice_match=c[Jr.level].nice_length,Jr.max_chain_length=c[Jr.level].max_chain,Jr.strstart=0,Jr.block_start=0,Jr.lookahead=0,Jr.insert=0,Jr.match_length=Jr.prev_length=_r-1,Jr.match_available=0,Jr.ins_h=0}(Dt.state),Eo}function Ks(Dt,Eo,Jr,ar,er,vr){if(!Dt)return pt;var _o=1;if(Eo===gt&&(Eo=6),ar<0?(_o=0,ar=-ar):15<ar&&(_o=2,ar-=16),er<1||$t<er||Jr!==_t||ar<8||15<ar||Eo<0||9<Eo||vr<0||wt<vr)return en(Dt,pt);ar===8&&(ar=9);var nn=new Zo;return(Dt.state=nn).strm=Dt,nn.wrap=_o,nn.gzhead=null,nn.w_bits=ar,nn.w_size=1<<nn.w_bits,nn.w_mask=nn.w_size-1,nn.hash_bits=er+7,nn.hash_size=1<<nn.hash_bits,nn.hash_mask=nn.hash_size-1,nn.hash_shift=~~((nn.hash_bits+_r-1)/_r),nn.window=new nt.Buf8(2*nn.w_size),nn.head=new nt.Buf16(nn.hash_size),nn.prev=new nt.Buf16(nn.w_size),nn.lit_bufsize=1<<er+6,nn.pending_buf_size=4*nn.lit_bufsize,nn.pending_buf=new nt.Buf8(nn.pending_buf_size),nn.d_buf=1*nn.lit_bufsize,nn.l_buf=3*nn.lit_bufsize,nn.level=Eo,nn.strategy=vr,nn.method=Jr,Js(Dt)}c=[new Ko(0,0,0,0,function(Dt,Eo){var Jr=65535;for(Jr>Dt.pending_buf_size-5&&(Jr=Dt.pending_buf_size-5);;){if(Dt.lookahead<=1){if(zo(Dt),Dt.lookahead===0&&Eo===st)return Ot;if(Dt.lookahead===0)break}Dt.strstart+=Dt.lookahead,Dt.lookahead=0;var ar=Dt.block_start+Jr;if((Dt.strstart===0||Dt.strstart>=ar)&&(Dt.lookahead=Dt.strstart-ar,Dt.strstart=ar,Dr(Dt,!1),Dt.strm.avail_out===0)||Dt.strstart-Dt.block_start>=Dt.w_size-tn&&(Dr(Dt,!1),Dt.strm.avail_out===0))return Ot}return Dt.insert=0,Eo===ct?(Dr(Dt,!0),Dt.strm.avail_out===0?$o:In):(Dt.strstart>Dt.block_start&&(Dr(Dt,!1),Dt.strm.avail_out),Ot)}),new Ko(4,4,8,4,Yo),new Ko(4,5,16,8,Yo),new Ko(4,6,32,32,Yo),new Ko(4,4,16,16,jo),new Ko(8,16,32,32,jo),new Ko(8,16,128,128,jo),new Ko(8,32,128,256,jo),new Ko(32,128,258,1024,jo),new Ko(32,258,258,4096,jo)],$.deflateInit=function(Dt,Eo){return Ks(Dt,Eo,_t,15,8,0)},$.deflateInit2=Ks,$.deflateReset=Js,$.deflateResetKeep=Fo,$.deflateSetHeader=function(Dt,Eo){return Dt&&Dt.state?Dt.state.wrap!==2?pt:(Dt.state.gzhead=Eo,ft):pt},$.deflate=function(Dt,Eo){var Jr,ar,er,vr;if(!Dt||!Dt.state||5<Eo||Eo<0)return Dt?en(Dt,pt):pt;if(ar=Dt.state,!Dt.output||!Dt.input&&Dt.avail_in!==0||ar.status===666&&Eo!==ct)return en(Dt,Dt.avail_out===0?-5:pt);if(ar.strm=Dt,Jr=ar.last_flush,ar.last_flush=Eo,ar.status===Wt)if(ar.wrap===2)Dt.adler=0,Zr(ar,31),Zr(ar,139),Zr(ar,8),ar.gzhead?(Zr(ar,(ar.gzhead.text?1:0)+(ar.gzhead.hcrc?2:0)+(ar.gzhead.extra?4:0)+(ar.gzhead.name?8:0)+(ar.gzhead.comment?16:0)),Zr(ar,255&ar.gzhead.time),Zr(ar,ar.gzhead.time>>8&255),Zr(ar,ar.gzhead.time>>16&255),Zr(ar,ar.gzhead.time>>24&255),Zr(ar,ar.level===9?2:2<=ar.strategy||ar.level<2?4:0),Zr(ar,255&ar.gzhead.os),ar.gzhead.extra&&ar.gzhead.extra.length&&(Zr(ar,255&ar.gzhead.extra.length),Zr(ar,ar.gzhead.extra.length>>8&255)),ar.gzhead.hcrc&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending,0)),ar.gzindex=0,ar.status=69):(Zr(ar,0),Zr(ar,0),Zr(ar,0),Zr(ar,0),Zr(ar,0),Zr(ar,ar.level===9?2:2<=ar.strategy||ar.level<2?4:0),Zr(ar,3),ar.status=Yr);else{var _o=_t+(ar.w_bits-8<<4)<<8;_o|=(2<=ar.strategy||ar.level<2?0:ar.level<6?1:ar.level===6?2:3)<<6,ar.strstart!==0&&(_o|=32),_o+=31-_o%31,ar.status=Yr,rn(ar,_o),ar.strstart!==0&&(rn(ar,Dt.adler>>>16),rn(ar,65535&Dt.adler)),Dt.adler=1}if(ar.status===69)if(ar.gzhead.extra){for(er=ar.pending;ar.gzindex<(65535&ar.gzhead.extra.length)&&(ar.pending!==ar.pending_buf_size||(ar.gzhead.hcrc&&ar.pending>er&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),Ir(Dt),er=ar.pending,ar.pending!==ar.pending_buf_size));)Zr(ar,255&ar.gzhead.extra[ar.gzindex]),ar.gzindex++;ar.gzhead.hcrc&&ar.pending>er&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),ar.gzindex===ar.gzhead.extra.length&&(ar.gzindex=0,ar.status=73)}else ar.status=73;if(ar.status===73)if(ar.gzhead.name){er=ar.pending;do{if(ar.pending===ar.pending_buf_size&&(ar.gzhead.hcrc&&ar.pending>er&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),Ir(Dt),er=ar.pending,ar.pending===ar.pending_buf_size)){vr=1;break}vr=ar.gzindex<ar.gzhead.name.length?255&ar.gzhead.name.charCodeAt(ar.gzindex++):0,Zr(ar,vr)}while(vr!==0);ar.gzhead.hcrc&&ar.pending>er&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),vr===0&&(ar.gzindex=0,ar.status=91)}else ar.status=91;if(ar.status===91)if(ar.gzhead.comment){er=ar.pending;do{if(ar.pending===ar.pending_buf_size&&(ar.gzhead.hcrc&&ar.pending>er&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),Ir(Dt),er=ar.pending,ar.pending===ar.pending_buf_size)){vr=1;break}vr=ar.gzindex<ar.gzhead.comment.length?255&ar.gzhead.comment.charCodeAt(ar.gzindex++):0,Zr(ar,vr)}while(vr!==0);ar.gzhead.hcrc&&ar.pending>er&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),vr===0&&(ar.status=103)}else ar.status=103;if(ar.status===103&&(ar.gzhead.hcrc?(ar.pending+2>ar.pending_buf_size&&Ir(Dt),ar.pending+2<=ar.pending_buf_size&&(Zr(ar,255&Dt.adler),Zr(ar,Dt.adler>>8&255),Dt.adler=0,ar.status=Yr)):ar.status=Yr),ar.pending!==0){if(Ir(Dt),Dt.avail_out===0)return ar.last_flush=-1,ft}else if(Dt.avail_in===0&&Lr(Eo)<=Lr(Jr)&&Eo!==ct)return en(Dt,-5);if(ar.status===666&&Dt.avail_in!==0)return en(Dt,-5);if(Dt.avail_in!==0||ar.lookahead!==0||Eo!==st&&ar.status!==666){var nn=ar.strategy===2?function(Kr,Io){for(var Bo;;){if(Kr.lookahead===0&&(zo(Kr),Kr.lookahead===0)){if(Io===st)return Ot;break}if(Kr.match_length=0,Bo=at._tr_tally(Kr,0,Kr.window[Kr.strstart]),Kr.lookahead--,Kr.strstart++,Bo&&(Dr(Kr,!1),Kr.strm.avail_out===0))return Ot}return Kr.insert=0,Io===ct?(Dr(Kr,!0),Kr.strm.avail_out===0?$o:In):Kr.last_lit&&(Dr(Kr,!1),Kr.strm.avail_out===0)?Ot:gr}(ar,Eo):ar.strategy===3?function(Kr,Io){for(var Bo,Ao,Qo,So,vn=Kr.window;;){if(Kr.lookahead<=wr){if(zo(Kr),Kr.lookahead<=wr&&Io===st)return Ot;if(Kr.lookahead===0)break}if(Kr.match_length=0,Kr.lookahead>=_r&&0<Kr.strstart&&(Ao=vn[Qo=Kr.strstart-1])===vn[++Qo]&&Ao===vn[++Qo]&&Ao===vn[++Qo]){So=Kr.strstart+wr;do;while(Ao===vn[++Qo]&&Ao===vn[++Qo]&&Ao===vn[++Qo]&&Ao===vn[++Qo]&&Ao===vn[++Qo]&&Ao===vn[++Qo]&&Ao===vn[++Qo]&&Ao===vn[++Qo]&&Qo<So);Kr.match_length=wr-(So-Qo),Kr.match_length>Kr.lookahead&&(Kr.match_length=Kr.lookahead)}if(Kr.match_length>=_r?(Bo=at._tr_tally(Kr,1,Kr.match_length-_r),Kr.lookahead-=Kr.match_length,Kr.strstart+=Kr.match_length,Kr.match_length=0):(Bo=at._tr_tally(Kr,0,Kr.window[Kr.strstart]),Kr.lookahead--,Kr.strstart++),Bo&&(Dr(Kr,!1),Kr.strm.avail_out===0))return Ot}return Kr.insert=0,Io===ct?(Dr(Kr,!0),Kr.strm.avail_out===0?$o:In):Kr.last_lit&&(Dr(Kr,!1),Kr.strm.avail_out===0)?Ot:gr}(ar,Eo):c[ar.level].func(ar,Eo);if(nn!==$o&&nn!==In||(ar.status=666),nn===Ot||nn===$o)return Dt.avail_out===0&&(ar.last_flush=-1),ft;if(nn===gr&&(Eo===1?at._tr_align(ar):Eo!==5&&(at._tr_stored_block(ar,0,0,!1),Eo===3&&(ko(ar.head),ar.lookahead===0&&(ar.strstart=0,ar.block_start=0,ar.insert=0))),Ir(Dt),Dt.avail_out===0))return ar.last_flush=-1,ft}return Eo!==ct?ft:ar.wrap<=0?1:(ar.wrap===2?(Zr(ar,255&Dt.adler),Zr(ar,Dt.adler>>8&255),Zr(ar,Dt.adler>>16&255),Zr(ar,Dt.adler>>24&255),Zr(ar,255&Dt.total_in),Zr(ar,Dt.total_in>>8&255),Zr(ar,Dt.total_in>>16&255),Zr(ar,Dt.total_in>>24&255)):(rn(ar,Dt.adler>>>16),rn(ar,65535&Dt.adler)),Ir(Dt),0<ar.wrap&&(ar.wrap=-ar.wrap),ar.pending!==0?ft:1)},$.deflateEnd=function(Dt){var Eo;return Dt&&Dt.state?(Eo=Dt.state.status)!==Wt&&Eo!==69&&Eo!==73&&Eo!==91&&Eo!==103&&Eo!==Yr&&Eo!==666?en(Dt,pt):(Dt.state=null,Eo===Yr?en(Dt,-3):ft):pt},$.deflateSetDictionary=function(Dt,Eo){var Jr,ar,er,vr,_o,nn,Kr,Io,Bo=Eo.length;if(!Dt||!Dt.state||(vr=(Jr=Dt.state).wrap)===2||vr===1&&Jr.status!==Wt||Jr.lookahead)return pt;for(vr===1&&(Dt.adler=lt(Dt.adler,Eo,Bo,0)),Jr.wrap=0,Bo>=Jr.w_size&&(vr===0&&(ko(Jr.head),Jr.strstart=0,Jr.block_start=0,Jr.insert=0),Io=new nt.Buf8(Jr.w_size),nt.arraySet(Io,Eo,Bo-Jr.w_size,Jr.w_size,0),Eo=Io,Bo=Jr.w_size),_o=Dt.avail_in,nn=Dt.next_in,Kr=Dt.input,Dt.avail_in=Bo,Dt.next_in=0,Dt.input=Eo,zo(Jr);Jr.lookahead>=_r;){for(ar=Jr.strstart,er=Jr.lookahead-(_r-1);Jr.ins_h=(Jr.ins_h<<Jr.hash_shift^Jr.window[ar+_r-1])&Jr.hash_mask,Jr.prev[ar&Jr.w_mask]=Jr.head[Jr.ins_h],Jr.head[Jr.ins_h]=ar,ar++,--er;);Jr.strstart=ar,Jr.lookahead=_r-1,zo(Jr)}return Jr.strstart+=Jr.lookahead,Jr.block_start=Jr.strstart,Jr.insert=Jr.lookahead,Jr.lookahead=0,Jr.match_length=Jr.prev_length=_r-1,Jr.match_available=0,Dt.next_in=nn,Dt.input=Kr,Dt.avail_in=_o,Jr.wrap=vr,ft},$.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(s,a,$){a.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(s,a,$){a.exports=function(c,nt){var at,lt,et,it,st,ct,ft,pt,gt,wt,vt,_t,$t,Pt,Nt,Lt,Ft,Jt,_r,wr,tn,Wt,Yr,Ot,gr;at=c.state,lt=c.next_in,Ot=c.input,et=lt+(c.avail_in-5),it=c.next_out,gr=c.output,st=it-(nt-c.avail_out),ct=it+(c.avail_out-257),ft=at.dmax,pt=at.wsize,gt=at.whave,wt=at.wnext,vt=at.window,_t=at.hold,$t=at.bits,Pt=at.lencode,Nt=at.distcode,Lt=(1<<at.lenbits)-1,Ft=(1<<at.distbits)-1;e:do{$t<15&&(_t+=Ot[lt++]<<$t,$t+=8,_t+=Ot[lt++]<<$t,$t+=8),Jt=Pt[_t&Lt];t:for(;;){if(_t>>>=_r=Jt>>>24,$t-=_r,(_r=Jt>>>16&255)===0)gr[it++]=65535&Jt;else{if(!(16&_r)){if(!(64&_r)){Jt=Pt[(65535&Jt)+(_t&(1<<_r)-1)];continue t}if(32&_r){at.mode=12;break e}c.msg="invalid literal/length code",at.mode=30;break e}wr=65535&Jt,(_r&=15)&&($t<_r&&(_t+=Ot[lt++]<<$t,$t+=8),wr+=_t&(1<<_r)-1,_t>>>=_r,$t-=_r),$t<15&&(_t+=Ot[lt++]<<$t,$t+=8,_t+=Ot[lt++]<<$t,$t+=8),Jt=Nt[_t&Ft];r:for(;;){if(_t>>>=_r=Jt>>>24,$t-=_r,!(16&(_r=Jt>>>16&255))){if(!(64&_r)){Jt=Nt[(65535&Jt)+(_t&(1<<_r)-1)];continue r}c.msg="invalid distance code",at.mode=30;break e}if(tn=65535&Jt,$t<(_r&=15)&&(_t+=Ot[lt++]<<$t,($t+=8)<_r&&(_t+=Ot[lt++]<<$t,$t+=8)),ft<(tn+=_t&(1<<_r)-1)){c.msg="invalid distance too far back",at.mode=30;break e}if(_t>>>=_r,$t-=_r,(_r=it-st)<tn){if(gt<(_r=tn-_r)&&at.sane){c.msg="invalid distance too far back",at.mode=30;break e}if(Yr=vt,(Wt=0)===wt){if(Wt+=pt-_r,_r<wr){for(wr-=_r;gr[it++]=vt[Wt++],--_r;);Wt=it-tn,Yr=gr}}else if(wt<_r){if(Wt+=pt+wt-_r,(_r-=wt)<wr){for(wr-=_r;gr[it++]=vt[Wt++],--_r;);if(Wt=0,wt<wr){for(wr-=_r=wt;gr[it++]=vt[Wt++],--_r;);Wt=it-tn,Yr=gr}}}else if(Wt+=wt-_r,_r<wr){for(wr-=_r;gr[it++]=vt[Wt++],--_r;);Wt=it-tn,Yr=gr}for(;2<wr;)gr[it++]=Yr[Wt++],gr[it++]=Yr[Wt++],gr[it++]=Yr[Wt++],wr-=3;wr&&(gr[it++]=Yr[Wt++],1<wr&&(gr[it++]=Yr[Wt++]))}else{for(Wt=it-tn;gr[it++]=gr[Wt++],gr[it++]=gr[Wt++],gr[it++]=gr[Wt++],2<(wr-=3););wr&&(gr[it++]=gr[Wt++],1<wr&&(gr[it++]=gr[Wt++]))}break}}break}}while(lt<et&&it<ct);lt-=wr=$t>>3,_t&=(1<<($t-=wr<<3))-1,c.next_in=lt,c.next_out=it,c.avail_in=lt<et?et-lt+5:5-(lt-et),c.avail_out=it<ct?ct-it+257:257-(it-ct),at.hold=_t,at.bits=$t}},{}],49:[function(s,a,$){var c=s("../utils/common"),nt=s("./adler32"),at=s("./crc32"),lt=s("./inffast"),et=s("./inftrees"),it=1,st=2,ct=0,ft=-2,pt=1,gt=852,wt=592;function vt(Wt){return(Wt>>>24&255)+(Wt>>>8&65280)+((65280&Wt)<<8)+((255&Wt)<<24)}function _t(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function $t(Wt){var Yr;return Wt&&Wt.state?(Yr=Wt.state,Wt.total_in=Wt.total_out=Yr.total=0,Wt.msg="",Yr.wrap&&(Wt.adler=1&Yr.wrap),Yr.mode=pt,Yr.last=0,Yr.havedict=0,Yr.dmax=32768,Yr.head=null,Yr.hold=0,Yr.bits=0,Yr.lencode=Yr.lendyn=new c.Buf32(gt),Yr.distcode=Yr.distdyn=new c.Buf32(wt),Yr.sane=1,Yr.back=-1,ct):ft}function Pt(Wt){var Yr;return Wt&&Wt.state?((Yr=Wt.state).wsize=0,Yr.whave=0,Yr.wnext=0,$t(Wt)):ft}function Nt(Wt,Yr){var Ot,gr;return Wt&&Wt.state?(gr=Wt.state,Yr<0?(Ot=0,Yr=-Yr):(Ot=1+(Yr>>4),Yr<48&&(Yr&=15)),Yr&&(Yr<8||15<Yr)?ft:(gr.window!==null&&gr.wbits!==Yr&&(gr.window=null),gr.wrap=Ot,gr.wbits=Yr,Pt(Wt))):ft}function Lt(Wt,Yr){var Ot,gr;return Wt?(gr=new _t,(Wt.state=gr).window=null,(Ot=Nt(Wt,Yr))!==ct&&(Wt.state=null),Ot):ft}var Ft,Jt,_r=!0;function wr(Wt){if(_r){var Yr;for(Ft=new c.Buf32(512),Jt=new c.Buf32(32),Yr=0;Yr<144;)Wt.lens[Yr++]=8;for(;Yr<256;)Wt.lens[Yr++]=9;for(;Yr<280;)Wt.lens[Yr++]=7;for(;Yr<288;)Wt.lens[Yr++]=8;for(et(it,Wt.lens,0,288,Ft,0,Wt.work,{bits:9}),Yr=0;Yr<32;)Wt.lens[Yr++]=5;et(st,Wt.lens,0,32,Jt,0,Wt.work,{bits:5}),_r=!1}Wt.lencode=Ft,Wt.lenbits=9,Wt.distcode=Jt,Wt.distbits=5}function tn(Wt,Yr,Ot,gr){var $o,In=Wt.state;return In.window===null&&(In.wsize=1<<In.wbits,In.wnext=0,In.whave=0,In.window=new c.Buf8(In.wsize)),gr>=In.wsize?(c.arraySet(In.window,Yr,Ot-In.wsize,In.wsize,0),In.wnext=0,In.whave=In.wsize):(gr<($o=In.wsize-In.wnext)&&($o=gr),c.arraySet(In.window,Yr,Ot-gr,$o,In.wnext),(gr-=$o)?(c.arraySet(In.window,Yr,Ot-gr,gr,0),In.wnext=gr,In.whave=In.wsize):(In.wnext+=$o,In.wnext===In.wsize&&(In.wnext=0),In.whave<In.wsize&&(In.whave+=$o))),0}$.inflateReset=Pt,$.inflateReset2=Nt,$.inflateResetKeep=$t,$.inflateInit=function(Wt){return Lt(Wt,15)},$.inflateInit2=Lt,$.inflate=function(Wt,Yr){var Ot,gr,$o,In,en,Lr,ko,Ir,Dr,Zr,rn,On,zo,Yo,jo,Ko,Zo,Fo,Js,Ks,Dt,Eo,Jr,ar,er=0,vr=new c.Buf8(4),_o=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Wt||!Wt.state||!Wt.output||!Wt.input&&Wt.avail_in!==0)return ft;(Ot=Wt.state).mode===12&&(Ot.mode=13),en=Wt.next_out,$o=Wt.output,ko=Wt.avail_out,In=Wt.next_in,gr=Wt.input,Lr=Wt.avail_in,Ir=Ot.hold,Dr=Ot.bits,Zr=Lr,rn=ko,Eo=ct;e:for(;;)switch(Ot.mode){case pt:if(Ot.wrap===0){Ot.mode=13;break}for(;Dr<16;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(2&Ot.wrap&&Ir===35615){vr[Ot.check=0]=255&Ir,vr[1]=Ir>>>8&255,Ot.check=at(Ot.check,vr,2,0),Dr=Ir=0,Ot.mode=2;break}if(Ot.flags=0,Ot.head&&(Ot.head.done=!1),!(1&Ot.wrap)||(((255&Ir)<<8)+(Ir>>8))%31){Wt.msg="incorrect header check",Ot.mode=30;break}if((15&Ir)!=8){Wt.msg="unknown compression method",Ot.mode=30;break}if(Dr-=4,Dt=8+(15&(Ir>>>=4)),Ot.wbits===0)Ot.wbits=Dt;else if(Dt>Ot.wbits){Wt.msg="invalid window size",Ot.mode=30;break}Ot.dmax=1<<Dt,Wt.adler=Ot.check=1,Ot.mode=512&Ir?10:12,Dr=Ir=0;break;case 2:for(;Dr<16;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(Ot.flags=Ir,(255&Ot.flags)!=8){Wt.msg="unknown compression method",Ot.mode=30;break}if(57344&Ot.flags){Wt.msg="unknown header flags set",Ot.mode=30;break}Ot.head&&(Ot.head.text=Ir>>8&1),512&Ot.flags&&(vr[0]=255&Ir,vr[1]=Ir>>>8&255,Ot.check=at(Ot.check,vr,2,0)),Dr=Ir=0,Ot.mode=3;case 3:for(;Dr<32;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ot.head&&(Ot.head.time=Ir),512&Ot.flags&&(vr[0]=255&Ir,vr[1]=Ir>>>8&255,vr[2]=Ir>>>16&255,vr[3]=Ir>>>24&255,Ot.check=at(Ot.check,vr,4,0)),Dr=Ir=0,Ot.mode=4;case 4:for(;Dr<16;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ot.head&&(Ot.head.xflags=255&Ir,Ot.head.os=Ir>>8),512&Ot.flags&&(vr[0]=255&Ir,vr[1]=Ir>>>8&255,Ot.check=at(Ot.check,vr,2,0)),Dr=Ir=0,Ot.mode=5;case 5:if(1024&Ot.flags){for(;Dr<16;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ot.length=Ir,Ot.head&&(Ot.head.extra_len=Ir),512&Ot.flags&&(vr[0]=255&Ir,vr[1]=Ir>>>8&255,Ot.check=at(Ot.check,vr,2,0)),Dr=Ir=0}else Ot.head&&(Ot.head.extra=null);Ot.mode=6;case 6:if(1024&Ot.flags&&(Lr<(On=Ot.length)&&(On=Lr),On&&(Ot.head&&(Dt=Ot.head.extra_len-Ot.length,Ot.head.extra||(Ot.head.extra=new Array(Ot.head.extra_len)),c.arraySet(Ot.head.extra,gr,In,On,Dt)),512&Ot.flags&&(Ot.check=at(Ot.check,gr,On,In)),Lr-=On,In+=On,Ot.length-=On),Ot.length))break e;Ot.length=0,Ot.mode=7;case 7:if(2048&Ot.flags){if(Lr===0)break e;for(On=0;Dt=gr[In+On++],Ot.head&&Dt&&Ot.length<65536&&(Ot.head.name+=String.fromCharCode(Dt)),Dt&&On<Lr;);if(512&Ot.flags&&(Ot.check=at(Ot.check,gr,On,In)),Lr-=On,In+=On,Dt)break e}else Ot.head&&(Ot.head.name=null);Ot.length=0,Ot.mode=8;case 8:if(4096&Ot.flags){if(Lr===0)break e;for(On=0;Dt=gr[In+On++],Ot.head&&Dt&&Ot.length<65536&&(Ot.head.comment+=String.fromCharCode(Dt)),Dt&&On<Lr;);if(512&Ot.flags&&(Ot.check=at(Ot.check,gr,On,In)),Lr-=On,In+=On,Dt)break e}else Ot.head&&(Ot.head.comment=null);Ot.mode=9;case 9:if(512&Ot.flags){for(;Dr<16;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(Ir!==(65535&Ot.check)){Wt.msg="header crc mismatch",Ot.mode=30;break}Dr=Ir=0}Ot.head&&(Ot.head.hcrc=Ot.flags>>9&1,Ot.head.done=!0),Wt.adler=Ot.check=0,Ot.mode=12;break;case 10:for(;Dr<32;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Wt.adler=Ot.check=vt(Ir),Dr=Ir=0,Ot.mode=11;case 11:if(Ot.havedict===0)return Wt.next_out=en,Wt.avail_out=ko,Wt.next_in=In,Wt.avail_in=Lr,Ot.hold=Ir,Ot.bits=Dr,2;Wt.adler=Ot.check=1,Ot.mode=12;case 12:if(Yr===5||Yr===6)break e;case 13:if(Ot.last){Ir>>>=7&Dr,Dr-=7&Dr,Ot.mode=27;break}for(;Dr<3;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}switch(Ot.last=1&Ir,Dr-=1,3&(Ir>>>=1)){case 0:Ot.mode=14;break;case 1:if(wr(Ot),Ot.mode=20,Yr!==6)break;Ir>>>=2,Dr-=2;break e;case 2:Ot.mode=17;break;case 3:Wt.msg="invalid block type",Ot.mode=30}Ir>>>=2,Dr-=2;break;case 14:for(Ir>>>=7&Dr,Dr-=7&Dr;Dr<32;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if((65535&Ir)!=(Ir>>>16^65535)){Wt.msg="invalid stored block lengths",Ot.mode=30;break}if(Ot.length=65535&Ir,Dr=Ir=0,Ot.mode=15,Yr===6)break e;case 15:Ot.mode=16;case 16:if(On=Ot.length){if(Lr<On&&(On=Lr),ko<On&&(On=ko),On===0)break e;c.arraySet($o,gr,In,On,en),Lr-=On,In+=On,ko-=On,en+=On,Ot.length-=On;break}Ot.mode=12;break;case 17:for(;Dr<14;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(Ot.nlen=257+(31&Ir),Ir>>>=5,Dr-=5,Ot.ndist=1+(31&Ir),Ir>>>=5,Dr-=5,Ot.ncode=4+(15&Ir),Ir>>>=4,Dr-=4,286<Ot.nlen||30<Ot.ndist){Wt.msg="too many length or distance symbols",Ot.mode=30;break}Ot.have=0,Ot.mode=18;case 18:for(;Ot.have<Ot.ncode;){for(;Dr<3;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ot.lens[_o[Ot.have++]]=7&Ir,Ir>>>=3,Dr-=3}for(;Ot.have<19;)Ot.lens[_o[Ot.have++]]=0;if(Ot.lencode=Ot.lendyn,Ot.lenbits=7,Jr={bits:Ot.lenbits},Eo=et(0,Ot.lens,0,19,Ot.lencode,0,Ot.work,Jr),Ot.lenbits=Jr.bits,Eo){Wt.msg="invalid code lengths set",Ot.mode=30;break}Ot.have=0,Ot.mode=19;case 19:for(;Ot.have<Ot.nlen+Ot.ndist;){for(;Ko=(er=Ot.lencode[Ir&(1<<Ot.lenbits)-1])>>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(Zo<16)Ir>>>=jo,Dr-=jo,Ot.lens[Ot.have++]=Zo;else{if(Zo===16){for(ar=jo+2;Dr<ar;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(Ir>>>=jo,Dr-=jo,Ot.have===0){Wt.msg="invalid bit length repeat",Ot.mode=30;break}Dt=Ot.lens[Ot.have-1],On=3+(3&Ir),Ir>>>=2,Dr-=2}else if(Zo===17){for(ar=jo+3;Dr<ar;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Dr-=jo,Dt=0,On=3+(7&(Ir>>>=jo)),Ir>>>=3,Dr-=3}else{for(ar=jo+7;Dr<ar;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Dr-=jo,Dt=0,On=11+(127&(Ir>>>=jo)),Ir>>>=7,Dr-=7}if(Ot.have+On>Ot.nlen+Ot.ndist){Wt.msg="invalid bit length repeat",Ot.mode=30;break}for(;On--;)Ot.lens[Ot.have++]=Dt}}if(Ot.mode===30)break;if(Ot.lens[256]===0){Wt.msg="invalid code -- missing end-of-block",Ot.mode=30;break}if(Ot.lenbits=9,Jr={bits:Ot.lenbits},Eo=et(it,Ot.lens,0,Ot.nlen,Ot.lencode,0,Ot.work,Jr),Ot.lenbits=Jr.bits,Eo){Wt.msg="invalid literal/lengths set",Ot.mode=30;break}if(Ot.distbits=6,Ot.distcode=Ot.distdyn,Jr={bits:Ot.distbits},Eo=et(st,Ot.lens,Ot.nlen,Ot.ndist,Ot.distcode,0,Ot.work,Jr),Ot.distbits=Jr.bits,Eo){Wt.msg="invalid distances set",Ot.mode=30;break}if(Ot.mode=20,Yr===6)break e;case 20:Ot.mode=21;case 21:if(6<=Lr&&258<=ko){Wt.next_out=en,Wt.avail_out=ko,Wt.next_in=In,Wt.avail_in=Lr,Ot.hold=Ir,Ot.bits=Dr,lt(Wt,rn),en=Wt.next_out,$o=Wt.output,ko=Wt.avail_out,In=Wt.next_in,gr=Wt.input,Lr=Wt.avail_in,Ir=Ot.hold,Dr=Ot.bits,Ot.mode===12&&(Ot.back=-1);break}for(Ot.back=0;Ko=(er=Ot.lencode[Ir&(1<<Ot.lenbits)-1])>>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(Ko&&!(240&Ko)){for(Fo=jo,Js=Ko,Ks=Zo;Ko=(er=Ot.lencode[Ks+((Ir&(1<<Fo+Js)-1)>>Fo)])>>>16&255,Zo=65535&er,!(Fo+(jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ir>>>=Fo,Dr-=Fo,Ot.back+=Fo}if(Ir>>>=jo,Dr-=jo,Ot.back+=jo,Ot.length=Zo,Ko===0){Ot.mode=26;break}if(32&Ko){Ot.back=-1,Ot.mode=12;break}if(64&Ko){Wt.msg="invalid literal/length code",Ot.mode=30;break}Ot.extra=15&Ko,Ot.mode=22;case 22:if(Ot.extra){for(ar=Ot.extra;Dr<ar;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ot.length+=Ir&(1<<Ot.extra)-1,Ir>>>=Ot.extra,Dr-=Ot.extra,Ot.back+=Ot.extra}Ot.was=Ot.length,Ot.mode=23;case 23:for(;Ko=(er=Ot.distcode[Ir&(1<<Ot.distbits)-1])>>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(!(240&Ko)){for(Fo=jo,Js=Ko,Ks=Zo;Ko=(er=Ot.distcode[Ks+((Ir&(1<<Fo+Js)-1)>>Fo)])>>>16&255,Zo=65535&er,!(Fo+(jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ir>>>=Fo,Dr-=Fo,Ot.back+=Fo}if(Ir>>>=jo,Dr-=jo,Ot.back+=jo,64&Ko){Wt.msg="invalid distance code",Ot.mode=30;break}Ot.offset=Zo,Ot.extra=15&Ko,Ot.mode=24;case 24:if(Ot.extra){for(ar=Ot.extra;Dr<ar;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}Ot.offset+=Ir&(1<<Ot.extra)-1,Ir>>>=Ot.extra,Dr-=Ot.extra,Ot.back+=Ot.extra}if(Ot.offset>Ot.dmax){Wt.msg="invalid distance too far back",Ot.mode=30;break}Ot.mode=25;case 25:if(ko===0)break e;if(On=rn-ko,Ot.offset>On){if((On=Ot.offset-On)>Ot.whave&&Ot.sane){Wt.msg="invalid distance too far back",Ot.mode=30;break}zo=On>Ot.wnext?(On-=Ot.wnext,Ot.wsize-On):Ot.wnext-On,On>Ot.length&&(On=Ot.length),Yo=Ot.window}else Yo=$o,zo=en-Ot.offset,On=Ot.length;for(ko<On&&(On=ko),ko-=On,Ot.length-=On;$o[en++]=Yo[zo++],--On;);Ot.length===0&&(Ot.mode=21);break;case 26:if(ko===0)break e;$o[en++]=Ot.length,ko--,Ot.mode=21;break;case 27:if(Ot.wrap){for(;Dr<32;){if(Lr===0)break e;Lr--,Ir|=gr[In++]<<Dr,Dr+=8}if(rn-=ko,Wt.total_out+=rn,Ot.total+=rn,rn&&(Wt.adler=Ot.check=Ot.flags?at(Ot.check,$o,rn,en-rn):nt(Ot.check,$o,rn,en-rn)),rn=ko,(Ot.flags?Ir:vt(Ir))!==Ot.check){Wt.msg="incorrect data check",Ot.mode=30;break}Dr=Ir=0}Ot.mode=28;case 28:if(Ot.wrap&&Ot.flags){for(;Dr<32;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<<Dr,Dr+=8}if(Ir!==(4294967295&Ot.total)){Wt.msg="incorrect length check",Ot.mode=30;break}Dr=Ir=0}Ot.mode=29;case 29:Eo=1;break e;case 30:Eo=-3;break e;case 31:return-4;case 32:default:return ft}return Wt.next_out=en,Wt.avail_out=ko,Wt.next_in=In,Wt.avail_in=Lr,Ot.hold=Ir,Ot.bits=Dr,(Ot.wsize||rn!==Wt.avail_out&&Ot.mode<30&&(Ot.mode<27||Yr!==4))&&tn(Wt,Wt.output,Wt.next_out,rn-Wt.avail_out)?(Ot.mode=31,-4):(Zr-=Wt.avail_in,rn-=Wt.avail_out,Wt.total_in+=Zr,Wt.total_out+=rn,Ot.total+=rn,Ot.wrap&&rn&&(Wt.adler=Ot.check=Ot.flags?at(Ot.check,$o,rn,Wt.next_out-rn):nt(Ot.check,$o,rn,Wt.next_out-rn)),Wt.data_type=Ot.bits+(Ot.last?64:0)+(Ot.mode===12?128:0)+(Ot.mode===20||Ot.mode===15?256:0),(Zr==0&&rn===0||Yr===4)&&Eo===ct&&(Eo=-5),Eo)},$.inflateEnd=function(Wt){if(!Wt||!Wt.state)return ft;var Yr=Wt.state;return Yr.window&&(Yr.window=null),Wt.state=null,ct},$.inflateGetHeader=function(Wt,Yr){var Ot;return Wt&&Wt.state&&2&(Ot=Wt.state).wrap?((Ot.head=Yr).done=!1,ct):ft},$.inflateSetDictionary=function(Wt,Yr){var Ot,gr=Yr.length;return Wt&&Wt.state?(Ot=Wt.state).wrap!==0&&Ot.mode!==11?ft:Ot.mode===11&&nt(1,Yr,gr,0)!==Ot.check?-3:tn(Wt,Yr,gr,gr)?(Ot.mode=31,-4):(Ot.havedict=1,ct):ft},$.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(s,a,$){var c=s("../utils/common"),nt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],at=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],lt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],et=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];a.exports=function(it,st,ct,ft,pt,gt,wt,vt){var _t,$t,Pt,Nt,Lt,Ft,Jt,_r,wr,tn=vt.bits,Wt=0,Yr=0,Ot=0,gr=0,$o=0,In=0,en=0,Lr=0,ko=0,Ir=0,Dr=null,Zr=0,rn=new c.Buf16(16),On=new c.Buf16(16),zo=null,Yo=0;for(Wt=0;Wt<=15;Wt++)rn[Wt]=0;for(Yr=0;Yr<ft;Yr++)rn[st[ct+Yr]]++;for($o=tn,gr=15;1<=gr&&rn[gr]===0;gr--);if(gr<$o&&($o=gr),gr===0)return pt[gt++]=20971520,pt[gt++]=20971520,vt.bits=1,0;for(Ot=1;Ot<gr&&rn[Ot]===0;Ot++);for($o<Ot&&($o=Ot),Wt=Lr=1;Wt<=15;Wt++)if(Lr<<=1,(Lr-=rn[Wt])<0)return-1;if(0<Lr&&(it===0||gr!==1))return-1;for(On[1]=0,Wt=1;Wt<15;Wt++)On[Wt+1]=On[Wt]+rn[Wt];for(Yr=0;Yr<ft;Yr++)st[ct+Yr]!==0&&(wt[On[st[ct+Yr]]++]=Yr);if(Ft=it===0?(Dr=zo=wt,19):it===1?(Dr=nt,Zr-=257,zo=at,Yo-=257,256):(Dr=lt,zo=et,-1),Wt=Ot,Lt=gt,en=Yr=Ir=0,Pt=-1,Nt=(ko=1<<(In=$o))-1,it===1&&852<ko||it===2&&592<ko)return 1;for(;;){for(Jt=Wt-en,wr=wt[Yr]<Ft?(_r=0,wt[Yr]):wt[Yr]>Ft?(_r=zo[Yo+wt[Yr]],Dr[Zr+wt[Yr]]):(_r=96,0),_t=1<<Wt-en,Ot=$t=1<<In;pt[Lt+(Ir>>en)+($t-=_t)]=Jt<<24|_r<<16|wr|0,$t!==0;);for(_t=1<<Wt-1;Ir&_t;)_t>>=1;if(_t!==0?(Ir&=_t-1,Ir+=_t):Ir=0,Yr++,--rn[Wt]==0){if(Wt===gr)break;Wt=st[ct+wt[Yr]]}if($o<Wt&&(Ir&Nt)!==Pt){for(en===0&&(en=$o),Lt+=Ot,Lr=1<<(In=Wt-en);In+en<gr&&!((Lr-=rn[In+en])<=0);)In++,Lr<<=1;if(ko+=1<<In,it===1&&852<ko||it===2&&592<ko)return 1;pt[Pt=Ir&Nt]=$o<<24|In<<16|Lt-gt|0}}return Ir!==0&&(pt[Lt+Ir]=Wt-en<<24|64<<16|0),vt.bits=$o,0}},{"../utils/common":41}],51:[function(s,a,$){a.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(s,a,$){var c=s("../utils/common"),nt=0,at=1;function lt(er){for(var vr=er.length;0<=--vr;)er[vr]=0}var et=0,it=29,st=256,ct=st+1+it,ft=30,pt=19,gt=2*ct+1,wt=15,vt=16,_t=7,$t=256,Pt=16,Nt=17,Lt=18,Ft=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Jt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],wr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],tn=new Array(2*(ct+2));lt(tn);var Wt=new Array(2*ft);lt(Wt);var Yr=new Array(512);lt(Yr);var Ot=new Array(256);lt(Ot);var gr=new Array(it);lt(gr);var $o,In,en,Lr=new Array(ft);function ko(er,vr,_o,nn,Kr){this.static_tree=er,this.extra_bits=vr,this.extra_base=_o,this.elems=nn,this.max_length=Kr,this.has_stree=er&&er.length}function Ir(er,vr){this.dyn_tree=er,this.max_code=0,this.stat_desc=vr}function Dr(er){return er<256?Yr[er]:Yr[256+(er>>>7)]}function Zr(er,vr){er.pending_buf[er.pending++]=255&vr,er.pending_buf[er.pending++]=vr>>>8&255}function rn(er,vr,_o){er.bi_valid>vt-_o?(er.bi_buf|=vr<<er.bi_valid&65535,Zr(er,er.bi_buf),er.bi_buf=vr>>vt-er.bi_valid,er.bi_valid+=_o-vt):(er.bi_buf|=vr<<er.bi_valid&65535,er.bi_valid+=_o)}function On(er,vr,_o){rn(er,_o[2*vr],_o[2*vr+1])}function zo(er,vr){for(var _o=0;_o|=1&er,er>>>=1,_o<<=1,0<--vr;);return _o>>>1}function Yo(er,vr,_o){var nn,Kr,Io=new Array(wt+1),Bo=0;for(nn=1;nn<=wt;nn++)Io[nn]=Bo=Bo+_o[nn-1]<<1;for(Kr=0;Kr<=vr;Kr++){var Ao=er[2*Kr+1];Ao!==0&&(er[2*Kr]=zo(Io[Ao]++,Ao))}}function jo(er){var vr;for(vr=0;vr<ct;vr++)er.dyn_ltree[2*vr]=0;for(vr=0;vr<ft;vr++)er.dyn_dtree[2*vr]=0;for(vr=0;vr<pt;vr++)er.bl_tree[2*vr]=0;er.dyn_ltree[2*$t]=1,er.opt_len=er.static_len=0,er.last_lit=er.matches=0}function Ko(er){8<er.bi_valid?Zr(er,er.bi_buf):0<er.bi_valid&&(er.pending_buf[er.pending++]=er.bi_buf),er.bi_buf=0,er.bi_valid=0}function Zo(er,vr,_o,nn){var Kr=2*vr,Io=2*_o;return er[Kr]<er[Io]||er[Kr]===er[Io]&&nn[vr]<=nn[_o]}function Fo(er,vr,_o){for(var nn=er.heap[_o],Kr=_o<<1;Kr<=er.heap_len&&(Kr<er.heap_len&&Zo(vr,er.heap[Kr+1],er.heap[Kr],er.depth)&&Kr++,!Zo(vr,nn,er.heap[Kr],er.depth));)er.heap[_o]=er.heap[Kr],_o=Kr,Kr<<=1;er.heap[_o]=nn}function Js(er,vr,_o){var nn,Kr,Io,Bo,Ao=0;if(er.last_lit!==0)for(;nn=er.pending_buf[er.d_buf+2*Ao]<<8|er.pending_buf[er.d_buf+2*Ao+1],Kr=er.pending_buf[er.l_buf+Ao],Ao++,nn===0?On(er,Kr,vr):(On(er,(Io=Ot[Kr])+st+1,vr),(Bo=Ft[Io])!==0&&rn(er,Kr-=gr[Io],Bo),On(er,Io=Dr(--nn),_o),(Bo=Jt[Io])!==0&&rn(er,nn-=Lr[Io],Bo)),Ao<er.last_lit;);On(er,$t,vr)}function Ks(er,vr){var _o,nn,Kr,Io=vr.dyn_tree,Bo=vr.stat_desc.static_tree,Ao=vr.stat_desc.has_stree,Qo=vr.stat_desc.elems,So=-1;for(er.heap_len=0,er.heap_max=gt,_o=0;_o<Qo;_o++)Io[2*_o]!==0?(er.heap[++er.heap_len]=So=_o,er.depth[_o]=0):Io[2*_o+1]=0;for(;er.heap_len<2;)Io[2*(Kr=er.heap[++er.heap_len]=So<2?++So:0)]=1,er.depth[Kr]=0,er.opt_len--,Ao&&(er.static_len-=Bo[2*Kr+1]);for(vr.max_code=So,_o=er.heap_len>>1;1<=_o;_o--)Fo(er,Io,_o);for(Kr=Qo;_o=er.heap[1],er.heap[1]=er.heap[er.heap_len--],Fo(er,Io,1),nn=er.heap[1],er.heap[--er.heap_max]=_o,er.heap[--er.heap_max]=nn,Io[2*Kr]=Io[2*_o]+Io[2*nn],er.depth[Kr]=(er.depth[_o]>=er.depth[nn]?er.depth[_o]:er.depth[nn])+1,Io[2*_o+1]=Io[2*nn+1]=Kr,er.heap[1]=Kr++,Fo(er,Io,1),2<=er.heap_len;);er.heap[--er.heap_max]=er.heap[1],function(vn,Do){var Xo,Lo,Jo,Xs,na,ba,ga=Do.dyn_tree,eu=Do.max_code,mu=Do.stat_desc.static_tree,gu=Do.stat_desc.has_stree,Tu=Do.stat_desc.extra_bits,yu=Do.stat_desc.extra_base,iu=Do.stat_desc.max_length,uu=0;for(Xs=0;Xs<=wt;Xs++)vn.bl_count[Xs]=0;for(ga[2*vn.heap[vn.heap_max]+1]=0,Xo=vn.heap_max+1;Xo<gt;Xo++)iu<(Xs=ga[2*ga[2*(Lo=vn.heap[Xo])+1]+1]+1)&&(Xs=iu,uu++),ga[2*Lo+1]=Xs,eu<Lo||(vn.bl_count[Xs]++,na=0,yu<=Lo&&(na=Tu[Lo-yu]),ba=ga[2*Lo],vn.opt_len+=ba*(Xs+na),gu&&(vn.static_len+=ba*(mu[2*Lo+1]+na)));if(uu!==0){do{for(Xs=iu-1;vn.bl_count[Xs]===0;)Xs--;vn.bl_count[Xs]--,vn.bl_count[Xs+1]+=2,vn.bl_count[iu]--,uu-=2}while(0<uu);for(Xs=iu;Xs!==0;Xs--)for(Lo=vn.bl_count[Xs];Lo!==0;)eu<(Jo=vn.heap[--Xo])||(ga[2*Jo+1]!==Xs&&(vn.opt_len+=(Xs-ga[2*Jo+1])*ga[2*Jo],ga[2*Jo+1]=Xs),Lo--)}}(er,vr),Yo(Io,So,er.bl_count)}function Dt(er,vr,_o){var nn,Kr,Io=-1,Bo=vr[1],Ao=0,Qo=7,So=4;for(Bo===0&&(Qo=138,So=3),vr[2*(_o+1)+1]=65535,nn=0;nn<=_o;nn++)Kr=Bo,Bo=vr[2*(nn+1)+1],++Ao<Qo&&Kr===Bo||(Ao<So?er.bl_tree[2*Kr]+=Ao:Kr!==0?(Kr!==Io&&er.bl_tree[2*Kr]++,er.bl_tree[2*Pt]++):Ao<=10?er.bl_tree[2*Nt]++:er.bl_tree[2*Lt]++,Io=Kr,So=(Ao=0)===Bo?(Qo=138,3):Kr===Bo?(Qo=6,3):(Qo=7,4))}function Eo(er,vr,_o){var nn,Kr,Io=-1,Bo=vr[1],Ao=0,Qo=7,So=4;for(Bo===0&&(Qo=138,So=3),nn=0;nn<=_o;nn++)if(Kr=Bo,Bo=vr[2*(nn+1)+1],!(++Ao<Qo&&Kr===Bo)){if(Ao<So)for(;On(er,Kr,er.bl_tree),--Ao!=0;);else Kr!==0?(Kr!==Io&&(On(er,Kr,er.bl_tree),Ao--),On(er,Pt,er.bl_tree),rn(er,Ao-3,2)):Ao<=10?(On(er,Nt,er.bl_tree),rn(er,Ao-3,3)):(On(er,Lt,er.bl_tree),rn(er,Ao-11,7));Io=Kr,So=(Ao=0)===Bo?(Qo=138,3):Kr===Bo?(Qo=6,3):(Qo=7,4)}}lt(Lr);var Jr=!1;function ar(er,vr,_o,nn){rn(er,(et<<1)+(nn?1:0),3),function(Kr,Io,Bo,Ao){Ko(Kr),Zr(Kr,Bo),Zr(Kr,~Bo),c.arraySet(Kr.pending_buf,Kr.window,Io,Bo,Kr.pending),Kr.pending+=Bo}(er,vr,_o)}$._tr_init=function(er){Jr||(function(){var vr,_o,nn,Kr,Io,Bo=new Array(wt+1);for(Kr=nn=0;Kr<it-1;Kr++)for(gr[Kr]=nn,vr=0;vr<1<<Ft[Kr];vr++)Ot[nn++]=Kr;for(Ot[nn-1]=Kr,Kr=Io=0;Kr<16;Kr++)for(Lr[Kr]=Io,vr=0;vr<1<<Jt[Kr];vr++)Yr[Io++]=Kr;for(Io>>=7;Kr<ft;Kr++)for(Lr[Kr]=Io<<7,vr=0;vr<1<<Jt[Kr]-7;vr++)Yr[256+Io++]=Kr;for(_o=0;_o<=wt;_o++)Bo[_o]=0;for(vr=0;vr<=143;)tn[2*vr+1]=8,vr++,Bo[8]++;for(;vr<=255;)tn[2*vr+1]=9,vr++,Bo[9]++;for(;vr<=279;)tn[2*vr+1]=7,vr++,Bo[7]++;for(;vr<=287;)tn[2*vr+1]=8,vr++,Bo[8]++;for(Yo(tn,ct+1,Bo),vr=0;vr<ft;vr++)Wt[2*vr+1]=5,Wt[2*vr]=zo(vr,5);$o=new ko(tn,Ft,st+1,ct,wt),In=new ko(Wt,Jt,0,ft,wt),en=new ko(new Array(0),_r,0,pt,_t)}(),Jr=!0),er.l_desc=new Ir(er.dyn_ltree,$o),er.d_desc=new Ir(er.dyn_dtree,In),er.bl_desc=new Ir(er.bl_tree,en),er.bi_buf=0,er.bi_valid=0,jo(er)},$._tr_stored_block=ar,$._tr_flush_block=function(er,vr,_o,nn){var Kr,Io,Bo=0;0<er.level?(er.strm.data_type===2&&(er.strm.data_type=function(Ao){var Qo,So=4093624447;for(Qo=0;Qo<=31;Qo++,So>>>=1)if(1&So&&Ao.dyn_ltree[2*Qo]!==0)return nt;if(Ao.dyn_ltree[18]!==0||Ao.dyn_ltree[20]!==0||Ao.dyn_ltree[26]!==0)return at;for(Qo=32;Qo<st;Qo++)if(Ao.dyn_ltree[2*Qo]!==0)return at;return nt}(er)),Ks(er,er.l_desc),Ks(er,er.d_desc),Bo=function(Ao){var Qo;for(Dt(Ao,Ao.dyn_ltree,Ao.l_desc.max_code),Dt(Ao,Ao.dyn_dtree,Ao.d_desc.max_code),Ks(Ao,Ao.bl_desc),Qo=pt-1;3<=Qo&&Ao.bl_tree[2*wr[Qo]+1]===0;Qo--);return Ao.opt_len+=3*(Qo+1)+5+5+4,Qo}(er),Kr=er.opt_len+3+7>>>3,(Io=er.static_len+3+7>>>3)<=Kr&&(Kr=Io)):Kr=Io=_o+5,_o+4<=Kr&&vr!==-1?ar(er,vr,_o,nn):er.strategy===4||Io===Kr?(rn(er,2+(nn?1:0),3),Js(er,tn,Wt)):(rn(er,4+(nn?1:0),3),function(Ao,Qo,So,vn){var Do;for(rn(Ao,Qo-257,5),rn(Ao,So-1,5),rn(Ao,vn-4,4),Do=0;Do<vn;Do++)rn(Ao,Ao.bl_tree[2*wr[Do]+1],3);Eo(Ao,Ao.dyn_ltree,Qo-1),Eo(Ao,Ao.dyn_dtree,So-1)}(er,er.l_desc.max_code+1,er.d_desc.max_code+1,Bo+1),Js(er,er.dyn_ltree,er.dyn_dtree)),jo(er),nn&&Ko(er)},$._tr_tally=function(er,vr,_o){return er.pending_buf[er.d_buf+2*er.last_lit]=vr>>>8&255,er.pending_buf[er.d_buf+2*er.last_lit+1]=255&vr,er.pending_buf[er.l_buf+er.last_lit]=255&_o,er.last_lit++,vr===0?er.dyn_ltree[2*_o]++:(er.matches++,vr--,er.dyn_ltree[2*(Ot[_o]+st+1)]++,er.dyn_dtree[2*Dr(vr)]++),er.last_lit===er.lit_bufsize-1},$._tr_align=function(er){rn(er,2,3),On(er,$t,tn),function(vr){vr.bi_valid===16?(Zr(vr,vr.bi_buf),vr.bi_buf=0,vr.bi_valid=0):8<=vr.bi_valid&&(vr.pending_buf[vr.pending++]=255&vr.bi_buf,vr.bi_buf>>=8,vr.bi_valid-=8)}(er)}},{"../utils/common":41}],53:[function(s,a,$){a.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(s,a,$){(function(c){(function(nt,at){if(!nt.setImmediate){var lt,et,it,st,ct=1,ft={},pt=!1,gt=nt.document,wt=Object.getPrototypeOf&&Object.getPrototypeOf(nt);wt=wt&&wt.setTimeout?wt:nt,lt={}.toString.call(nt.process)==="[object process]"?function(Pt){process.nextTick(function(){_t(Pt)})}:function(){if(nt.postMessage&&!nt.importScripts){var Pt=!0,Nt=nt.onmessage;return nt.onmessage=function(){Pt=!1},nt.postMessage("","*"),nt.onmessage=Nt,Pt}}()?(st="setImmediate$"+Math.random()+"$",nt.addEventListener?nt.addEventListener("message",$t,!1):nt.attachEvent("onmessage",$t),function(Pt){nt.postMessage(st+Pt,"*")}):nt.MessageChannel?((it=new MessageChannel).port1.onmessage=function(Pt){_t(Pt.data)},function(Pt){it.port2.postMessage(Pt)}):gt&&"onreadystatechange"in gt.createElement("script")?(et=gt.documentElement,function(Pt){var Nt=gt.createElement("script");Nt.onreadystatechange=function(){_t(Pt),Nt.onreadystatechange=null,et.removeChild(Nt),Nt=null},et.appendChild(Nt)}):function(Pt){setTimeout(_t,0,Pt)},wt.setImmediate=function(Pt){typeof Pt!="function"&&(Pt=new Function(""+Pt));for(var Nt=new Array(arguments.length-1),Lt=0;Lt<Nt.length;Lt++)Nt[Lt]=arguments[Lt+1];var Ft={callback:Pt,args:Nt};return ft[ct]=Ft,lt(ct),ct++},wt.clearImmediate=vt}function vt(Pt){delete ft[Pt]}function _t(Pt){if(pt)setTimeout(_t,0,Pt);else{var Nt=ft[Pt];if(Nt){pt=!0;try{(function(Lt){var Ft=Lt.callback,Jt=Lt.args;switch(Jt.length){case 0:Ft();break;case 1:Ft(Jt[0]);break;case 2:Ft(Jt[0],Jt[1]);break;case 3:Ft(Jt[0],Jt[1],Jt[2]);break;default:Ft.apply(at,Jt)}})(Nt)}finally{vt(Pt),pt=!1}}}}function $t(Pt){Pt.source===nt&&typeof Pt.data=="string"&&Pt.data.indexOf(st)===0&&_t(+Pt.data.slice(st.length))}})(typeof self>"u"?c===void 0?this:c:self)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jszip_min);var jszip_minExports=jszip_min.exports;const JSZip=getDefaultExportFromCjs(jszip_minExports);//! moment.js
//! version : 2.30.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(e){hookCallback=e}function isArray$1(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function isObject$1(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function hasOwnProp(e,o){return Object.prototype.hasOwnProperty.call(e,o)}function isObjectEmpty(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var o;for(o in e)if(hasOwnProp(e,o))return!1;return!0}function isUndefined$1(e){return e===void 0}function isNumber$1(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function isDate$1(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function map$1(e,o){var s=[],a,$=e.length;for(a=0;a<$;++a)s.push(o(e[a],a));return s}function extend$1(e,o){for(var s in o)hasOwnProp(o,s)&&(e[s]=o[s]);return hasOwnProp(o,"toString")&&(e.toString=o.toString),hasOwnProp(o,"valueOf")&&(e.valueOf=o.valueOf),e}function createUTC(e,o,s,a){return createLocalOrUTC(e,o,s,a,!0).utc()}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function getParsingFlags(e){return e._pf==null&&(e._pf=defaultParsingFlags()),e._pf}var some$1;Array.prototype.some?some$1=Array.prototype.some:some$1=function(e){var o=Object(this),s=o.length>>>0,a;for(a=0;a<s;a++)if(a in o&&e.call(this,o[a],a,o))return!0;return!1};function isValid(e){var o=null,s=!1,a=e._d&&!isNaN(e._d.getTime());if(a&&(o=getParsingFlags(e),s=some$1.call(o.parsedDateParts,function($){return $!=null}),a=o.overflow<0&&!o.empty&&!o.invalidEra&&!o.invalidMonth&&!o.invalidWeekday&&!o.weekdayMismatch&&!o.nullInput&&!o.invalidFormat&&!o.userInvalidated&&(!o.meridiem||o.meridiem&&s),e._strict&&(a=a&&o.charsLeftOver===0&&o.unusedTokens.length===0&&o.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=a;else return a;return e._isValid}function createInvalid(e){var o=createUTC(NaN);return e!=null?extend$1(getParsingFlags(o),e):getParsingFlags(o).userInvalidated=!0,o}var momentProperties=hooks.momentProperties=[],updateInProgress=!1;function copyConfig(e,o){var s,a,$,c=momentProperties.length;if(isUndefined$1(o._isAMomentObject)||(e._isAMomentObject=o._isAMomentObject),isUndefined$1(o._i)||(e._i=o._i),isUndefined$1(o._f)||(e._f=o._f),isUndefined$1(o._l)||(e._l=o._l),isUndefined$1(o._strict)||(e._strict=o._strict),isUndefined$1(o._tzm)||(e._tzm=o._tzm),isUndefined$1(o._isUTC)||(e._isUTC=o._isUTC),isUndefined$1(o._offset)||(e._offset=o._offset),isUndefined$1(o._pf)||(e._pf=getParsingFlags(o)),isUndefined$1(o._locale)||(e._locale=o._locale),c>0)for(s=0;s<c;s++)a=momentProperties[s],$=o[a],isUndefined$1($)||(e[a]=$);return e}function Moment(e){copyConfig(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),updateInProgress===!1&&(updateInProgress=!0,hooks.updateOffset(this),updateInProgress=!1)}function isMoment(e){return e instanceof Moment||e!=null&&e._isAMomentObject!=null}function warn(e){hooks.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function deprecate(e,o){var s=!0;return extend$1(function(){if(hooks.deprecationHandler!=null&&hooks.deprecationHandler(null,e),s){var a=[],$,c,nt,at=arguments.length;for(c=0;c<at;c++){if($="",typeof arguments[c]=="object"){$+=`
[`+c+"] ";for(nt in arguments[0])hasOwnProp(arguments[0],nt)&&($+=nt+": "+arguments[0][nt]+", ");$=$.slice(0,-2)}else $=arguments[c];a.push($)}warn(e+`
Arguments: `+Array.prototype.slice.call(a).join("")+`
`+new Error().stack),s=!1}return o.apply(this,arguments)},o)}var deprecations={};function deprecateSimple(e,o){hooks.deprecationHandler!=null&&hooks.deprecationHandler(e,o),deprecations[e]||(warn(o),deprecations[e]=!0)}hooks.suppressDeprecationWarnings=!1;hooks.deprecationHandler=null;function isFunction$2(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function set(e){var o,s;for(s in e)hasOwnProp(e,s)&&(o=e[s],isFunction$2(o)?this[s]=o:this["_"+s]=o);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(e,o){var s=extend$1({},e),a;for(a in o)hasOwnProp(o,a)&&(isObject$1(e[a])&&isObject$1(o[a])?(s[a]={},extend$1(s[a],e[a]),extend$1(s[a],o[a])):o[a]!=null?s[a]=o[a]:delete s[a]);for(a in e)hasOwnProp(e,a)&&!hasOwnProp(o,a)&&isObject$1(e[a])&&(s[a]=extend$1({},s[a]));return s}function Locale(e){e!=null&&this.set(e)}var keys$1;Object.keys?keys$1=Object.keys:keys$1=function(e){var o,s=[];for(o in e)hasOwnProp(e,o)&&s.push(o);return s};var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(e,o,s){var a=this._calendar[e]||this._calendar.sameElse;return isFunction$2(a)?a.call(o,s):a}function zeroFill(e,o,s){var a=""+Math.abs(e),$=o-a.length,c=e>=0;return(c?s?"+":"":"-")+Math.pow(10,Math.max(0,$)).toString().substr(1)+a}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(e,o,s,a){var $=a;typeof a=="string"&&($=function(){return this[a]()}),e&&(formatTokenFunctions[e]=$),o&&(formatTokenFunctions[o[0]]=function(){return zeroFill($.apply(this,arguments),o[1],o[2])}),s&&(formatTokenFunctions[s]=function(){return this.localeData().ordinal($.apply(this,arguments),e)})}function removeFormattingTokens(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function makeFormatFunction(e){var o=e.match(formattingTokens),s,a;for(s=0,a=o.length;s<a;s++)formatTokenFunctions[o[s]]?o[s]=formatTokenFunctions[o[s]]:o[s]=removeFormattingTokens(o[s]);return function($){var c="",nt;for(nt=0;nt<a;nt++)c+=isFunction$2(o[nt])?o[nt].call($,e):o[nt];return c}}function formatMoment(e,o){return e.isValid()?(o=expandFormat(o,e.localeData()),formatFunctions[o]=formatFunctions[o]||makeFormatFunction(o),formatFunctions[o](e)):e.localeData().invalidDate()}function expandFormat(e,o){var s=5;function a($){return o.longDateFormat($)||$}for(localFormattingTokens.lastIndex=0;s>=0&&localFormattingTokens.test(e);)e=e.replace(localFormattingTokens,a),localFormattingTokens.lastIndex=0,s-=1;return e}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(e){var o=this._longDateFormat[e],s=this._longDateFormat[e.toUpperCase()];return o||!s?o:(this._longDateFormat[e]=s.match(formattingTokens).map(function(a){return a==="MMMM"||a==="MM"||a==="DD"||a==="dddd"?a.slice(1):a}).join(""),this._longDateFormat[e])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(e){return this._ordinal.replace("%d",e)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(e,o,s,a){var $=this._relativeTime[s];return isFunction$2($)?$(e,o,s,a):$.replace(/%d/i,e)}function pastFuture(e,o){var s=this._relativeTime[e>0?"future":"past"];return isFunction$2(s)?s(o):s.replace(/%s/i,o)}var aliases={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function normalizeUnits(e){return typeof e=="string"?aliases[e]||aliases[e.toLowerCase()]:void 0}function normalizeObjectUnits(e){var o={},s,a;for(a in e)hasOwnProp(e,a)&&(s=normalizeUnits(a),s&&(o[s]=e[a]));return o}var priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function getPrioritizedUnits(e){var o=[],s;for(s in e)hasOwnProp(e,s)&&o.push({unit:s,priority:priorities[s]});return o.sort(function(a,$){return a.priority-$.priority}),o}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes;regexes={};function addRegexToken(e,o,s){regexes[e]=isFunction$2(o)?o:function(a,$){return a&&s?s:o}}function getParseRegexForToken(e,o){return hasOwnProp(regexes,e)?regexes[e](o._strict,o._locale):new RegExp(unescapeFormat(e))}function unescapeFormat(e){return regexEscape(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(o,s,a,$,c){return s||a||$||c}))}function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function toInt(e){var o=+e,s=0;return o!==0&&isFinite(o)&&(s=absFloor(o)),s}var tokens={};function addParseToken(e,o){var s,a=o,$;for(typeof e=="string"&&(e=[e]),isNumber$1(o)&&(a=function(c,nt){nt[o]=toInt(c)}),$=e.length,s=0;s<$;s++)tokens[e[s]]=a}function addWeekParseToken(e,o){addParseToken(e,function(s,a,$,c){$._w=$._w||{},o(s,$._w,$,c)})}function addTimeToArrayFromToken(e,o,s){o!=null&&hasOwnProp(tokens,e)&&tokens[e](o,s._a,s,e)}function isLeapYear(e){return e%4===0&&e%100!==0||e%400===0}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8;addFormatToken("Y",0,0,function(){var e=this.year();return e<=9999?zeroFill(e,4):"+"+e});addFormatToken(0,["YY",2],0,function(){return this.year()%100});addFormatToken(0,["YYYY",4],0,"year");addFormatToken(0,["YYYYY",5],0,"year");addFormatToken(0,["YYYYYY",6,!0],0,"year");addRegexToken("Y",matchSigned);addRegexToken("YY",match1to2,match2);addRegexToken("YYYY",match1to4,match4);addRegexToken("YYYYY",match1to6,match6);addRegexToken("YYYYYY",match1to6,match6);addParseToken(["YYYYY","YYYYYY"],YEAR);addParseToken("YYYY",function(e,o){o[YEAR]=e.length===2?hooks.parseTwoDigitYear(e):toInt(e)});addParseToken("YY",function(e,o){o[YEAR]=hooks.parseTwoDigitYear(e)});addParseToken("Y",function(e,o){o[YEAR]=parseInt(e,10)});function daysInYear(e){return isLeapYear(e)?366:365}hooks.parseTwoDigitYear=function(e){return toInt(e)+(toInt(e)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function makeGetSet(e,o){return function(s){return s!=null?(set$1(this,e,s),hooks.updateOffset(this,o),this):get$1(this,e)}}function get$1(e,o){if(!e.isValid())return NaN;var s=e._d,a=e._isUTC;switch(o){case"Milliseconds":return a?s.getUTCMilliseconds():s.getMilliseconds();case"Seconds":return a?s.getUTCSeconds():s.getSeconds();case"Minutes":return a?s.getUTCMinutes():s.getMinutes();case"Hours":return a?s.getUTCHours():s.getHours();case"Date":return a?s.getUTCDate():s.getDate();case"Day":return a?s.getUTCDay():s.getDay();case"Month":return a?s.getUTCMonth():s.getMonth();case"FullYear":return a?s.getUTCFullYear():s.getFullYear();default:return NaN}}function set$1(e,o,s){var a,$,c,nt,at;if(!(!e.isValid()||isNaN(s))){switch(a=e._d,$=e._isUTC,o){case"Milliseconds":return void($?a.setUTCMilliseconds(s):a.setMilliseconds(s));case"Seconds":return void($?a.setUTCSeconds(s):a.setSeconds(s));case"Minutes":return void($?a.setUTCMinutes(s):a.setMinutes(s));case"Hours":return void($?a.setUTCHours(s):a.setHours(s));case"Date":return void($?a.setUTCDate(s):a.setDate(s));case"FullYear":break;default:return}c=s,nt=e.month(),at=e.date(),at=at===29&&nt===1&&!isLeapYear(c)?28:at,$?a.setUTCFullYear(c,nt,at):a.setFullYear(c,nt,at)}}function stringGet(e){return e=normalizeUnits(e),isFunction$2(this[e])?this[e]():this}function stringSet(e,o){if(typeof e=="object"){e=normalizeObjectUnits(e);var s=getPrioritizedUnits(e),a,$=s.length;for(a=0;a<$;a++)this[s[a].unit](e[s[a].unit])}else if(e=normalizeUnits(e),isFunction$2(this[e]))return this[e](o);return this}function mod(e,o){return(e%o+o)%o}var indexOf$1;Array.prototype.indexOf?indexOf$1=Array.prototype.indexOf:indexOf$1=function(e){var o;for(o=0;o<this.length;++o)if(this[o]===e)return o;return-1};function daysInMonth(e,o){if(isNaN(e)||isNaN(o))return NaN;var s=mod(o,12);return e+=(o-s)/12,s===1?isLeapYear(e)?29:28:31-s%7%2}addFormatToken("M",["MM",2],"Mo",function(){return this.month()+1});addFormatToken("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});addFormatToken("MMMM",0,0,function(e){return this.localeData().months(this,e)});addRegexToken("M",match1to2,match1to2NoLeadingZero);addRegexToken("MM",match1to2,match2);addRegexToken("MMM",function(e,o){return o.monthsShortRegex(e)});addRegexToken("MMMM",function(e,o){return o.monthsRegex(e)});addParseToken(["M","MM"],function(e,o){o[MONTH]=toInt(e)-1});addParseToken(["MMM","MMMM"],function(e,o,s,a){var $=s._locale.monthsParse(e,a,s._strict);$!=null?o[MONTH]=$:getParsingFlags(s).invalidMonth=e});var defaultLocaleMonths="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),defaultLocaleMonthsShort="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord;function localeMonths(e,o){return e?isArray$1(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(o)?"format":"standalone"][e.month()]:isArray$1(this._months)?this._months:this._months.standalone}function localeMonthsShort(e,o){return e?isArray$1(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(o)?"format":"standalone"][e.month()]:isArray$1(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function handleStrictParse(e,o,s){var a,$,c,nt=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;a<12;++a)c=createUTC([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(c,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(c,"").toLocaleLowerCase();return s?o==="MMM"?($=indexOf$1.call(this._shortMonthsParse,nt),$!==-1?$:null):($=indexOf$1.call(this._longMonthsParse,nt),$!==-1?$:null):o==="MMM"?($=indexOf$1.call(this._shortMonthsParse,nt),$!==-1?$:($=indexOf$1.call(this._longMonthsParse,nt),$!==-1?$:null)):($=indexOf$1.call(this._longMonthsParse,nt),$!==-1?$:($=indexOf$1.call(this._shortMonthsParse,nt),$!==-1?$:null))}function localeMonthsParse(e,o,s){var a,$,c;if(this._monthsParseExact)return handleStrictParse.call(this,e,o,s);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),a=0;a<12;a++){if($=createUTC([2e3,a]),s&&!this._longMonthsParse[a]&&(this._longMonthsParse[a]=new RegExp("^"+this.months($,"").replace(".","")+"$","i"),this._shortMonthsParse[a]=new RegExp("^"+this.monthsShort($,"").replace(".","")+"$","i")),!s&&!this._monthsParse[a]&&(c="^"+this.months($,"")+"|^"+this.monthsShort($,""),this._monthsParse[a]=new RegExp(c.replace(".",""),"i")),s&&o==="MMMM"&&this._longMonthsParse[a].test(e))return a;if(s&&o==="MMM"&&this._shortMonthsParse[a].test(e))return a;if(!s&&this._monthsParse[a].test(e))return a}}function setMonth(e,o){if(!e.isValid())return e;if(typeof o=="string"){if(/^\d+$/.test(o))o=toInt(o);else if(o=e.localeData().monthsParse(o),!isNumber$1(o))return e}var s=o,a=e.date();return a=a<29?a:Math.min(a,daysInMonth(e.year(),s)),e._isUTC?e._d.setUTCMonth(s,a):e._d.setMonth(s,a),e}function getSetMonth(e){return e!=null?(setMonth(this,e),hooks.updateOffset(this,!0),this):get$1(this,"Month")}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,"_monthsShortRegex")||(this._monthsShortRegex=defaultMonthsShortRegex),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function monthsRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,"_monthsRegex")||(this._monthsRegex=defaultMonthsRegex),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function computeMonthsParse(){function e(lt,et){return et.length-lt.length}var o=[],s=[],a=[],$,c,nt,at;for($=0;$<12;$++)c=createUTC([2e3,$]),nt=regexEscape(this.monthsShort(c,"")),at=regexEscape(this.months(c,"")),o.push(nt),s.push(at),a.push(at),a.push(nt);o.sort(e),s.sort(e),a.sort(e),this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function createDate(e,o,s,a,$,c,nt){var at;return e<100&&e>=0?(at=new Date(e+400,o,s,a,$,c,nt),isFinite(at.getFullYear())&&at.setFullYear(e)):at=new Date(e,o,s,a,$,c,nt),at}function createUTCDate(e){var o,s;return e<100&&e>=0?(s=Array.prototype.slice.call(arguments),s[0]=e+400,o=new Date(Date.UTC.apply(null,s)),isFinite(o.getUTCFullYear())&&o.setUTCFullYear(e)):o=new Date(Date.UTC.apply(null,arguments)),o}function firstWeekOffset(e,o,s){var a=7+o-s,$=(7+createUTCDate(e,0,a).getUTCDay()-o)%7;return-$+a-1}function dayOfYearFromWeeks(e,o,s,a,$){var c=(7+s-a)%7,nt=firstWeekOffset(e,a,$),at=1+7*(o-1)+c+nt,lt,et;return at<=0?(lt=e-1,et=daysInYear(lt)+at):at>daysInYear(e)?(lt=e+1,et=at-daysInYear(e)):(lt=e,et=at),{year:lt,dayOfYear:et}}function weekOfYear(e,o,s){var a=firstWeekOffset(e.year(),o,s),$=Math.floor((e.dayOfYear()-a-1)/7)+1,c,nt;return $<1?(nt=e.year()-1,c=$+weeksInYear(nt,o,s)):$>weeksInYear(e.year(),o,s)?(c=$-weeksInYear(e.year(),o,s),nt=e.year()+1):(nt=e.year(),c=$),{week:c,year:nt}}function weeksInYear(e,o,s){var a=firstWeekOffset(e,o,s),$=firstWeekOffset(e+1,o,s);return(daysInYear(e)-a+$)/7}addFormatToken("w",["ww",2],"wo","week");addFormatToken("W",["WW",2],"Wo","isoWeek");addRegexToken("w",match1to2,match1to2NoLeadingZero);addRegexToken("ww",match1to2,match2);addRegexToken("W",match1to2,match1to2NoLeadingZero);addRegexToken("WW",match1to2,match2);addWeekParseToken(["w","ww","W","WW"],function(e,o,s,a){o[a.substr(0,1)]=toInt(e)});function localeWeek(e){return weekOfYear(e,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(e){var o=this.localeData().week(this);return e==null?o:this.add((e-o)*7,"d")}function getSetISOWeek(e){var o=weekOfYear(this,1,4).week;return e==null?o:this.add((e-o)*7,"d")}addFormatToken("d",0,"do","day");addFormatToken("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});addFormatToken("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});addFormatToken("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});addFormatToken("e",0,0,"weekday");addFormatToken("E",0,0,"isoWeekday");addRegexToken("d",match1to2);addRegexToken("e",match1to2);addRegexToken("E",match1to2);addRegexToken("dd",function(e,o){return o.weekdaysMinRegex(e)});addRegexToken("ddd",function(e,o){return o.weekdaysShortRegex(e)});addRegexToken("dddd",function(e,o){return o.weekdaysRegex(e)});addWeekParseToken(["dd","ddd","dddd"],function(e,o,s,a){var $=s._locale.weekdaysParse(e,a,s._strict);$!=null?o.d=$:getParsingFlags(s).invalidWeekday=e});addWeekParseToken(["d","e","E"],function(e,o,s,a){o[a]=toInt(e)});function parseWeekday(e,o){return typeof e!="string"?e:isNaN(e)?(e=o.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function parseIsoWeekday(e,o){return typeof e=="string"?o.weekdaysParse(e)%7||7:isNaN(e)?null:e}function shiftWeekdays(e,o){return e.slice(o,7).concat(e.slice(0,o))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(e,o){var s=isArray$1(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(o)?"format":"standalone"];return e===!0?shiftWeekdays(s,this._week.dow):e?s[e.day()]:s}function localeWeekdaysShort(e){return e===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function localeWeekdaysMin(e){return e===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function handleStrictParse$1(e,o,s){var a,$,c,nt=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)c=createUTC([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(c,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(c,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(c,"").toLocaleLowerCase();return s?o==="dddd"?($=indexOf$1.call(this._weekdaysParse,nt),$!==-1?$:null):o==="ddd"?($=indexOf$1.call(this._shortWeekdaysParse,nt),$!==-1?$:null):($=indexOf$1.call(this._minWeekdaysParse,nt),$!==-1?$:null):o==="dddd"?($=indexOf$1.call(this._weekdaysParse,nt),$!==-1||($=indexOf$1.call(this._shortWeekdaysParse,nt),$!==-1)?$:($=indexOf$1.call(this._minWeekdaysParse,nt),$!==-1?$:null)):o==="ddd"?($=indexOf$1.call(this._shortWeekdaysParse,nt),$!==-1||($=indexOf$1.call(this._weekdaysParse,nt),$!==-1)?$:($=indexOf$1.call(this._minWeekdaysParse,nt),$!==-1?$:null)):($=indexOf$1.call(this._minWeekdaysParse,nt),$!==-1||($=indexOf$1.call(this._weekdaysParse,nt),$!==-1)?$:($=indexOf$1.call(this._shortWeekdaysParse,nt),$!==-1?$:null))}function localeWeekdaysParse(e,o,s){var a,$,c;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,e,o,s);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if($=createUTC([2e3,1]).day(a),s&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays($,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort($,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin($,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[a]||(c="^"+this.weekdays($,"")+"|^"+this.weekdaysShort($,"")+"|^"+this.weekdaysMin($,""),this._weekdaysParse[a]=new RegExp(c.replace(".",""),"i")),s&&o==="dddd"&&this._fullWeekdaysParse[a].test(e))return a;if(s&&o==="ddd"&&this._shortWeekdaysParse[a].test(e))return a;if(s&&o==="dd"&&this._minWeekdaysParse[a].test(e))return a;if(!s&&this._weekdaysParse[a].test(e))return a}}function getSetDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var o=get$1(this,"Day");return e!=null?(e=parseWeekday(e,this.localeData()),this.add(e-o,"d")):o}function getSetLocaleDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var o=(this.day()+7-this.localeData()._week.dow)%7;return e==null?o:this.add(e-o,"d")}function getSetISODayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var o=parseIsoWeekday(e,this.localeData());return this.day(this.day()%7?o:o-7)}else return this.day()||7}function weekdaysRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function e(it,st){return st.length-it.length}var o=[],s=[],a=[],$=[],c,nt,at,lt,et;for(c=0;c<7;c++)nt=createUTC([2e3,1]).day(c),at=regexEscape(this.weekdaysMin(nt,"")),lt=regexEscape(this.weekdaysShort(nt,"")),et=regexEscape(this.weekdays(nt,"")),o.push(at),s.push(lt),a.push(et),$.push(at),$.push(lt),$.push(et);o.sort(e),s.sort(e),a.sort(e),$.sort(e),this._weekdaysRegex=new RegExp("^("+$.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour");addFormatToken("h",["hh",2],0,hFormat);addFormatToken("k",["kk",2],0,kFormat);addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)});addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)});addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(e,o){addFormatToken(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),o)})}meridiem("a",!0);meridiem("A",!1);function matchMeridiem(e,o){return o._meridiemParse}addRegexToken("a",matchMeridiem);addRegexToken("A",matchMeridiem);addRegexToken("H",match1to2,match1to2HasZero);addRegexToken("h",match1to2,match1to2NoLeadingZero);addRegexToken("k",match1to2,match1to2NoLeadingZero);addRegexToken("HH",match1to2,match2);addRegexToken("hh",match1to2,match2);addRegexToken("kk",match1to2,match2);addRegexToken("hmm",match3to4);addRegexToken("hmmss",match5to6);addRegexToken("Hmm",match3to4);addRegexToken("Hmmss",match5to6);addParseToken(["H","HH"],HOUR);addParseToken(["k","kk"],function(e,o,s){var a=toInt(e);o[HOUR]=a===24?0:a});addParseToken(["a","A"],function(e,o,s){s._isPm=s._locale.isPM(e),s._meridiem=e});addParseToken(["h","hh"],function(e,o,s){o[HOUR]=toInt(e),getParsingFlags(s).bigHour=!0});addParseToken("hmm",function(e,o,s){var a=e.length-2;o[HOUR]=toInt(e.substr(0,a)),o[MINUTE]=toInt(e.substr(a)),getParsingFlags(s).bigHour=!0});addParseToken("hmmss",function(e,o,s){var a=e.length-4,$=e.length-2;o[HOUR]=toInt(e.substr(0,a)),o[MINUTE]=toInt(e.substr(a,2)),o[SECOND]=toInt(e.substr($)),getParsingFlags(s).bigHour=!0});addParseToken("Hmm",function(e,o,s){var a=e.length-2;o[HOUR]=toInt(e.substr(0,a)),o[MINUTE]=toInt(e.substr(a))});addParseToken("Hmmss",function(e,o,s){var a=e.length-4,$=e.length-2;o[HOUR]=toInt(e.substr(0,a)),o[MINUTE]=toInt(e.substr(a,2)),o[SECOND]=toInt(e.substr($))});function localeIsPM(e){return(e+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(e,o,s){return e>11?s?"pm":"PM":s?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(e,o){var s,a=Math.min(e.length,o.length);for(s=0;s<a;s+=1)if(e[s]!==o[s])return s;return a}function normalizeLocale(e){return e&&e.toLowerCase().replace("_","-")}function chooseLocale(e){for(var o=0,s,a,$,c;o<e.length;){for(c=normalizeLocale(e[o]).split("-"),s=c.length,a=normalizeLocale(e[o+1]),a=a?a.split("-"):null;s>0;){if($=loadLocale(c.slice(0,s).join("-")),$)return $;if(a&&a.length>=s&&commonPrefix(c,a)>=s-1)break;s--}o++}return globalLocale}function isLocaleNameSane(e){return!!(e&&e.match("^[^/\\\\]*$"))}function loadLocale(e){var o=null,s;if(locales[e]===void 0&&typeof module<"u"&&module&&module.exports&&isLocaleNameSane(e))try{o=globalLocale._abbr,s=require,s("./locale/"+e),getSetGlobalLocale(o)}catch{locales[e]=null}return locales[e]}function getSetGlobalLocale(e,o){var s;return e&&(isUndefined$1(o)?s=getLocale(e):s=defineLocale(e,o),s?globalLocale=s:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(e,o){if(o!==null){var s,a=baseConfig;if(o.abbr=e,locales[e]!=null)deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),a=locales[e]._config;else if(o.parentLocale!=null)if(locales[o.parentLocale]!=null)a=locales[o.parentLocale]._config;else if(s=loadLocale(o.parentLocale),s!=null)a=s._config;else return localeFamilies[o.parentLocale]||(localeFamilies[o.parentLocale]=[]),localeFamilies[o.parentLocale].push({name:e,config:o}),null;return locales[e]=new Locale(mergeConfigs(a,o)),localeFamilies[e]&&localeFamilies[e].forEach(function($){defineLocale($.name,$.config)}),getSetGlobalLocale(e),locales[e]}else return delete locales[e],null}function updateLocale(e,o){if(o!=null){var s,a,$=baseConfig;locales[e]!=null&&locales[e].parentLocale!=null?locales[e].set(mergeConfigs(locales[e]._config,o)):(a=loadLocale(e),a!=null&&($=a._config),o=mergeConfigs($,o),a==null&&(o.abbr=e),s=new Locale(o),s.parentLocale=locales[e],locales[e]=s),getSetGlobalLocale(e)}else locales[e]!=null&&(locales[e].parentLocale!=null?(locales[e]=locales[e].parentLocale,e===getSetGlobalLocale()&&getSetGlobalLocale(e)):locales[e]!=null&&delete locales[e]);return locales[e]}function getLocale(e){var o;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return globalLocale;if(!isArray$1(e)){if(o=loadLocale(e),o)return o;e=[e]}return chooseLocale(e)}function listLocales(){return keys$1(locales)}function checkOverflow(e){var o,s=e._a;return s&&getParsingFlags(e).overflow===-2&&(o=s[MONTH]<0||s[MONTH]>11?MONTH:s[DATE]<1||s[DATE]>daysInMonth(s[YEAR],s[MONTH])?DATE:s[HOUR]<0||s[HOUR]>24||s[HOUR]===24&&(s[MINUTE]!==0||s[SECOND]!==0||s[MILLISECOND]!==0)?HOUR:s[MINUTE]<0||s[MINUTE]>59?MINUTE:s[SECOND]<0||s[SECOND]>59?SECOND:s[MILLISECOND]<0||s[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(e)._overflowDayOfYear&&(o<YEAR||o>DATE)&&(o=DATE),getParsingFlags(e)._overflowWeeks&&o===-1&&(o=WEEK),getParsingFlags(e)._overflowWeekday&&o===-1&&(o=WEEKDAY),getParsingFlags(e).overflow=o),e}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(e){var o,s,a=e._i,$=extendedIsoRegex.exec(a)||basicIsoRegex.exec(a),c,nt,at,lt,et=isoDates.length,it=isoTimes.length;if($){for(getParsingFlags(e).iso=!0,o=0,s=et;o<s;o++)if(isoDates[o][1].exec($[1])){nt=isoDates[o][0],c=isoDates[o][2]!==!1;break}if(nt==null){e._isValid=!1;return}if($[3]){for(o=0,s=it;o<s;o++)if(isoTimes[o][1].exec($[3])){at=($[2]||" ")+isoTimes[o][0];break}if(at==null){e._isValid=!1;return}}if(!c&&at!=null){e._isValid=!1;return}if($[4])if(tzRegex.exec($[4]))lt="Z";else{e._isValid=!1;return}e._f=nt+(at||"")+(lt||""),configFromStringAndFormat(e)}else e._isValid=!1}function extractFromRFC2822Strings(e,o,s,a,$,c){var nt=[untruncateYear(e),defaultLocaleMonthsShort.indexOf(o),parseInt(s,10),parseInt(a,10),parseInt($,10)];return c&&nt.push(parseInt(c,10)),nt}function untruncateYear(e){var o=parseInt(e,10);return o<=49?2e3+o:o<=999?1900+o:o}function preprocessRFC2822(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(e,o,s){if(e){var a=defaultLocaleWeekdaysShort.indexOf(e),$=new Date(o[0],o[1],o[2]).getDay();if(a!==$)return getParsingFlags(s).weekdayMismatch=!0,s._isValid=!1,!1}return!0}function calculateOffset(e,o,s){if(e)return obsOffsets[e];if(o)return 0;var a=parseInt(s,10),$=a%100,c=(a-$)/100;return c*60+$}function configFromRFC2822(e){var o=rfc2822.exec(preprocessRFC2822(e._i)),s;if(o){if(s=extractFromRFC2822Strings(o[4],o[3],o[2],o[5],o[6],o[7]),!checkWeekday(o[1],s,e))return;e._a=s,e._tzm=calculateOffset(o[8],o[9],o[10]),e._d=createUTCDate.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),getParsingFlags(e).rfc2822=!0}else e._isValid=!1}function configFromString(e){var o=aspNetJsonRegex.exec(e._i);if(o!==null){e._d=new Date(+o[1]);return}if(configFromISO(e),e._isValid===!1)delete e._isValid;else return;if(configFromRFC2822(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:hooks.createFromInputFallback(e)}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function defaults$1(e,o,s){return e??o??s}function currentDateArray(e){var o=new Date(hooks.now());return e._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function configFromArray(e){var o,s,a=[],$,c,nt;if(!e._d){for($=currentDateArray(e),e._w&&e._a[DATE]==null&&e._a[MONTH]==null&&dayOfYearFromWeekInfo(e),e._dayOfYear!=null&&(nt=defaults$1(e._a[YEAR],$[YEAR]),(e._dayOfYear>daysInYear(nt)||e._dayOfYear===0)&&(getParsingFlags(e)._overflowDayOfYear=!0),s=createUTCDate(nt,0,e._dayOfYear),e._a[MONTH]=s.getUTCMonth(),e._a[DATE]=s.getUTCDate()),o=0;o<3&&e._a[o]==null;++o)e._a[o]=a[o]=$[o];for(;o<7;o++)e._a[o]=a[o]=e._a[o]==null?o===2?1:0:e._a[o];e._a[HOUR]===24&&e._a[MINUTE]===0&&e._a[SECOND]===0&&e._a[MILLISECOND]===0&&(e._nextDay=!0,e._a[HOUR]=0),e._d=(e._useUTC?createUTCDate:createDate).apply(null,a),c=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[HOUR]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==c&&(getParsingFlags(e).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(e){var o,s,a,$,c,nt,at,lt,et;o=e._w,o.GG!=null||o.W!=null||o.E!=null?(c=1,nt=4,s=defaults$1(o.GG,e._a[YEAR],weekOfYear(createLocal(),1,4).year),a=defaults$1(o.W,1),$=defaults$1(o.E,1),($<1||$>7)&&(lt=!0)):(c=e._locale._week.dow,nt=e._locale._week.doy,et=weekOfYear(createLocal(),c,nt),s=defaults$1(o.gg,e._a[YEAR],et.year),a=defaults$1(o.w,et.week),o.d!=null?($=o.d,($<0||$>6)&&(lt=!0)):o.e!=null?($=o.e+c,(o.e<0||o.e>6)&&(lt=!0)):$=c),a<1||a>weeksInYear(s,c,nt)?getParsingFlags(e)._overflowWeeks=!0:lt!=null?getParsingFlags(e)._overflowWeekday=!0:(at=dayOfYearFromWeeks(s,a,$,c,nt),e._a[YEAR]=at.year,e._dayOfYear=at.dayOfYear)}hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(e){if(e._f===hooks.ISO_8601){configFromISO(e);return}if(e._f===hooks.RFC_2822){configFromRFC2822(e);return}e._a=[],getParsingFlags(e).empty=!0;var o=""+e._i,s,a,$,c,nt,at=o.length,lt=0,et,it;for($=expandFormat(e._f,e._locale).match(formattingTokens)||[],it=$.length,s=0;s<it;s++)c=$[s],a=(o.match(getParseRegexForToken(c,e))||[])[0],a&&(nt=o.substr(0,o.indexOf(a)),nt.length>0&&getParsingFlags(e).unusedInput.push(nt),o=o.slice(o.indexOf(a)+a.length),lt+=a.length),formatTokenFunctions[c]?(a?getParsingFlags(e).empty=!1:getParsingFlags(e).unusedTokens.push(c),addTimeToArrayFromToken(c,a,e)):e._strict&&!a&&getParsingFlags(e).unusedTokens.push(c);getParsingFlags(e).charsLeftOver=at-lt,o.length>0&&getParsingFlags(e).unusedInput.push(o),e._a[HOUR]<=12&&getParsingFlags(e).bigHour===!0&&e._a[HOUR]>0&&(getParsingFlags(e).bigHour=void 0),getParsingFlags(e).parsedDateParts=e._a.slice(0),getParsingFlags(e).meridiem=e._meridiem,e._a[HOUR]=meridiemFixWrap(e._locale,e._a[HOUR],e._meridiem),et=getParsingFlags(e).era,et!==null&&(e._a[YEAR]=e._locale.erasConvertYear(et,e._a[YEAR])),configFromArray(e),checkOverflow(e)}function meridiemFixWrap(e,o,s){var a;return s==null?o:e.meridiemHour!=null?e.meridiemHour(o,s):(e.isPM!=null&&(a=e.isPM(s),a&&o<12&&(o+=12),!a&&o===12&&(o=0)),o)}function configFromStringAndArray(e){var o,s,a,$,c,nt,at=!1,lt=e._f.length;if(lt===0){getParsingFlags(e).invalidFormat=!0,e._d=new Date(NaN);return}for($=0;$<lt;$++)c=0,nt=!1,o=copyConfig({},e),e._useUTC!=null&&(o._useUTC=e._useUTC),o._f=e._f[$],configFromStringAndFormat(o),isValid(o)&&(nt=!0),c+=getParsingFlags(o).charsLeftOver,c+=getParsingFlags(o).unusedTokens.length*10,getParsingFlags(o).score=c,at?c<a&&(a=c,s=o):(a==null||c<a||nt)&&(a=c,s=o,nt&&(at=!0));extend$1(e,s||o)}function configFromObject(e){if(!e._d){var o=normalizeObjectUnits(e._i),s=o.day===void 0?o.date:o.day;e._a=map$1([o.year,o.month,s,o.hour,o.minute,o.second,o.millisecond],function(a){return a&&parseInt(a,10)}),configFromArray(e)}}function createFromConfig(e){var o=new Moment(checkOverflow(prepareConfig(e)));return o._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function prepareConfig(e){var o=e._i,s=e._f;return e._locale=e._locale||getLocale(e._l),o===null||s===void 0&&o===""?createInvalid({nullInput:!0}):(typeof o=="string"&&(e._i=o=e._locale.preparse(o)),isMoment(o)?new Moment(checkOverflow(o)):(isDate$1(o)?e._d=o:isArray$1(s)?configFromStringAndArray(e):s?configFromStringAndFormat(e):configFromInput(e),isValid(e)||(e._d=null),e))}function configFromInput(e){var o=e._i;isUndefined$1(o)?e._d=new Date(hooks.now()):isDate$1(o)?e._d=new Date(o.valueOf()):typeof o=="string"?configFromString(e):isArray$1(o)?(e._a=map$1(o.slice(0),function(s){return parseInt(s,10)}),configFromArray(e)):isObject$1(o)?configFromObject(e):isNumber$1(o)?e._d=new Date(o):hooks.createFromInputFallback(e)}function createLocalOrUTC(e,o,s,a,$){var c={};return(o===!0||o===!1)&&(a=o,o=void 0),(s===!0||s===!1)&&(a=s,s=void 0),(isObject$1(e)&&isObjectEmpty(e)||isArray$1(e)&&e.length===0)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=$,c._l=s,c._i=e,c._f=o,c._strict=a,createFromConfig(c)}function createLocal(e,o,s,a){return createLocalOrUTC(e,o,s,a,!1)}var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:createInvalid()}),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:createInvalid()});function pickBy(e,o){var s,a;if(o.length===1&&isArray$1(o[0])&&(o=o[0]),!o.length)return createLocal();for(s=o[0],a=1;a<o.length;++a)(!o[a].isValid()||o[a][e](s))&&(s=o[a]);return s}function min$1(){var e=[].slice.call(arguments,0);return pickBy("isBefore",e)}function max$1(){var e=[].slice.call(arguments,0);return pickBy("isAfter",e)}var now$1=function(){return Date.now?Date.now():+new Date},ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(e){var o,s=!1,a,$=ordering.length;for(o in e)if(hasOwnProp(e,o)&&!(indexOf$1.call(ordering,o)!==-1&&(e[o]==null||!isNaN(e[o]))))return!1;for(a=0;a<$;++a)if(e[ordering[a]]){if(s)return!1;parseFloat(e[ordering[a]])!==toInt(e[ordering[a]])&&(s=!0)}return!0}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(e){var o=normalizeObjectUnits(e),s=o.year||0,a=o.quarter||0,$=o.month||0,c=o.week||o.isoWeek||0,nt=o.day||0,at=o.hour||0,lt=o.minute||0,et=o.second||0,it=o.millisecond||0;this._isValid=isDurationValid(o),this._milliseconds=+it+et*1e3+lt*6e4+at*1e3*60*60,this._days=+nt+c*7,this._months=+$+a*3+s*12,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(e){return e instanceof Duration}function absRound(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function compareArrays(e,o,s){var a=Math.min(e.length,o.length),$=Math.abs(e.length-o.length),c=0,nt;for(nt=0;nt<a;nt++)toInt(e[nt])!==toInt(o[nt])&&c++;return c+$}function offset(e,o){addFormatToken(e,0,0,function(){var s=this.utcOffset(),a="+";return s<0&&(s=-s,a="-"),a+zeroFill(~~(s/60),2)+o+zeroFill(~~s%60,2)})}offset("Z",":");offset("ZZ","");addRegexToken("Z",matchShortOffset);addRegexToken("ZZ",matchShortOffset);addParseToken(["Z","ZZ"],function(e,o,s){s._useUTC=!0,s._tzm=offsetFromString(matchShortOffset,e)});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(e,o){var s=(o||"").match(e),a,$,c;return s===null?null:(a=s[s.length-1]||[],$=(a+"").match(chunkOffset)||["-",0,0],c=+($[1]*60)+toInt($[2]),c===0?0:$[0]==="+"?c:-c)}function cloneWithOffset(e,o){var s,a;return o._isUTC?(s=o.clone(),a=(isMoment(e)||isDate$1(e)?e.valueOf():createLocal(e).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+a),hooks.updateOffset(s,!1),s):createLocal(e).local()}function getDateOffset(e){return-Math.round(e._d.getTimezoneOffset())}hooks.updateOffset=function(){};function getSetOffset(e,o,s){var a=this._offset||0,$;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=offsetFromString(matchShortOffset,e),e===null)return this}else Math.abs(e)<16&&!s&&(e=e*60);return!this._isUTC&&o&&($=getDateOffset(this)),this._offset=e,this._isUTC=!0,$!=null&&this.add($,"m"),a!==e&&(!o||this._changeInProgress?addSubtract(this,createDuration(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?a:getDateOffset(this)}function getSetZone(e,o){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,o),this):-this.utcOffset()}function setOffsetToUTC(e){return this.utcOffset(0,e)}function setOffsetToLocal(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(getDateOffset(this),"m")),this}function setOffsetToParsedOffset(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=offsetFromString(matchOffset,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function hasAlignedHourOffset(e){return this.isValid()?(e=e?createLocal(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined$1(this._isDSTShifted))return this._isDSTShifted;var e={},o;return copyConfig(e,this),e=prepareConfig(e),e._a?(o=e._isUTC?createUTC(e._a):createLocal(e._a),this._isDSTShifted=this.isValid()&&compareArrays(e._a,o.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(e,o){var s=e,a=null,$,c,nt;return isDuration(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:isNumber$1(e)||!isNaN(+e)?(s={},o?s[o]=+e:s.milliseconds=+e):(a=aspNetRegex.exec(e))?($=a[1]==="-"?-1:1,s={y:0,d:toInt(a[DATE])*$,h:toInt(a[HOUR])*$,m:toInt(a[MINUTE])*$,s:toInt(a[SECOND])*$,ms:toInt(absRound(a[MILLISECOND]*1e3))*$}):(a=isoRegex.exec(e))?($=a[1]==="-"?-1:1,s={y:parseIso(a[2],$),M:parseIso(a[3],$),w:parseIso(a[4],$),d:parseIso(a[5],$),h:parseIso(a[6],$),m:parseIso(a[7],$),s:parseIso(a[8],$)}):s==null?s={}:typeof s=="object"&&("from"in s||"to"in s)&&(nt=momentsDifference(createLocal(s.from),createLocal(s.to)),s={},s.ms=nt.milliseconds,s.M=nt.months),c=new Duration(s),isDuration(e)&&hasOwnProp(e,"_locale")&&(c._locale=e._locale),isDuration(e)&&hasOwnProp(e,"_isValid")&&(c._isValid=e._isValid),c}createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(e,o){var s=e&&parseFloat(e.replace(",","."));return(isNaN(s)?0:s)*o}function positiveMomentsDifference(e,o){var s={};return s.months=o.month()-e.month()+(o.year()-e.year())*12,e.clone().add(s.months,"M").isAfter(o)&&--s.months,s.milliseconds=+o-+e.clone().add(s.months,"M"),s}function momentsDifference(e,o){var s;return e.isValid()&&o.isValid()?(o=cloneWithOffset(o,e),e.isBefore(o)?s=positiveMomentsDifference(e,o):(s=positiveMomentsDifference(o,e),s.milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0}}function createAdder(e,o){return function(s,a){var $,c;return a!==null&&!isNaN(+a)&&(deprecateSimple(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),c=s,s=a,a=c),$=createDuration(s,a),addSubtract(this,$,e),this}}function addSubtract(e,o,s,a){var $=o._milliseconds,c=absRound(o._days),nt=absRound(o._months);e.isValid()&&(a=a??!0,nt&&setMonth(e,get$1(e,"Month")+nt*s),c&&set$1(e,"Date",get$1(e,"Date")+c*s),$&&e._d.setTime(e._d.valueOf()+$*s),a&&hooks.updateOffset(e,c||nt))}var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString$1(e){return typeof e=="string"||e instanceof String}function isMomentInput(e){return isMoment(e)||isDate$1(e)||isString$1(e)||isNumber$1(e)||isNumberOrStringArray(e)||isMomentInputObject(e)||e===null||e===void 0}function isMomentInputObject(e){var o=isObject$1(e)&&!isObjectEmpty(e),s=!1,a=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],$,c,nt=a.length;for($=0;$<nt;$+=1)c=a[$],s=s||hasOwnProp(e,c);return o&&s}function isNumberOrStringArray(e){var o=isArray$1(e),s=!1;return o&&(s=e.filter(function(a){return!isNumber$1(a)&&isString$1(e)}).length===0),o&&s}function isCalendarSpec(e){var o=isObject$1(e)&&!isObjectEmpty(e),s=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],$,c;for($=0;$<a.length;$+=1)c=a[$],s=s||hasOwnProp(e,c);return o&&s}function getCalendarFormat(e,o){var s=e.diff(o,"days",!0);return s<-6?"sameElse":s<-1?"lastWeek":s<0?"lastDay":s<1?"sameDay":s<2?"nextDay":s<7?"nextWeek":"sameElse"}function calendar$1(e,o){arguments.length===1&&(arguments[0]?isMomentInput(arguments[0])?(e=arguments[0],o=void 0):isCalendarSpec(arguments[0])&&(o=arguments[0],e=void 0):(e=void 0,o=void 0));var s=e||createLocal(),a=cloneWithOffset(s,this).startOf("day"),$=hooks.calendarFormat(this,a)||"sameElse",c=o&&(isFunction$2(o[$])?o[$].call(this,s):o[$]);return this.format(c||this.localeData().calendar($,this,createLocal(s)))}function clone$1(){return new Moment(this)}function isAfter(e,o){var s=isMoment(e)?e:createLocal(e);return this.isValid()&&s.isValid()?(o=normalizeUnits(o)||"millisecond",o==="millisecond"?this.valueOf()>s.valueOf():s.valueOf()<this.clone().startOf(o).valueOf()):!1}function isBefore(e,o){var s=isMoment(e)?e:createLocal(e);return this.isValid()&&s.isValid()?(o=normalizeUnits(o)||"millisecond",o==="millisecond"?this.valueOf()<s.valueOf():this.clone().endOf(o).valueOf()<s.valueOf()):!1}function isBetween(e,o,s,a){var $=isMoment(e)?e:createLocal(e),c=isMoment(o)?o:createLocal(o);return this.isValid()&&$.isValid()&&c.isValid()?(a=a||"()",(a[0]==="("?this.isAfter($,s):!this.isBefore($,s))&&(a[1]===")"?this.isBefore(c,s):!this.isAfter(c,s))):!1}function isSame(e,o){var s=isMoment(e)?e:createLocal(e),a;return this.isValid()&&s.isValid()?(o=normalizeUnits(o)||"millisecond",o==="millisecond"?this.valueOf()===s.valueOf():(a=s.valueOf(),this.clone().startOf(o).valueOf()<=a&&a<=this.clone().endOf(o).valueOf())):!1}function isSameOrAfter(e,o){return this.isSame(e,o)||this.isAfter(e,o)}function isSameOrBefore(e,o){return this.isSame(e,o)||this.isBefore(e,o)}function diff(e,o,s){var a,$,c;if(!this.isValid())return NaN;if(a=cloneWithOffset(e,this),!a.isValid())return NaN;switch($=(a.utcOffset()-this.utcOffset())*6e4,o=normalizeUnits(o),o){case"year":c=monthDiff(this,a)/12;break;case"month":c=monthDiff(this,a);break;case"quarter":c=monthDiff(this,a)/3;break;case"second":c=(this-a)/1e3;break;case"minute":c=(this-a)/6e4;break;case"hour":c=(this-a)/36e5;break;case"day":c=(this-a-$)/864e5;break;case"week":c=(this-a-$)/6048e5;break;default:c=this-a}return s?c:absFloor(c)}function monthDiff(e,o){if(e.date()<o.date())return-monthDiff(o,e);var s=(o.year()-e.year())*12+(o.month()-e.month()),a=e.clone().add(s,"months"),$,c;return o-a<0?($=e.clone().add(s-1,"months"),c=(o-a)/(a-$)):($=e.clone().add(s+1,"months"),c=(o-a)/($-a)),-(s+c)||0}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function toString$2(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(e){if(!this.isValid())return null;var o=e!==!0,s=o?this.clone().utc():this;return s.year()<0||s.year()>9999?formatMoment(s,o?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction$2(Date.prototype.toISOString)?o?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(s,"Z")):formatMoment(s,o?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",o="",s,a,$,c;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",o="Z"),s="["+e+'("]',a=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",$="-MM-DD[T]HH:mm:ss.SSS",c=o+'[")]',this.format(s+a+$+c)}function format(e){e||(e=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var o=formatMoment(this,e);return this.localeData().postformat(o)}function from(e,o){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({to:this,from:e}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function fromNow(e){return this.from(createLocal(),e)}function to$1(e,o){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({from:this,to:e}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function toNow(e){return this.to(createLocal(),e)}function locale(e){var o;return e===void 0?this._locale._abbr:(o=getLocale(e),o!=null&&(this._locale=o),this)}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(e,o){return(e%o+o)%o}function localStartOfDate(e,o,s){return e<100&&e>=0?new Date(e+400,o,s)-MS_PER_400_YEARS:new Date(e,o,s).valueOf()}function utcStartOfDate(e,o,s){return e<100&&e>=0?Date.UTC(e+400,o,s)-MS_PER_400_YEARS:Date.UTC(e,o,s)}function startOf(e){var o,s;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(s=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":o=s(this.year(),0,1);break;case"quarter":o=s(this.year(),this.month()-this.month()%3,1);break;case"month":o=s(this.year(),this.month(),1);break;case"week":o=s(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":o=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":o=s(this.year(),this.month(),this.date());break;case"hour":o=this._d.valueOf(),o-=mod$1(o+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":o=this._d.valueOf(),o-=mod$1(o,MS_PER_MINUTE);break;case"second":o=this._d.valueOf(),o-=mod$1(o,MS_PER_SECOND);break}return this._d.setTime(o),hooks.updateOffset(this,!0),this}function endOf(e){var o,s;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(s=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":o=s(this.year()+1,0,1)-1;break;case"quarter":o=s(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":o=s(this.year(),this.month()+1,1)-1;break;case"week":o=s(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":o=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":o=s(this.year(),this.month(),this.date()+1)-1;break;case"hour":o=this._d.valueOf(),o+=MS_PER_HOUR-mod$1(o+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":o=this._d.valueOf(),o+=MS_PER_MINUTE-mod$1(o,MS_PER_MINUTE)-1;break;case"second":o=this._d.valueOf(),o+=MS_PER_SECOND-mod$1(o,MS_PER_SECOND)-1;break}return this._d.setTime(o),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray$1(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function toObject(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend$1({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr");addFormatToken("NN",0,0,"eraAbbr");addFormatToken("NNN",0,0,"eraAbbr");addFormatToken("NNNN",0,0,"eraName");addFormatToken("NNNNN",0,0,"eraNarrow");addFormatToken("y",["y",1],"yo","eraYear");addFormatToken("y",["yy",2],0,"eraYear");addFormatToken("y",["yyy",3],0,"eraYear");addFormatToken("y",["yyyy",4],0,"eraYear");addRegexToken("N",matchEraAbbr);addRegexToken("NN",matchEraAbbr);addRegexToken("NNN",matchEraAbbr);addRegexToken("NNNN",matchEraName);addRegexToken("NNNNN",matchEraNarrow);addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(e,o,s,a){var $=s._locale.erasParse(e,a,s._strict);$?getParsingFlags(s).era=$:getParsingFlags(s).invalidEra=e});addRegexToken("y",matchUnsigned);addRegexToken("yy",matchUnsigned);addRegexToken("yyy",matchUnsigned);addRegexToken("yyyy",matchUnsigned);addRegexToken("yo",matchEraYearOrdinal);addParseToken(["y","yy","yyy","yyyy"],YEAR);addParseToken(["yo"],function(e,o,s,a){var $;s._locale._eraYearOrdinalRegex&&($=e.match(s._locale._eraYearOrdinalRegex)),s._locale.eraYearOrdinalParse?o[YEAR]=s._locale.eraYearOrdinalParse(e,$):o[YEAR]=parseInt(e,10)});function localeEras(e,o){var s,a,$,c=this._eras||getLocale("en")._eras;for(s=0,a=c.length;s<a;++s){switch(typeof c[s].since){case"string":$=hooks(c[s].since).startOf("day"),c[s].since=$.valueOf();break}switch(typeof c[s].until){case"undefined":c[s].until=1/0;break;case"string":$=hooks(c[s].until).startOf("day").valueOf(),c[s].until=$.valueOf();break}}return c}function localeErasParse(e,o,s){var a,$,c=this.eras(),nt,at,lt;for(e=e.toUpperCase(),a=0,$=c.length;a<$;++a)if(nt=c[a].name.toUpperCase(),at=c[a].abbr.toUpperCase(),lt=c[a].narrow.toUpperCase(),s)switch(o){case"N":case"NN":case"NNN":if(at===e)return c[a];break;case"NNNN":if(nt===e)return c[a];break;case"NNNNN":if(lt===e)return c[a];break}else if([nt,at,lt].indexOf(e)>=0)return c[a]}function localeErasConvertYear(e,o){var s=e.since<=e.until?1:-1;return o===void 0?hooks(e.since).year():hooks(e.since).year()+(o-e.offset)*s}function getEraName(){var e,o,s,a=this.localeData().eras();for(e=0,o=a.length;e<o;++e)if(s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return a[e].name;return""}function getEraNarrow(){var e,o,s,a=this.localeData().eras();for(e=0,o=a.length;e<o;++e)if(s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return a[e].narrow;return""}function getEraAbbr(){var e,o,s,a=this.localeData().eras();for(e=0,o=a.length;e<o;++e)if(s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return a[e].abbr;return""}function getEraYear(){var e,o,s,a,$=this.localeData().eras();for(e=0,o=$.length;e<o;++e)if(s=$[e].since<=$[e].until?1:-1,a=this.clone().startOf("day").valueOf(),$[e].since<=a&&a<=$[e].until||$[e].until<=a&&a<=$[e].since)return(this.year()-hooks($[e].since).year())*s+$[e].offset;return this.year()}function erasNameRegex(e){return hasOwnProp(this,"_erasNameRegex")||computeErasParse.call(this),e?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(e){return hasOwnProp(this,"_erasAbbrRegex")||computeErasParse.call(this),e?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(e){return hasOwnProp(this,"_erasNarrowRegex")||computeErasParse.call(this),e?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(e,o){return o.erasAbbrRegex(e)}function matchEraName(e,o){return o.erasNameRegex(e)}function matchEraNarrow(e,o){return o.erasNarrowRegex(e)}function matchEraYearOrdinal(e,o){return o._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var e=[],o=[],s=[],a=[],$,c,nt,at,lt,et=this.eras();for($=0,c=et.length;$<c;++$)nt=regexEscape(et[$].name),at=regexEscape(et[$].abbr),lt=regexEscape(et[$].narrow),o.push(nt),e.push(at),s.push(lt),a.push(nt),a.push(at),a.push(lt);this._erasRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+s.join("|")+")","i")}addFormatToken(0,["gg",2],0,function(){return this.weekYear()%100});addFormatToken(0,["GG",2],0,function(){return this.isoWeekYear()%100});function addWeekYearFormatToken(e,o){addFormatToken(0,[e,e.length],0,o)}addWeekYearFormatToken("gggg","weekYear");addWeekYearFormatToken("ggggg","weekYear");addWeekYearFormatToken("GGGG","isoWeekYear");addWeekYearFormatToken("GGGGG","isoWeekYear");addRegexToken("G",matchSigned);addRegexToken("g",matchSigned);addRegexToken("GG",match1to2,match2);addRegexToken("gg",match1to2,match2);addRegexToken("GGGG",match1to4,match4);addRegexToken("gggg",match1to4,match4);addRegexToken("GGGGG",match1to6,match6);addRegexToken("ggggg",match1to6,match6);addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],function(e,o,s,a){o[a.substr(0,2)]=toInt(e)});addWeekParseToken(["gg","GG"],function(e,o,s,a){o[a]=hooks.parseTwoDigitYear(e)});function getSetWeekYear(e){return getSetWeekYearHelper.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(e){return getSetWeekYearHelper.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var e=this.localeData()._week;return weeksInYear(this.year(),e.dow,e.doy)}function getWeeksInWeekYear(){var e=this.localeData()._week;return weeksInYear(this.weekYear(),e.dow,e.doy)}function getSetWeekYearHelper(e,o,s,a,$){var c;return e==null?weekOfYear(this,a,$).year:(c=weeksInYear(e,a,$),o>c&&(o=c),setWeekAll.call(this,e,o,s,a,$))}function setWeekAll(e,o,s,a,$){var c=dayOfYearFromWeeks(e,o,s,a,$),nt=createUTCDate(c.year,0,c.dayOfYear);return this.year(nt.getUTCFullYear()),this.month(nt.getUTCMonth()),this.date(nt.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter");addRegexToken("Q",match1);addParseToken("Q",function(e,o){o[MONTH]=(toInt(e)-1)*3});function getSetQuarter(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date");addRegexToken("D",match1to2,match1to2NoLeadingZero);addRegexToken("DD",match1to2,match2);addRegexToken("Do",function(e,o){return e?o._dayOfMonthOrdinalParse||o._ordinalParse:o._dayOfMonthOrdinalParseLenient});addParseToken(["D","DD"],DATE);addParseToken("Do",function(e,o){o[DATE]=toInt(e.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear");addRegexToken("DDD",match1to3);addRegexToken("DDDD",match3);addParseToken(["DDD","DDDD"],function(e,o,s){s._dayOfYear=toInt(e)});function getSetDayOfYear(e){var o=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?o:this.add(e-o,"d")}addFormatToken("m",["mm",2],0,"minute");addRegexToken("m",match1to2,match1to2HasZero);addRegexToken("mm",match1to2,match2);addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second");addRegexToken("s",match1to2,match1to2HasZero);addRegexToken("ss",match1to2,match2);addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)});addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)});addFormatToken(0,["SSS",3],0,"millisecond");addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10});addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100});addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});addRegexToken("S",match1to3,match1);addRegexToken("SS",match1to3,match2);addRegexToken("SSS",match1to3,match3);var token,getSetMillisecond;for(token="SSSS";token.length<=9;token+="S")addRegexToken(token,matchUnsigned);function parseMs(e,o){o[MILLISECOND]=toInt(("0."+e)*1e3)}for(token="S";token.length<=9;token+="S")addParseToken(token,parseMs);getSetMillisecond=makeGetSet("Milliseconds",!1);addFormatToken("z",0,0,"zoneAbbr");addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add;proto.calendar=calendar$1;proto.clone=clone$1;proto.diff=diff;proto.endOf=endOf;proto.format=format;proto.from=from;proto.fromNow=fromNow;proto.to=to$1;proto.toNow=toNow;proto.get=stringGet;proto.invalidAt=invalidAt;proto.isAfter=isAfter;proto.isBefore=isBefore;proto.isBetween=isBetween;proto.isSame=isSame;proto.isSameOrAfter=isSameOrAfter;proto.isSameOrBefore=isSameOrBefore;proto.isValid=isValid$2;proto.lang=lang;proto.locale=locale;proto.localeData=localeData;proto.max=prototypeMax;proto.min=prototypeMin;proto.parsingFlags=parsingFlags;proto.set=stringSet;proto.startOf=startOf;proto.subtract=subtract;proto.toArray=toArray$1;proto.toObject=toObject;proto.toDate=toDate;proto.toISOString=toISOString;proto.inspect=inspect;typeof Symbol<"u"&&Symbol.for!=null&&(proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});proto.toJSON=toJSON;proto.toString=toString$2;proto.unix=unix;proto.valueOf=valueOf;proto.creationData=creationData;proto.eraName=getEraName;proto.eraNarrow=getEraNarrow;proto.eraAbbr=getEraAbbr;proto.eraYear=getEraYear;proto.year=getSetYear;proto.isLeapYear=getIsLeapYear;proto.weekYear=getSetWeekYear;proto.isoWeekYear=getSetISOWeekYear;proto.quarter=proto.quarters=getSetQuarter;proto.month=getSetMonth;proto.daysInMonth=getDaysInMonth;proto.week=proto.weeks=getSetWeek;proto.isoWeek=proto.isoWeeks=getSetISOWeek;proto.weeksInYear=getWeeksInYear;proto.weeksInWeekYear=getWeeksInWeekYear;proto.isoWeeksInYear=getISOWeeksInYear;proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear;proto.date=getSetDayOfMonth;proto.day=proto.days=getSetDayOfWeek;proto.weekday=getSetLocaleDayOfWeek;proto.isoWeekday=getSetISODayOfWeek;proto.dayOfYear=getSetDayOfYear;proto.hour=proto.hours=getSetHour;proto.minute=proto.minutes=getSetMinute;proto.second=proto.seconds=getSetSecond;proto.millisecond=proto.milliseconds=getSetMillisecond;proto.utcOffset=getSetOffset;proto.utc=setOffsetToUTC;proto.local=setOffsetToLocal;proto.parseZone=setOffsetToParsedOffset;proto.hasAlignedHourOffset=hasAlignedHourOffset;proto.isDST=isDaylightSavingTime;proto.isLocal=isLocal;proto.isUtcOffset=isUtcOffset;proto.isUtc=isUtc;proto.isUTC=isUtc;proto.zoneAbbr=getZoneAbbr;proto.zoneName=getZoneName;proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth);proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth);proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear);proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone);proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(e){return createLocal(e*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(e){return e}var proto$1=Locale.prototype;proto$1.calendar=calendar;proto$1.longDateFormat=longDateFormat;proto$1.invalidDate=invalidDate;proto$1.ordinal=ordinal;proto$1.preparse=preParsePostFormat;proto$1.postformat=preParsePostFormat;proto$1.relativeTime=relativeTime;proto$1.pastFuture=pastFuture;proto$1.set=set;proto$1.eras=localeEras;proto$1.erasParse=localeErasParse;proto$1.erasConvertYear=localeErasConvertYear;proto$1.erasAbbrRegex=erasAbbrRegex;proto$1.erasNameRegex=erasNameRegex;proto$1.erasNarrowRegex=erasNarrowRegex;proto$1.months=localeMonths;proto$1.monthsShort=localeMonthsShort;proto$1.monthsParse=localeMonthsParse;proto$1.monthsRegex=monthsRegex;proto$1.monthsShortRegex=monthsShortRegex;proto$1.week=localeWeek;proto$1.firstDayOfYear=localeFirstDayOfYear;proto$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1.weekdays=localeWeekdays;proto$1.weekdaysMin=localeWeekdaysMin;proto$1.weekdaysShort=localeWeekdaysShort;proto$1.weekdaysParse=localeWeekdaysParse;proto$1.weekdaysRegex=weekdaysRegex;proto$1.weekdaysShortRegex=weekdaysShortRegex;proto$1.weekdaysMinRegex=weekdaysMinRegex;proto$1.isPM=localeIsPM;proto$1.meridiem=localeMeridiem;function get$1$1(e,o,s,a){var $=getLocale(),c=createUTC().set(a,o);return $[s](c,e)}function listMonthsImpl(e,o,s){if(isNumber$1(e)&&(o=e,e=void 0),e=e||"",o!=null)return get$1$1(e,o,s,"month");var a,$=[];for(a=0;a<12;a++)$[a]=get$1$1(e,a,s,"month");return $}function listWeekdaysImpl(e,o,s,a){typeof e=="boolean"?(isNumber$1(o)&&(s=o,o=void 0),o=o||""):(o=e,s=o,e=!1,isNumber$1(o)&&(s=o,o=void 0),o=o||"");var $=getLocale(),c=e?$._week.dow:0,nt,at=[];if(s!=null)return get$1$1(o,(s+c)%7,a,"day");for(nt=0;nt<7;nt++)at[nt]=get$1$1(o,(nt+c)%7,a,"day");return at}function listMonths(e,o){return listMonthsImpl(e,o,"months")}function listMonthsShort(e,o){return listMonthsImpl(e,o,"monthsShort")}function listWeekdays(e,o,s){return listWeekdaysImpl(e,o,s,"weekdays")}function listWeekdaysShort(e,o,s){return listWeekdaysImpl(e,o,s,"weekdaysShort")}function listWeekdaysMin(e,o,s){return listWeekdaysImpl(e,o,s,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var o=e%10,s=toInt(e%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th";return e+s}});hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale);hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var e=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),e.milliseconds=mathAbs(e.milliseconds),e.seconds=mathAbs(e.seconds),e.minutes=mathAbs(e.minutes),e.hours=mathAbs(e.hours),e.months=mathAbs(e.months),e.years=mathAbs(e.years),this}function addSubtract$1(e,o,s,a){var $=createDuration(o,s);return e._milliseconds+=a*$._milliseconds,e._days+=a*$._days,e._months+=a*$._months,e._bubble()}function add$1(e,o){return addSubtract$1(this,e,o,1)}function subtract$1(e,o){return addSubtract$1(this,e,o,-1)}function absCeil(e){return e<0?Math.floor(e):Math.ceil(e)}function bubble(){var e=this._milliseconds,o=this._days,s=this._months,a=this._data,$,c,nt,at,lt;return e>=0&&o>=0&&s>=0||e<=0&&o<=0&&s<=0||(e+=absCeil(monthsToDays(s)+o)*864e5,o=0,s=0),a.milliseconds=e%1e3,$=absFloor(e/1e3),a.seconds=$%60,c=absFloor($/60),a.minutes=c%60,nt=absFloor(c/60),a.hours=nt%24,o+=absFloor(nt/24),lt=absFloor(daysToMonths(o)),s+=lt,o-=absCeil(monthsToDays(lt)),at=absFloor(s/12),s%=12,a.days=o,a.months=s,a.years=at,this}function daysToMonths(e){return e*4800/146097}function monthsToDays(e){return e*146097/4800}function as$1(e){if(!this.isValid())return NaN;var o,s,a=this._milliseconds;if(e=normalizeUnits(e),e==="month"||e==="quarter"||e==="year")switch(o=this._days+a/864e5,s=this._months+daysToMonths(o),e){case"month":return s;case"quarter":return s/3;case"year":return s/12}else switch(o=this._days+Math.round(monthsToDays(this._months)),e){case"week":return o/7+a/6048e5;case"day":return o+a/864e5;case"hour":return o*24+a/36e5;case"minute":return o*1440+a/6e4;case"second":return o*86400+a/1e3;case"millisecond":return Math.floor(o*864e5)+a;default:throw new Error("Unknown unit "+e)}}function makeAs(e){return function(){return this.as(e)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y"),valueOf$1=asMilliseconds;function clone$1$1(){return createDuration(this)}function get$2(e){return e=normalizeUnits(e),this.isValid()?this[e+"s"]():NaN}function makeGetter(e){return function(){return this.isValid()?this._data[e]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(e,o,s,a,$){return $.relativeTime(o||1,!!s,e,a)}function relativeTime$1(e,o,s,a){var $=createDuration(e).abs(),c=round($.as("s")),nt=round($.as("m")),at=round($.as("h")),lt=round($.as("d")),et=round($.as("M")),it=round($.as("w")),st=round($.as("y")),ct=c<=s.ss&&["s",c]||c<s.s&&["ss",c]||nt<=1&&["m"]||nt<s.m&&["mm",nt]||at<=1&&["h"]||at<s.h&&["hh",at]||lt<=1&&["d"]||lt<s.d&&["dd",lt];return s.w!=null&&(ct=ct||it<=1&&["w"]||it<s.w&&["ww",it]),ct=ct||et<=1&&["M"]||et<s.M&&["MM",et]||st<=1&&["y"]||["yy",st],ct[2]=o,ct[3]=+e>0,ct[4]=a,substituteTimeAgo.apply(null,ct)}function getSetRelativeTimeRounding(e){return e===void 0?round:typeof e=="function"?(round=e,!0):!1}function getSetRelativeTimeThreshold(e,o){return thresholds[e]===void 0?!1:o===void 0?thresholds[e]:(thresholds[e]=o,e==="s"&&(thresholds.ss=o-1),!0)}function humanize(e,o){if(!this.isValid())return this.localeData().invalidDate();var s=!1,a=thresholds,$,c;return typeof e=="object"&&(o=e,e=!1),typeof e=="boolean"&&(s=e),typeof o=="object"&&(a=Object.assign({},thresholds,o),o.s!=null&&o.ss==null&&(a.ss=o.s-1)),$=this.localeData(),c=relativeTime$1(this,!s,a,$),s&&(c=$.pastFuture(+this,c)),$.postformat(c)}var abs$1=Math.abs;function sign(e){return(e>0)-(e<0)||+e}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var e=abs$1(this._milliseconds)/1e3,o=abs$1(this._days),s=abs$1(this._months),a,$,c,nt,at=this.asSeconds(),lt,et,it,st;return at?(a=absFloor(e/60),$=absFloor(a/60),e%=60,a%=60,c=absFloor(s/12),s%=12,nt=e?e.toFixed(3).replace(/\.?0+$/,""):"",lt=at<0?"-":"",et=sign(this._months)!==sign(at)?"-":"",it=sign(this._days)!==sign(at)?"-":"",st=sign(this._milliseconds)!==sign(at)?"-":"",lt+"P"+(c?et+c+"Y":"")+(s?et+s+"M":"")+(o?it+o+"D":"")+($||a||e?"T":"")+($?st+$+"H":"")+(a?st+a+"M":"")+(e?st+nt+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1;proto$2.abs=abs;proto$2.add=add$1;proto$2.subtract=subtract$1;proto$2.as=as$1;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asQuarters=asQuarters;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1$1;proto$2.get=get$2;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale;proto$2.localeData=localeData;proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1);proto$2.lang=lang;addFormatToken("X",0,0,"unix");addFormatToken("x",0,0,"valueOf");addRegexToken("x",matchSigned);addRegexToken("X",matchTimestamp);addParseToken("X",function(e,o,s){s._d=new Date(parseFloat(e)*1e3)});addParseToken("x",function(e,o,s){s._d=new Date(toInt(e))});//! moment.js
hooks.version="2.30.1";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min$1;hooks.max=max$1;hooks.now=now$1;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate$1;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};var NodeType;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(NodeType||(NodeType={}));function isElement$1(e){return e.nodeType===e.ELEMENT_NODE}function isShadowRoot(e){const o=e?.host;return o?.shadowRoot===e}function isNativeShadowDom(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function fixBrowserCompatibilityIssuesInCSS(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function escapeImportStatement(e){const{cssText:o}=e;if(o.split('"').length<3)return o;const s=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}function stringifyStylesheet(e){try{const o=e.rules||e.cssRules;return o?fixBrowserCompatibilityIssuesInCSS(Array.from(o,stringifyRule).join("")):null}catch{return null}}function stringifyRule(e){let o;if(isCSSImportRule(e))try{o=stringifyStylesheet(e.styleSheet)||escapeImportStatement(e)}catch{}else if(isCSSStyleRule(e)&&e.selectorText.includes(":"))return fixSafariColons(e.cssText);return o||e.cssText}function fixSafariColons(e){const o=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(o,"$1\\$2")}function isCSSImportRule(e){return"styleSheet"in e}function isCSSStyleRule(e){return"selectorText"in e}class Mirror{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(o){var s;if(!o)return-1;const a=(s=this.getMeta(o))===null||s===void 0?void 0:s.id;return a??-1}getNode(o){return this.idNodeMap.get(o)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(o){return this.nodeMetaMap.get(o)||null}removeNodeFromMap(o){const s=this.getId(o);this.idNodeMap.delete(s),o.childNodes&&o.childNodes.forEach(a=>this.removeNodeFromMap(a))}has(o){return this.idNodeMap.has(o)}hasNode(o){return this.nodeMetaMap.has(o)}add(o,s){const a=s.id;this.idNodeMap.set(a,o),this.nodeMetaMap.set(o,s)}replace(o,s){const a=this.getNode(o);if(a){const $=this.nodeMetaMap.get(a);$&&this.nodeMetaMap.set(s,$)}this.idNodeMap.set(o,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function createMirror(){return new Mirror}function maskInputValue({element:e,maskInputOptions:o,tagName:s,type:a,value:$,maskInputFn:c}){let nt=$||"";const at=a&&toLowerCase(a);return(o[s.toLowerCase()]||at&&o[at])&&(c?nt=c(nt,e):nt="*".repeat(nt.length)),nt}function toLowerCase(e){return e.toLowerCase()}const ORIGINAL_ATTRIBUTE_NAME="__rrweb_original__";function is2DCanvasBlank(e){const o=e.getContext("2d");if(!o)return!0;const s=50;for(let a=0;a<e.width;a+=s)for(let $=0;$<e.height;$+=s){const c=o.getImageData,nt=ORIGINAL_ATTRIBUTE_NAME in c?c[ORIGINAL_ATTRIBUTE_NAME]:c;if(new Uint32Array(nt.call(o,a,$,Math.min(s,e.width-a),Math.min(s,e.height-$)).data.buffer).some(lt=>lt!==0))return!1}return!0}function getInputType(e){const o=e.type;return e.hasAttribute("data-rr-is-password")?"password":o?toLowerCase(o):null}function extractFileExtension(e,o){var s;let a;try{a=new URL(e,o??window.location.href)}catch{return null}const $=/\.([0-9a-z]+)(?:$)/i,c=a.pathname.match($);return(s=c?.[1])!==null&&s!==void 0?s:null}let _id=1;const tagNameRegex=new RegExp("[^a-z0-9-_:]"),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(e){if(e instanceof HTMLFormElement)return"form";const o=toLowerCase(e.tagName);return tagNameRegex.test(o)?"div":o}function extractOrigin(e){let o="";return e.indexOf("//")>-1?o=e.split("/").slice(0,3).join("/"):o=e.split("/")[0],o=o.split("?")[0],o}let canvasService,canvasCtx;const URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,URL_PROTOCOL_MATCH=/^(?:[a-z+]+:)?\/\//i,URL_WWW_MATCH=/^www\..*/i,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(e,o){return(e||"").replace(URL_IN_CSS_REF,(s,a,$,c,nt,at)=>{const lt=$||nt||at,et=a||c||"";if(!lt)return s;if(URL_PROTOCOL_MATCH.test(lt)||URL_WWW_MATCH.test(lt))return`url(${et}${lt}${et})`;if(DATA_URI.test(lt))return`url(${et}${lt}${et})`;if(lt[0]==="/")return`url(${et}${extractOrigin(o)+lt}${et})`;const it=o.split("/"),st=lt.split("/");it.pop();for(const ct of st)ct!=="."&&(ct===".."?it.pop():it.push(ct));return`url(${et}${it.join("/")}${et})`})}const SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(e,o){if(o.trim()==="")return o;let s=0;function a(c){let nt;const at=c.exec(o.substring(s));return at?(nt=at[0],s+=nt.length,nt):""}const $=[];for(;a(SRCSET_COMMAS_OR_SPACES),!(s>=o.length);){let c=a(SRCSET_NOT_SPACES);if(c.slice(-1)===",")c=absoluteToDoc(e,c.substring(0,c.length-1)),$.push(c);else{let nt="";c=absoluteToDoc(e,c);let at=!1;for(;;){const lt=o.charAt(s);if(lt===""){$.push((c+nt).trim());break}else if(at)lt===")"&&(at=!1);else if(lt===","){s+=1,$.push((c+nt).trim());break}else lt==="("&&(at=!0);nt+=lt,s+=1}}}return $.join(", ")}function absoluteToDoc(e,o){if(!o||o.trim()==="")return o;const s=e.createElement("a");return s.href=o,s.href}function isSVGElement(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function getHref(){const e=document.createElement("a");return e.href="",e.href}function transformAttribute(e,o,s,a){return a&&(s==="src"||s==="href"&&!(o==="use"&&a[0]==="#")||s==="xlink:href"&&a[0]!=="#"||s==="background"&&(o==="table"||o==="td"||o==="th")?absoluteToDoc(e,a):s==="srcset"?getAbsoluteSrcsetString(e,a):s==="style"?absoluteToStylesheet(a,getHref()):o==="object"&&s==="data"?absoluteToDoc(e,a):a)}function ignoreAttribute(e,o,s){return(e==="video"||e==="audio")&&o==="autoplay"}function _isBlockedElement(e,o,s){try{if(typeof o=="string"){if(e.classList.contains(o))return!0}else for(let a=e.classList.length;a--;){const $=e.classList[a];if(o.test($))return!0}if(s)return e.matches(s)}catch{}return!1}function classMatchesRegex(e,o,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return s?classMatchesRegex(e.parentNode,o,s):!1;for(let a=e.classList.length;a--;){const $=e.classList[a];if(o.test($))return!0}return s?classMatchesRegex(e.parentNode,o,s):!1}function needMaskingText(e,o,s,a){try{const $=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if($===null)return!1;if(typeof o=="string"){if(a){if($.closest(`.${o}`))return!0}else if($.classList.contains(o))return!0}else if(classMatchesRegex($,o,a))return!0;if(s){if(a){if($.closest(s))return!0}else if($.matches(s))return!0}}catch{}return!1}function onceIframeLoaded(e,o,s){const a=e.contentWindow;if(!a)return;let $=!1,c;try{c=a.document.readyState}catch{return}if(c!=="complete"){const at=setTimeout(()=>{$||(o(),$=!0)},s);e.addEventListener("load",()=>{clearTimeout(at),$=!0,o()});return}const nt="about:blank";if(a.location.href!==nt||e.src===nt||e.src==="")return setTimeout(o,0),e.addEventListener("load",o);e.addEventListener("load",o)}function onceStylesheetLoaded(e,o,s){let a=!1,$;try{$=e.sheet}catch{return}if($)return;const c=setTimeout(()=>{a||(o(),a=!0)},s);e.addEventListener("load",()=>{clearTimeout(c),a=!0,o()})}function serializeNode(e,o){const{doc:s,mirror:a,blockClass:$,blockSelector:c,needsMask:nt,inlineStylesheet:at,maskInputOptions:lt={},maskTextFn:et,maskInputFn:it,dataURLOptions:st={},inlineImages:ct,recordCanvas:ft,keepIframeSrcFn:pt,newlyAddedElement:gt=!1}=o,wt=getRootId(s,a);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:NodeType.Document,childNodes:[],compatMode:e.compatMode}:{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:wt};case e.ELEMENT_NODE:return serializeElementNode(e,{doc:s,blockClass:$,blockSelector:c,inlineStylesheet:at,maskInputOptions:lt,maskInputFn:it,dataURLOptions:st,inlineImages:ct,recordCanvas:ft,keepIframeSrcFn:pt,newlyAddedElement:gt,rootId:wt});case e.TEXT_NODE:return serializeTextNode(e,{needsMask:nt,maskTextFn:et,rootId:wt});case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:"",rootId:wt};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||"",rootId:wt};default:return!1}}function getRootId(e,o){if(!o.hasNode(e))return;const s=o.getId(e);return s===1?void 0:s}function serializeTextNode(e,o){var s;const{needsMask:a,maskTextFn:$,rootId:c}=o,nt=e.parentNode&&e.parentNode.tagName;let at=e.textContent;const lt=nt==="STYLE"?!0:void 0,et=nt==="SCRIPT"?!0:void 0;if(lt&&at){try{e.nextSibling||e.previousSibling||!((s=e.parentNode.sheet)===null||s===void 0)&&s.cssRules&&(at=stringifyStylesheet(e.parentNode.sheet))}catch(it){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${it}`,e)}at=absoluteToStylesheet(at,getHref())}return et&&(at="SCRIPT_PLACEHOLDER"),!lt&&!et&&at&&a&&(at=$?$(at,e.parentElement):at.replace(/[\S]/g,"*")),{type:NodeType.Text,textContent:at||"",isStyle:lt,rootId:c}}function serializeElementNode(e,o){const{doc:s,blockClass:a,blockSelector:$,inlineStylesheet:c,maskInputOptions:nt={},maskInputFn:at,dataURLOptions:lt={},inlineImages:et,recordCanvas:it,keepIframeSrcFn:st,newlyAddedElement:ct=!1,rootId:ft}=o,pt=_isBlockedElement(e,a,$),gt=getValidTagName(e);let wt={};const vt=e.attributes.length;for(let $t=0;$t<vt;$t++){const Pt=e.attributes[$t];ignoreAttribute(gt,Pt.name,Pt.value)||(wt[Pt.name]=transformAttribute(s,gt,toLowerCase(Pt.name),Pt.value))}if(gt==="link"&&c){const $t=Array.from(s.styleSheets).find(Nt=>Nt.href===e.href);let Pt=null;$t&&(Pt=stringifyStylesheet($t)),Pt&&(delete wt.rel,delete wt.href,wt._cssText=absoluteToStylesheet(Pt,$t.href))}if(gt==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const $t=stringifyStylesheet(e.sheet);$t&&(wt._cssText=absoluteToStylesheet($t,getHref()))}if(gt==="input"||gt==="textarea"||gt==="select"){const $t=e.value,Pt=e.checked;wt.type!=="radio"&&wt.type!=="checkbox"&&wt.type!=="submit"&&wt.type!=="button"&&$t?wt.value=maskInputValue({element:e,type:getInputType(e),tagName:gt,value:$t,maskInputOptions:nt,maskInputFn:at}):Pt&&(wt.checked=Pt)}if(gt==="option"&&(e.selected&&!nt.select?wt.selected=!0:delete wt.selected),gt==="canvas"&&it){if(e.__context==="2d")is2DCanvasBlank(e)||(wt.rr_dataURL=e.toDataURL(lt.type,lt.quality));else if(!("__context"in e)){const $t=e.toDataURL(lt.type,lt.quality),Pt=document.createElement("canvas");Pt.width=e.width,Pt.height=e.height;const Nt=Pt.toDataURL(lt.type,lt.quality);$t!==Nt&&(wt.rr_dataURL=$t)}}if(gt==="img"&&et){canvasService||(canvasService=s.createElement("canvas"),canvasCtx=canvasService.getContext("2d"));const $t=e,Pt=$t.crossOrigin;$t.crossOrigin="anonymous";const Nt=()=>{$t.removeEventListener("load",Nt);try{canvasService.width=$t.naturalWidth,canvasService.height=$t.naturalHeight,canvasCtx.drawImage($t,0,0),wt.rr_dataURL=canvasService.toDataURL(lt.type,lt.quality)}catch(Lt){console.warn(`Cannot inline img src=${$t.currentSrc}! Error: ${Lt}`)}Pt?wt.crossOrigin=Pt:$t.removeAttribute("crossorigin")};$t.complete&&$t.naturalWidth!==0?Nt():$t.addEventListener("load",Nt)}if(gt==="audio"||gt==="video"){const $t=wt;$t.rr_mediaState=e.paused?"paused":"played",$t.rr_mediaCurrentTime=e.currentTime,$t.rr_mediaPlaybackRate=e.playbackRate,$t.rr_mediaMuted=e.muted,$t.rr_mediaLoop=e.loop,$t.rr_mediaVolume=e.volume}if(ct||(e.scrollLeft&&(wt.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(wt.rr_scrollTop=e.scrollTop)),pt){const{width:$t,height:Pt}=e.getBoundingClientRect();wt={class:wt.class,rr_width:`${$t}px`,rr_height:`${Pt}px`}}gt==="iframe"&&!st(wt.src)&&(e.contentDocument||(wt.rr_src=wt.src),delete wt.src);let _t;try{customElements.get(gt)&&(_t=!0)}catch{}return{type:NodeType.Element,tagName:gt,attributes:wt,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:pt,rootId:ft,isCustom:_t}}function lowerIfExists(e){return e==null?"":e.toLowerCase()}function slimDOMExcluded(e,o){if(o.comment&&e.type===NodeType.Comment)return!0;if(e.type===NodeType.Element){if(o.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&extractFileExtension(e.attributes.href)==="js"))return!0;if(o.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(lowerIfExists(e.attributes.name).match(/^msapplication-tile(image|color)$/)||lowerIfExists(e.attributes.name)==="application-name"||lowerIfExists(e.attributes.rel)==="icon"||lowerIfExists(e.attributes.rel)==="apple-touch-icon"||lowerIfExists(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(o.headMetaDescKeywords&&lowerIfExists(e.attributes.name).match(/^description|keywords$/))return!0;if(o.headMetaSocial&&(lowerIfExists(e.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(e.attributes.name).match(/^(og|twitter):/)||lowerIfExists(e.attributes.name)==="pinterest"))return!0;if(o.headMetaRobots&&(lowerIfExists(e.attributes.name)==="robots"||lowerIfExists(e.attributes.name)==="googlebot"||lowerIfExists(e.attributes.name)==="bingbot"))return!0;if(o.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(o.headMetaAuthorship&&(lowerIfExists(e.attributes.name)==="author"||lowerIfExists(e.attributes.name)==="generator"||lowerIfExists(e.attributes.name)==="framework"||lowerIfExists(e.attributes.name)==="publisher"||lowerIfExists(e.attributes.name)==="progid"||lowerIfExists(e.attributes.property).match(/^article:/)||lowerIfExists(e.attributes.property).match(/^product:/)))return!0;if(o.headMetaVerification&&(lowerIfExists(e.attributes.name)==="google-site-verification"||lowerIfExists(e.attributes.name)==="yandex-verification"||lowerIfExists(e.attributes.name)==="csrf-token"||lowerIfExists(e.attributes.name)==="p:domain_verify"||lowerIfExists(e.attributes.name)==="verify-v1"||lowerIfExists(e.attributes.name)==="verification"||lowerIfExists(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function serializeNodeWithId(e,o){const{doc:s,mirror:a,blockClass:$,blockSelector:c,maskTextClass:nt,maskTextSelector:at,skipChild:lt=!1,inlineStylesheet:et=!0,maskInputOptions:it={},maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft,dataURLOptions:pt={},inlineImages:gt=!1,recordCanvas:wt=!1,onSerialize:vt,onIframeLoad:_t,iframeLoadTimeout:$t=5e3,onStylesheetLoad:Pt,stylesheetLoadTimeout:Nt=5e3,keepIframeSrcFn:Lt=()=>!1,newlyAddedElement:Ft=!1}=o;let{needsMask:Jt}=o,{preserveWhiteSpace:_r=!0}=o;!Jt&&e.childNodes&&(Jt=needMaskingText(e,nt,at,Jt===void 0));const wr=serializeNode(e,{doc:s,mirror:a,blockClass:$,blockSelector:c,needsMask:Jt,inlineStylesheet:et,maskInputOptions:it,maskTextFn:st,maskInputFn:ct,dataURLOptions:pt,inlineImages:gt,recordCanvas:wt,keepIframeSrcFn:Lt,newlyAddedElement:Ft});if(!wr)return console.warn(e,"not serialized"),null;let tn;a.hasNode(e)?tn=a.getId(e):slimDOMExcluded(wr,ft)||!_r&&wr.type===NodeType.Text&&!wr.isStyle&&!wr.textContent.replace(/^\s+|\s+$/gm,"").length?tn=IGNORED_NODE:tn=genId();const Wt=Object.assign(wr,{id:tn});if(a.add(e,Wt),tn===IGNORED_NODE)return null;vt&&vt(e);let Yr=!lt;if(Wt.type===NodeType.Element){Yr=Yr&&!Wt.needBlock,delete Wt.needBlock;const Ot=e.shadowRoot;Ot&&isNativeShadowDom(Ot)&&(Wt.isShadowHost=!0)}if((Wt.type===NodeType.Document||Wt.type===NodeType.Element)&&Yr){ft.headWhitespace&&Wt.type===NodeType.Element&&Wt.tagName==="head"&&(_r=!1);const Ot={doc:s,mirror:a,blockClass:$,blockSelector:c,needsMask:Jt,maskTextClass:nt,maskTextSelector:at,skipChild:lt,inlineStylesheet:et,maskInputOptions:it,maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft,dataURLOptions:pt,inlineImages:gt,recordCanvas:wt,preserveWhiteSpace:_r,onSerialize:vt,onIframeLoad:_t,iframeLoadTimeout:$t,onStylesheetLoad:Pt,stylesheetLoadTimeout:Nt,keepIframeSrcFn:Lt};if(!(Wt.type===NodeType.Element&&Wt.tagName==="textarea"&&Wt.attributes.value!==void 0))for(const gr of Array.from(e.childNodes)){const $o=serializeNodeWithId(gr,Ot);$o&&Wt.childNodes.push($o)}if(isElement$1(e)&&e.shadowRoot)for(const gr of Array.from(e.shadowRoot.childNodes)){const $o=serializeNodeWithId(gr,Ot);$o&&(isNativeShadowDom(e.shadowRoot)&&($o.isShadow=!0),Wt.childNodes.push($o))}}return e.parentNode&&isShadowRoot(e.parentNode)&&isNativeShadowDom(e.parentNode)&&(Wt.isShadow=!0),Wt.type===NodeType.Element&&Wt.tagName==="iframe"&&onceIframeLoaded(e,()=>{const Ot=e.contentDocument;if(Ot&&_t){const gr=serializeNodeWithId(Ot,{doc:Ot,mirror:a,blockClass:$,blockSelector:c,needsMask:Jt,maskTextClass:nt,maskTextSelector:at,skipChild:!1,inlineStylesheet:et,maskInputOptions:it,maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft,dataURLOptions:pt,inlineImages:gt,recordCanvas:wt,preserveWhiteSpace:_r,onSerialize:vt,onIframeLoad:_t,iframeLoadTimeout:$t,onStylesheetLoad:Pt,stylesheetLoadTimeout:Nt,keepIframeSrcFn:Lt});gr&&_t(e,gr)}},$t),Wt.type===NodeType.Element&&Wt.tagName==="link"&&typeof Wt.attributes.rel=="string"&&(Wt.attributes.rel==="stylesheet"||Wt.attributes.rel==="preload"&&typeof Wt.attributes.href=="string"&&extractFileExtension(Wt.attributes.href)==="css")&&onceStylesheetLoaded(e,()=>{if(Pt){const Ot=serializeNodeWithId(e,{doc:s,mirror:a,blockClass:$,blockSelector:c,needsMask:Jt,maskTextClass:nt,maskTextSelector:at,skipChild:!1,inlineStylesheet:et,maskInputOptions:it,maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft,dataURLOptions:pt,inlineImages:gt,recordCanvas:wt,preserveWhiteSpace:_r,onSerialize:vt,onIframeLoad:_t,iframeLoadTimeout:$t,onStylesheetLoad:Pt,stylesheetLoadTimeout:Nt,keepIframeSrcFn:Lt});Ot&&Pt(e,Ot)}},Nt),Wt}function snapshot(e,o){const{mirror:s=new Mirror,blockClass:a="rr-block",blockSelector:$=null,maskTextClass:c="rr-mask",maskTextSelector:nt=null,inlineStylesheet:at=!0,inlineImages:lt=!1,recordCanvas:et=!1,maskAllInputs:it=!1,maskTextFn:st,maskInputFn:ct,slimDOM:ft=!1,dataURLOptions:pt,preserveWhiteSpace:gt,onSerialize:wt,onIframeLoad:vt,iframeLoadTimeout:_t,onStylesheetLoad:$t,stylesheetLoadTimeout:Pt,keepIframeSrcFn:Nt=()=>!1}=o||{};return serializeNodeWithId(e,{doc:e,mirror:s,blockClass:a,blockSelector:$,maskTextClass:c,maskTextSelector:nt,skipChild:!1,inlineStylesheet:at,maskInputOptions:it===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:it===!1?{password:!0}:it,maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft===!0||ft==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:ft==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:ft===!1?{}:ft,dataURLOptions:pt,inlineImages:lt,recordCanvas:et,preserveWhiteSpace:gt,onSerialize:wt,onIframeLoad:vt,iframeLoadTimeout:_t,onStylesheetLoad:$t,stylesheetLoadTimeout:Pt,keepIframeSrcFn:Nt,newlyAddedElement:!1})}function on(e,o,s=document){const a={capture:!0,passive:!0};return s.addEventListener(e,o,a),()=>s.removeEventListener(e,o,a)}const DEPARTED_MIRROR_ACCESS_WARNING=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let _mirror={map:{},getId(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),-1},getNode(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),null},removeNodeFromMap(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)},has(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),!1},reset(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(_mirror=new Proxy(_mirror,{get(e,o,s){return o==="map"&&console.error(DEPARTED_MIRROR_ACCESS_WARNING),Reflect.get(e,o,s)}}));function throttle$1(e,o,s={}){let a=null,$=0;return function(...c){const nt=Date.now();!$&&s.leading===!1&&($=nt);const at=o-(nt-$),lt=this;at<=0||at>o?(a&&(clearTimeout(a),a=null),$=nt,e.apply(lt,c)):!a&&s.trailing!==!1&&(a=setTimeout(()=>{$=s.leading===!1?0:Date.now(),a=null,e.apply(lt,c)},at))}}function hookSetter(e,o,s,a,$=window){const c=$.Object.getOwnPropertyDescriptor(e,o);return $.Object.defineProperty(e,o,a?s:{set(nt){setTimeout(()=>{s.set.call(this,nt)},0),c&&c.set&&c.set.call(this,nt)}}),()=>hookSetter(e,o,c||{},!0)}function patch(e,o,s){try{if(!(o in e))return()=>{};const a=e[o],$=s(a);return typeof $=="function"&&($.prototype=$.prototype||{},Object.defineProperties($,{__rrweb_original__:{enumerable:!1,value:a}})),e[o]=$,()=>{e[o]=a}}catch{return()=>{}}}let nowTimestamp=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(nowTimestamp=()=>new Date().getTime());function getWindowScroll(e){var o,s,a,$,c,nt;const at=e.document;return{left:at.scrollingElement?at.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:at?.documentElement.scrollLeft||((s=(o=at?.body)===null||o===void 0?void 0:o.parentElement)===null||s===void 0?void 0:s.scrollLeft)||((a=at?.body)===null||a===void 0?void 0:a.scrollLeft)||0,top:at.scrollingElement?at.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:at?.documentElement.scrollTop||((c=($=at?.body)===null||$===void 0?void 0:$.parentElement)===null||c===void 0?void 0:c.scrollTop)||((nt=at?.body)===null||nt===void 0?void 0:nt.scrollTop)||0}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function closestElementOfNode(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function isBlocked(e,o,s,a){if(!e)return!1;const $=closestElementOfNode(e);if(!$)return!1;try{if(typeof o=="string"){if($.classList.contains(o)||a&&$.closest("."+o)!==null)return!0}else if(classMatchesRegex($,o,a))return!0}catch{}return!!(s&&($.matches(s)||a&&$.closest(s)!==null))}function isSerialized(e,o){return o.getId(e)!==-1}function isIgnored(e,o){return o.getId(e)===IGNORED_NODE}function isAncestorRemoved(e,o){if(isShadowRoot(e))return!1;const s=o.getId(e);return o.has(s)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?isAncestorRemoved(e.parentNode,o):!0:!0}function legacy_isTouchEvent(e){return!!e.changedTouches}function polyfill(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...o)=>{let s=o[0];if(!(0 in o))throw new TypeError("1 argument is required");do if(this===s)return!0;while(s=s&&s.parentNode);return!1})}function isSerializedIframe(e,o){return!!(e.nodeName==="IFRAME"&&o.getMeta(e))}function isSerializedStylesheet(e,o){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&o.getMeta(e))}function hasShadowRoot(e){return!!e?.shadowRoot}class StyleSheetMirror{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(o){var s;return(s=this.styleIDMap.get(o))!==null&&s!==void 0?s:-1}has(o){return this.styleIDMap.has(o)}add(o,s){if(this.has(o))return this.getId(o);let a;return s===void 0?a=this.id++:a=s,this.styleIDMap.set(o,a),this.idStyleMap.set(a,o),a}getStyle(o){return this.idStyleMap.get(o)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function getShadowHost(e){var o,s;let a=null;return((s=(o=e.getRootNode)===null||o===void 0?void 0:o.call(e))===null||s===void 0?void 0:s.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(a=e.getRootNode().host),a}function getRootShadowHost(e){let o=e,s;for(;s=getShadowHost(o);)o=s;return o}function shadowHostInDom(e){const o=e.ownerDocument;if(!o)return!1;const s=getRootShadowHost(e);return o.contains(s)}function inDom(e){const o=e.ownerDocument;return o?o.contains(e)||shadowHostInDom(e):!1}var EventType$1=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(EventType$1||{}),IncrementalSource$1=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(IncrementalSource$1||{}),MouseInteractions=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(MouseInteractions||{}),PointerTypes=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(PointerTypes||{}),CanvasContext=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(CanvasContext||{});function isNodeInLinkedList(e){return"__ln"in e}class DoubleLinkedList{constructor(){this.length=0,this.head=null,this.tail=null}get(o){if(o>=this.length)throw new Error("Position outside of list range");let s=this.head;for(let a=0;a<o;a++)s=s?.next||null;return s}addNode(o){const s={value:o,previous:null,next:null};if(o.__ln=s,o.previousSibling&&isNodeInLinkedList(o.previousSibling)){const a=o.previousSibling.__ln.next;s.next=a,s.previous=o.previousSibling.__ln,o.previousSibling.__ln.next=s,a&&(a.previous=s)}else if(o.nextSibling&&isNodeInLinkedList(o.nextSibling)&&o.nextSibling.__ln.previous){const a=o.nextSibling.__ln.previous;s.previous=a,s.next=o.nextSibling.__ln,o.nextSibling.__ln.previous=s,a&&(a.next=s)}else this.head&&(this.head.previous=s),s.next=this.head,this.head=s;s.next===null&&(this.tail=s),this.length++}removeNode(o){const s=o.__ln;this.head&&(s.previous?(s.previous.next=s.next,s.next?s.next.previous=s.previous:this.tail=s.previous):(this.head=s.next,this.head?this.head.previous=null:this.tail=null),o.__ln&&delete o.__ln,this.length--)}}const moveKey=(e,o)=>`${e}@${o}`;class MutationBuffer{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=o=>{o.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const o=[],s=new Set,a=new DoubleLinkedList,$=lt=>{let et=lt,it=IGNORED_NODE;for(;it===IGNORED_NODE;)et=et&&et.nextSibling,it=et&&this.mirror.getId(et);return it},c=lt=>{if(!lt.parentNode||!inDom(lt)||lt.parentNode.tagName==="TEXTAREA")return;const et=isShadowRoot(lt.parentNode)?this.mirror.getId(getShadowHost(lt)):this.mirror.getId(lt.parentNode),it=$(lt);if(et===-1||it===-1)return a.addNode(lt);const st=serializeNodeWithId(lt,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:ct=>{isSerializedIframe(ct,this.mirror)&&this.iframeManager.addIframe(ct),isSerializedStylesheet(ct,this.mirror)&&this.stylesheetManager.trackLinkElement(ct),hasShadowRoot(lt)&&this.shadowDomManager.addShadowRoot(lt.shadowRoot,this.doc)},onIframeLoad:(ct,ft)=>{this.iframeManager.attachIframe(ct,ft),this.shadowDomManager.observeAttachShadow(ct)},onStylesheetLoad:(ct,ft)=>{this.stylesheetManager.attachLinkElement(ct,ft)}});st&&(o.push({parentId:et,nextId:it,node:st}),s.add(st.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const lt of this.movedSet)isParentRemoved(this.removes,lt,this.mirror)&&!this.movedSet.has(lt.parentNode)||c(lt);for(const lt of this.addedSet)!isAncestorInSet(this.droppedSet,lt)&&!isParentRemoved(this.removes,lt,this.mirror)||isAncestorInSet(this.movedSet,lt)?c(lt):this.droppedSet.add(lt);let nt=null;for(;a.length;){let lt=null;if(nt){const et=this.mirror.getId(nt.value.parentNode),it=$(nt.value);et!==-1&&it!==-1&&(lt=nt)}if(!lt){let et=a.tail;for(;et;){const it=et;if(et=et.previous,it){const st=this.mirror.getId(it.value.parentNode);if($(it.value)===-1)continue;if(st!==-1){lt=it;break}else{const ft=it.value;if(ft.parentNode&&ft.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const pt=ft.parentNode.host;if(this.mirror.getId(pt)!==-1){lt=it;break}}}}}}if(!lt){for(;a.head;)a.removeNode(a.head.value);break}nt=lt.previous,a.removeNode(lt.value),c(lt.value)}const at={texts:this.texts.map(lt=>{const et=lt.node;return et.parentNode&&et.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(et.parentNode),{id:this.mirror.getId(et),value:lt.value}}).filter(lt=>!s.has(lt.id)).filter(lt=>this.mirror.has(lt.id)),attributes:this.attributes.map(lt=>{const{attributes:et}=lt;if(typeof et.style=="string"){const it=JSON.stringify(lt.styleDiff),st=JSON.stringify(lt._unchangedStyles);it.length<et.style.length&&(it+st).split("var(").length===et.style.split("var(").length&&(et.style=lt.styleDiff)}return{id:this.mirror.getId(lt.node),attributes:et}}).filter(lt=>!s.has(lt.id)).filter(lt=>this.mirror.has(lt.id)),removes:this.removes,adds:o};!at.texts.length&&!at.attributes.length&&!at.removes.length&&!at.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(at))},this.genTextAreaValueMutation=o=>{let s=this.attributeMap.get(o);s||(s={node:o,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(o,s)),s.attributes.value=Array.from(o.childNodes,a=>a.textContent||"").join("")},this.processMutation=o=>{if(!isIgnored(o.target,this.mirror))switch(o.type){case"characterData":{const s=o.target.textContent;!isBlocked(o.target,this.blockClass,this.blockSelector,!1)&&s!==o.oldValue&&this.texts.push({value:needMaskingText(o.target,this.maskTextClass,this.maskTextSelector,!0)&&s?this.maskTextFn?this.maskTextFn(s,closestElementOfNode(o.target)):s.replace(/[\S]/g,"*"):s,node:o.target});break}case"attributes":{const s=o.target;let a=o.attributeName,$=o.target.getAttribute(a);if(a==="value"){const nt=getInputType(s);$=maskInputValue({element:s,maskInputOptions:this.maskInputOptions,tagName:s.tagName,type:nt,value:$,maskInputFn:this.maskInputFn})}if(isBlocked(o.target,this.blockClass,this.blockSelector,!1)||$===o.oldValue)return;let c=this.attributeMap.get(o.target);if(s.tagName==="IFRAME"&&a==="src"&&!this.keepIframeSrcFn($))if(!s.contentDocument)a="rr_src";else return;if(c||(c={node:o.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(c),this.attributeMap.set(o.target,c)),a==="type"&&s.tagName==="INPUT"&&(o.oldValue||"").toLowerCase()==="password"&&s.setAttribute("data-rr-is-password","true"),!ignoreAttribute(s.tagName,a)&&(c.attributes[a]=transformAttribute(this.doc,toLowerCase(s.tagName),toLowerCase(a),$),a==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const nt=this.unattachedDoc.createElement("span");o.oldValue&&nt.setAttribute("style",o.oldValue);for(const at of Array.from(s.style)){const lt=s.style.getPropertyValue(at),et=s.style.getPropertyPriority(at);lt!==nt.style.getPropertyValue(at)||et!==nt.style.getPropertyPriority(at)?et===""?c.styleDiff[at]=lt:c.styleDiff[at]=[lt,et]:c._unchangedStyles[at]=[lt,et]}for(const at of Array.from(nt.style))s.style.getPropertyValue(at)===""&&(c.styleDiff[at]=!1)}break}case"childList":{if(isBlocked(o.target,this.blockClass,this.blockSelector,!0))return;if(o.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(o.target);return}o.addedNodes.forEach(s=>this.genAdds(s,o.target)),o.removedNodes.forEach(s=>{const a=this.mirror.getId(s),$=isShadowRoot(o.target)?this.mirror.getId(o.target.host):this.mirror.getId(o.target);isBlocked(o.target,this.blockClass,this.blockSelector,!1)||isIgnored(s,this.mirror)||!isSerialized(s,this.mirror)||(this.addedSet.has(s)?(deepDelete(this.addedSet,s),this.droppedSet.add(s)):this.addedSet.has(o.target)&&a===-1||isAncestorRemoved(o.target,this.mirror)||(this.movedSet.has(s)&&this.movedMap[moveKey(a,$)]?deepDelete(this.movedSet,s):this.removes.push({parentId:$,id:a,isShadow:isShadowRoot(o.target)&&isNativeShadowDom(o.target)?!0:void 0})),this.mapRemoves.push(s))});break}}},this.genAdds=(o,s)=>{if(!this.processedNodeManager.inOtherBuffer(o,this)&&!(this.addedSet.has(o)||this.movedSet.has(o))){if(this.mirror.hasNode(o)){if(isIgnored(o,this.mirror))return;this.movedSet.add(o);let a=null;s&&this.mirror.hasNode(s)&&(a=this.mirror.getId(s)),a&&a!==-1&&(this.movedMap[moveKey(this.mirror.getId(o),a)]=!0)}else this.addedSet.add(o),this.droppedSet.delete(o);isBlocked(o,this.blockClass,this.blockSelector,!1)||(o.childNodes.forEach(a=>this.genAdds(a)),hasShadowRoot(o)&&o.shadowRoot.childNodes.forEach(a=>{this.processedNodeManager.add(a,this),this.genAdds(a,o)}))}}}init(o){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(s=>{this[s]=o[s]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function deepDelete(e,o){e.delete(o),o.childNodes.forEach(s=>deepDelete(e,s))}function isParentRemoved(e,o,s){return e.length===0?!1:_isParentRemoved(e,o,s)}function _isParentRemoved(e,o,s){const{parentNode:a}=o;if(!a)return!1;const $=s.getId(a);return e.some(c=>c.id===$)?!0:_isParentRemoved(e,a,s)}function isAncestorInSet(e,o){return e.size===0?!1:_isAncestorInSet(e,o)}function _isAncestorInSet(e,o){const{parentNode:s}=o;return s?e.has(s)?!0:_isAncestorInSet(e,s):!1}let errorHandler;function registerErrorHandler(e){errorHandler=e}function unregisterErrorHandler(){errorHandler=void 0}const callbackWrapper=e=>errorHandler?(...s)=>{try{return e(...s)}catch(a){if(errorHandler&&errorHandler(a)===!0)return;throw a}}:e,mutationBuffers=[];function getEventTarget(e){try{if("composedPath"in e){const o=e.composedPath();if(o.length)return o[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function initMutationObserver(e,o){var s,a;const $=new MutationBuffer;mutationBuffers.push($),$.init(e);let c=window.MutationObserver||window.__rrMutationObserver;const nt=(a=(s=window?.Zone)===null||s===void 0?void 0:s.__symbol__)===null||a===void 0?void 0:a.call(s,"MutationObserver");nt&&window[nt]&&(c=window[nt]);const at=new c(callbackWrapper($.processMutations.bind($)));return at.observe(o,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),at}function initMoveObserver({mousemoveCb:e,sampling:o,doc:s,mirror:a}){if(o.mousemove===!1)return()=>{};const $=typeof o.mousemove=="number"?o.mousemove:50,c=typeof o.mousemoveCallback=="number"?o.mousemoveCallback:500;let nt=[],at;const lt=throttle$1(callbackWrapper(st=>{const ct=Date.now()-at;e(nt.map(ft=>(ft.timeOffset-=ct,ft)),st),nt=[],at=null}),c),et=callbackWrapper(throttle$1(callbackWrapper(st=>{const ct=getEventTarget(st),{clientX:ft,clientY:pt}=legacy_isTouchEvent(st)?st.changedTouches[0]:st;at||(at=nowTimestamp()),nt.push({x:ft,y:pt,id:a.getId(ct),timeOffset:nowTimestamp()-at}),lt(typeof DragEvent<"u"&&st instanceof DragEvent?IncrementalSource$1.Drag:st instanceof MouseEvent?IncrementalSource$1.MouseMove:IncrementalSource$1.TouchMove)}),$,{trailing:!1})),it=[on("mousemove",et,s),on("touchmove",et,s),on("drag",et,s)];return callbackWrapper(()=>{it.forEach(st=>st())})}function initMouseInteractionObserver({mouseInteractionCb:e,doc:o,mirror:s,blockClass:a,blockSelector:$,sampling:c}){if(c.mouseInteraction===!1)return()=>{};const nt=c.mouseInteraction===!0||c.mouseInteraction===void 0?{}:c.mouseInteraction,at=[];let lt=null;const et=it=>st=>{const ct=getEventTarget(st);if(isBlocked(ct,a,$,!0))return;let ft=null,pt=it;if("pointerType"in st){switch(st.pointerType){case"mouse":ft=PointerTypes.Mouse;break;case"touch":ft=PointerTypes.Touch;break;case"pen":ft=PointerTypes.Pen;break}ft===PointerTypes.Touch?MouseInteractions[it]===MouseInteractions.MouseDown?pt="TouchStart":MouseInteractions[it]===MouseInteractions.MouseUp&&(pt="TouchEnd"):PointerTypes.Pen}else legacy_isTouchEvent(st)&&(ft=PointerTypes.Touch);ft!==null?(lt=ft,(pt.startsWith("Touch")&&ft===PointerTypes.Touch||pt.startsWith("Mouse")&&ft===PointerTypes.Mouse)&&(ft=null)):MouseInteractions[it]===MouseInteractions.Click&&(ft=lt,lt=null);const gt=legacy_isTouchEvent(st)?st.changedTouches[0]:st;if(!gt)return;const wt=s.getId(ct),{clientX:vt,clientY:_t}=gt;callbackWrapper(e)(Object.assign({type:MouseInteractions[pt],id:wt,x:vt,y:_t},ft!==null&&{pointerType:ft}))};return Object.keys(MouseInteractions).filter(it=>Number.isNaN(Number(it))&&!it.endsWith("_Departed")&&nt[it]!==!1).forEach(it=>{let st=toLowerCase(it);const ct=et(it);if(window.PointerEvent)switch(MouseInteractions[it]){case MouseInteractions.MouseDown:case MouseInteractions.MouseUp:st=st.replace("mouse","pointer");break;case MouseInteractions.TouchStart:case MouseInteractions.TouchEnd:return}at.push(on(st,ct,o))}),callbackWrapper(()=>{at.forEach(it=>it())})}function initScrollObserver({scrollCb:e,doc:o,mirror:s,blockClass:a,blockSelector:$,sampling:c}){const nt=callbackWrapper(throttle$1(callbackWrapper(at=>{const lt=getEventTarget(at);if(!lt||isBlocked(lt,a,$,!0))return;const et=s.getId(lt);if(lt===o&&o.defaultView){const it=getWindowScroll(o.defaultView);e({id:et,x:it.left,y:it.top})}else e({id:et,x:lt.scrollLeft,y:lt.scrollTop})}),c.scroll||100));return on("scroll",nt,o)}function initViewportResizeObserver({viewportResizeCb:e},{win:o}){let s=-1,a=-1;const $=callbackWrapper(throttle$1(callbackWrapper(()=>{const c=getWindowHeight(),nt=getWindowWidth();(s!==c||a!==nt)&&(e({width:Number(nt),height:Number(c)}),s=c,a=nt)}),200));return on("resize",$,o)}const INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver({inputCb:e,doc:o,mirror:s,blockClass:a,blockSelector:$,ignoreClass:c,ignoreSelector:nt,maskInputOptions:at,maskInputFn:lt,sampling:et,userTriggeredOnInput:it}){function st(_t){let $t=getEventTarget(_t);const Pt=_t.isTrusted,Nt=$t&&$t.tagName;if($t&&Nt==="OPTION"&&($t=$t.parentElement),!$t||!Nt||INPUT_TAGS.indexOf(Nt)<0||isBlocked($t,a,$,!0)||$t.classList.contains(c)||nt&&$t.matches(nt))return;let Lt=$t.value,Ft=!1;const Jt=getInputType($t)||"";Jt==="radio"||Jt==="checkbox"?Ft=$t.checked:(at[Nt.toLowerCase()]||at[Jt])&&(Lt=maskInputValue({element:$t,maskInputOptions:at,tagName:Nt,type:Jt,value:Lt,maskInputFn:lt})),ct($t,it?{text:Lt,isChecked:Ft,userTriggered:Pt}:{text:Lt,isChecked:Ft});const _r=$t.name;Jt==="radio"&&_r&&Ft&&o.querySelectorAll(`input[type="radio"][name="${_r}"]`).forEach(wr=>{if(wr!==$t){const tn=wr.value;ct(wr,it?{text:tn,isChecked:!Ft,userTriggered:!1}:{text:tn,isChecked:!Ft})}})}function ct(_t,$t){const Pt=lastInputValueMap.get(_t);if(!Pt||Pt.text!==$t.text||Pt.isChecked!==$t.isChecked){lastInputValueMap.set(_t,$t);const Nt=s.getId(_t);callbackWrapper(e)(Object.assign(Object.assign({},$t),{id:Nt}))}}const pt=(et.input==="last"?["change"]:["input","change"]).map(_t=>on(_t,callbackWrapper(st),o)),gt=o.defaultView;if(!gt)return()=>{pt.forEach(_t=>_t())};const wt=gt.Object.getOwnPropertyDescriptor(gt.HTMLInputElement.prototype,"value"),vt=[[gt.HTMLInputElement.prototype,"value"],[gt.HTMLInputElement.prototype,"checked"],[gt.HTMLSelectElement.prototype,"value"],[gt.HTMLTextAreaElement.prototype,"value"],[gt.HTMLSelectElement.prototype,"selectedIndex"],[gt.HTMLOptionElement.prototype,"selected"]];return wt&&wt.set&&pt.push(...vt.map(_t=>hookSetter(_t[0],_t[1],{set(){callbackWrapper(st)({target:this,isTrusted:!1})}},!1,gt))),callbackWrapper(()=>{pt.forEach(_t=>_t())})}function getNestedCSSRulePositions(e){const o=[];function s(a,$){if(hasNestedCSSRule("CSSGroupingRule")&&a.parentRule instanceof CSSGroupingRule||hasNestedCSSRule("CSSMediaRule")&&a.parentRule instanceof CSSMediaRule||hasNestedCSSRule("CSSSupportsRule")&&a.parentRule instanceof CSSSupportsRule||hasNestedCSSRule("CSSConditionRule")&&a.parentRule instanceof CSSConditionRule){const nt=Array.from(a.parentRule.cssRules).indexOf(a);$.unshift(nt)}else if(a.parentStyleSheet){const nt=Array.from(a.parentStyleSheet.cssRules).indexOf(a);$.unshift(nt)}return $}return s(e,o)}function getIdAndStyleId(e,o,s){let a,$;return e?(e.ownerNode?a=o.getId(e.ownerNode):$=s.getId(e),{styleId:$,id:a}):{}}function initStyleSheetObserver({styleSheetRuleCb:e,mirror:o,stylesheetManager:s},{win:a}){if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};const $=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy($,{apply:callbackWrapper((it,st,ct)=>{const[ft,pt]=ct,{id:gt,styleId:wt}=getIdAndStyleId(st,o,s.styleMirror);return(gt&&gt!==-1||wt&&wt!==-1)&&e({id:gt,styleId:wt,adds:[{rule:ft,index:pt}]}),it.apply(st,ct)})});const c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:callbackWrapper((it,st,ct)=>{const[ft]=ct,{id:pt,styleId:gt}=getIdAndStyleId(st,o,s.styleMirror);return(pt&&pt!==-1||gt&&gt!==-1)&&e({id:pt,styleId:gt,removes:[{index:ft}]}),it.apply(st,ct)})});let nt;a.CSSStyleSheet.prototype.replace&&(nt=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(nt,{apply:callbackWrapper((it,st,ct)=>{const[ft]=ct,{id:pt,styleId:gt}=getIdAndStyleId(st,o,s.styleMirror);return(pt&&pt!==-1||gt&&gt!==-1)&&e({id:pt,styleId:gt,replace:ft}),it.apply(st,ct)})}));let at;a.CSSStyleSheet.prototype.replaceSync&&(at=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(at,{apply:callbackWrapper((it,st,ct)=>{const[ft]=ct,{id:pt,styleId:gt}=getIdAndStyleId(st,o,s.styleMirror);return(pt&&pt!==-1||gt&&gt!==-1)&&e({id:pt,styleId:gt,replaceSync:ft}),it.apply(st,ct)})}));const lt={};canMonkeyPatchNestedCSSRule("CSSGroupingRule")?lt.CSSGroupingRule=a.CSSGroupingRule:(canMonkeyPatchNestedCSSRule("CSSMediaRule")&&(lt.CSSMediaRule=a.CSSMediaRule),canMonkeyPatchNestedCSSRule("CSSConditionRule")&&(lt.CSSConditionRule=a.CSSConditionRule),canMonkeyPatchNestedCSSRule("CSSSupportsRule")&&(lt.CSSSupportsRule=a.CSSSupportsRule));const et={};return Object.entries(lt).forEach(([it,st])=>{et[it]={insertRule:st.prototype.insertRule,deleteRule:st.prototype.deleteRule},st.prototype.insertRule=new Proxy(et[it].insertRule,{apply:callbackWrapper((ct,ft,pt)=>{const[gt,wt]=pt,{id:vt,styleId:_t}=getIdAndStyleId(ft.parentStyleSheet,o,s.styleMirror);return(vt&&vt!==-1||_t&&_t!==-1)&&e({id:vt,styleId:_t,adds:[{rule:gt,index:[...getNestedCSSRulePositions(ft),wt||0]}]}),ct.apply(ft,pt)})}),st.prototype.deleteRule=new Proxy(et[it].deleteRule,{apply:callbackWrapper((ct,ft,pt)=>{const[gt]=pt,{id:wt,styleId:vt}=getIdAndStyleId(ft.parentStyleSheet,o,s.styleMirror);return(wt&&wt!==-1||vt&&vt!==-1)&&e({id:wt,styleId:vt,removes:[{index:[...getNestedCSSRulePositions(ft),gt]}]}),ct.apply(ft,pt)})})}),callbackWrapper(()=>{a.CSSStyleSheet.prototype.insertRule=$,a.CSSStyleSheet.prototype.deleteRule=c,nt&&(a.CSSStyleSheet.prototype.replace=nt),at&&(a.CSSStyleSheet.prototype.replaceSync=at),Object.entries(lt).forEach(([it,st])=>{st.prototype.insertRule=et[it].insertRule,st.prototype.deleteRule=et[it].deleteRule})})}function initAdoptedStyleSheetObserver({mirror:e,stylesheetManager:o},s){var a,$,c;let nt=null;s.nodeName==="#document"?nt=e.getId(s):nt=e.getId(s.host);const at=s.nodeName==="#document"?(a=s.defaultView)===null||a===void 0?void 0:a.Document:(c=($=s.ownerDocument)===null||$===void 0?void 0:$.defaultView)===null||c===void 0?void 0:c.ShadowRoot,lt=at?.prototype?Object.getOwnPropertyDescriptor(at?.prototype,"adoptedStyleSheets"):void 0;return nt===null||nt===-1||!at||!lt?()=>{}:(Object.defineProperty(s,"adoptedStyleSheets",{configurable:lt.configurable,enumerable:lt.enumerable,get(){var et;return(et=lt.get)===null||et===void 0?void 0:et.call(this)},set(et){var it;const st=(it=lt.set)===null||it===void 0?void 0:it.call(this,et);if(nt!==null&&nt!==-1)try{o.adoptStyleSheets(et,nt)}catch{}return st}}),callbackWrapper(()=>{Object.defineProperty(s,"adoptedStyleSheets",{configurable:lt.configurable,enumerable:lt.enumerable,get:lt.get,set:lt.set})}))}function initStyleDeclarationObserver({styleDeclarationCb:e,mirror:o,ignoreCSSAttributes:s,stylesheetManager:a},{win:$}){const c=$.CSSStyleDeclaration.prototype.setProperty;$.CSSStyleDeclaration.prototype.setProperty=new Proxy(c,{apply:callbackWrapper((at,lt,et)=>{var it;const[st,ct,ft]=et;if(s.has(st))return c.apply(lt,[st,ct,ft]);const{id:pt,styleId:gt}=getIdAndStyleId((it=lt.parentRule)===null||it===void 0?void 0:it.parentStyleSheet,o,a.styleMirror);return(pt&&pt!==-1||gt&&gt!==-1)&&e({id:pt,styleId:gt,set:{property:st,value:ct,priority:ft},index:getNestedCSSRulePositions(lt.parentRule)}),at.apply(lt,et)})});const nt=$.CSSStyleDeclaration.prototype.removeProperty;return $.CSSStyleDeclaration.prototype.removeProperty=new Proxy(nt,{apply:callbackWrapper((at,lt,et)=>{var it;const[st]=et;if(s.has(st))return nt.apply(lt,[st]);const{id:ct,styleId:ft}=getIdAndStyleId((it=lt.parentRule)===null||it===void 0?void 0:it.parentStyleSheet,o,a.styleMirror);return(ct&&ct!==-1||ft&&ft!==-1)&&e({id:ct,styleId:ft,remove:{property:st},index:getNestedCSSRulePositions(lt.parentRule)}),at.apply(lt,et)})}),callbackWrapper(()=>{$.CSSStyleDeclaration.prototype.setProperty=c,$.CSSStyleDeclaration.prototype.removeProperty=nt})}function initMediaInteractionObserver({mediaInteractionCb:e,blockClass:o,blockSelector:s,mirror:a,sampling:$,doc:c}){const nt=callbackWrapper(lt=>throttle$1(callbackWrapper(et=>{const it=getEventTarget(et);if(!it||isBlocked(it,o,s,!0))return;const{currentTime:st,volume:ct,muted:ft,playbackRate:pt,loop:gt}=it;e({type:lt,id:a.getId(it),currentTime:st,volume:ct,muted:ft,playbackRate:pt,loop:gt})}),$.media||500)),at=[on("play",nt(0),c),on("pause",nt(1),c),on("seeked",nt(2),c),on("volumechange",nt(3),c),on("ratechange",nt(4),c)];return callbackWrapper(()=>{at.forEach(lt=>lt())})}function initFontObserver({fontCb:e,doc:o}){const s=o.defaultView;if(!s)return()=>{};const a=[],$=new WeakMap,c=s.FontFace;s.FontFace=function(lt,et,it){const st=new c(lt,et,it);return $.set(st,{family:lt,buffer:typeof et!="string",descriptors:it,fontSource:typeof et=="string"?et:JSON.stringify(Array.from(new Uint8Array(et)))}),st};const nt=patch(o.fonts,"add",function(at){return function(lt){return setTimeout(callbackWrapper(()=>{const et=$.get(lt);et&&(e(et),$.delete(lt))}),0),at.apply(this,[lt])}});return a.push(()=>{s.FontFace=c}),a.push(nt),callbackWrapper(()=>{a.forEach(at=>at())})}function initSelectionObserver(e){const{doc:o,mirror:s,blockClass:a,blockSelector:$,selectionCb:c}=e;let nt=!0;const at=callbackWrapper(()=>{const lt=o.getSelection();if(!lt||nt&&lt?.isCollapsed)return;nt=lt.isCollapsed||!1;const et=[],it=lt.rangeCount||0;for(let st=0;st<it;st++){const ct=lt.getRangeAt(st),{startContainer:ft,startOffset:pt,endContainer:gt,endOffset:wt}=ct;isBlocked(ft,a,$,!0)||isBlocked(gt,a,$,!0)||et.push({start:s.getId(ft),startOffset:pt,end:s.getId(gt),endOffset:wt})}c({ranges:et})});return at(),on("selectionchange",at)}function initCustomElementObserver({doc:e,customElementCb:o}){const s=e.defaultView;return!s||!s.customElements?()=>{}:patch(s.customElements,"define",function($){return function(c,nt,at){try{o({define:{name:c}})}catch{console.warn(`Custom element callback failed for ${c}`)}return $.apply(this,[c,nt,at])}})}function mergeHooks(e,o){const{mutationCb:s,mousemoveCb:a,mouseInteractionCb:$,scrollCb:c,viewportResizeCb:nt,inputCb:at,mediaInteractionCb:lt,styleSheetRuleCb:et,styleDeclarationCb:it,canvasMutationCb:st,fontCb:ct,selectionCb:ft,customElementCb:pt}=e;e.mutationCb=(...gt)=>{o.mutation&&o.mutation(...gt),s(...gt)},e.mousemoveCb=(...gt)=>{o.mousemove&&o.mousemove(...gt),a(...gt)},e.mouseInteractionCb=(...gt)=>{o.mouseInteraction&&o.mouseInteraction(...gt),$(...gt)},e.scrollCb=(...gt)=>{o.scroll&&o.scroll(...gt),c(...gt)},e.viewportResizeCb=(...gt)=>{o.viewportResize&&o.viewportResize(...gt),nt(...gt)},e.inputCb=(...gt)=>{o.input&&o.input(...gt),at(...gt)},e.mediaInteractionCb=(...gt)=>{o.mediaInteaction&&o.mediaInteaction(...gt),lt(...gt)},e.styleSheetRuleCb=(...gt)=>{o.styleSheetRule&&o.styleSheetRule(...gt),et(...gt)},e.styleDeclarationCb=(...gt)=>{o.styleDeclaration&&o.styleDeclaration(...gt),it(...gt)},e.canvasMutationCb=(...gt)=>{o.canvasMutation&&o.canvasMutation(...gt),st(...gt)},e.fontCb=(...gt)=>{o.font&&o.font(...gt),ct(...gt)},e.selectionCb=(...gt)=>{o.selection&&o.selection(...gt),ft(...gt)},e.customElementCb=(...gt)=>{o.customElement&&o.customElement(...gt),pt(...gt)}}function initObservers(e,o={}){const s=e.doc.defaultView;if(!s)return()=>{};mergeHooks(e,o);let a;e.recordDOM&&(a=initMutationObserver(e,e.doc));const $=initMoveObserver(e),c=initMouseInteractionObserver(e),nt=initScrollObserver(e),at=initViewportResizeObserver(e,{win:s}),lt=initInputObserver(e),et=initMediaInteractionObserver(e);let it=()=>{},st=()=>{},ct=()=>{},ft=()=>{};e.recordDOM&&(it=initStyleSheetObserver(e,{win:s}),st=initAdoptedStyleSheetObserver(e,e.doc),ct=initStyleDeclarationObserver(e,{win:s}),e.collectFonts&&(ft=initFontObserver(e)));const pt=initSelectionObserver(e),gt=initCustomElementObserver(e),wt=[];for(const vt of e.plugins)wt.push(vt.observer(vt.callback,s,vt.options));return callbackWrapper(()=>{mutationBuffers.forEach(vt=>vt.reset()),a?.disconnect(),$(),c(),nt(),at(),lt(),et(),it(),st(),ct(),ft(),pt(),gt(),wt.forEach(vt=>vt())})}function hasNestedCSSRule(e){return typeof window[e]<"u"}function canMonkeyPatchNestedCSSRule(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class CrossOriginIframeMirror{constructor(o){this.generateIdFn=o,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(o,s,a,$){const c=a||this.getIdToRemoteIdMap(o),nt=$||this.getRemoteIdToIdMap(o);let at=c.get(s);return at||(at=this.generateIdFn(),c.set(s,at),nt.set(at,s)),at}getIds(o,s){const a=this.getIdToRemoteIdMap(o),$=this.getRemoteIdToIdMap(o);return s.map(c=>this.getId(o,c,a,$))}getRemoteId(o,s,a){const $=a||this.getRemoteIdToIdMap(o);if(typeof s!="number")return s;const c=$.get(s);return c||-1}getRemoteIds(o,s){const a=this.getRemoteIdToIdMap(o);return s.map($=>this.getRemoteId(o,$,a))}reset(o){if(!o){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(o),this.iframeRemoteIdToIdMap.delete(o)}getIdToRemoteIdMap(o){let s=this.iframeIdToRemoteIdMap.get(o);return s||(s=new Map,this.iframeIdToRemoteIdMap.set(o,s)),s}getRemoteIdToIdMap(o){let s=this.iframeRemoteIdToIdMap.get(o);return s||(s=new Map,this.iframeRemoteIdToIdMap.set(o,s)),s}}class IframeManager{constructor(o){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new CrossOriginIframeMirror(genId),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=o.mutationCb,this.wrappedEmit=o.wrappedEmit,this.stylesheetManager=o.stylesheetManager,this.recordCrossOriginIframes=o.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=o.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(o){this.iframes.set(o,!0),o.contentWindow&&this.crossOriginIframeMap.set(o.contentWindow,o)}addLoadListener(o){this.loadListener=o}attachIframe(o,s){var a;this.mutationCb({adds:[{parentId:this.mirror.getId(o),nextId:null,node:s}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(a=this.loadListener)===null||a===void 0||a.call(this,o),o.contentDocument&&o.contentDocument.adoptedStyleSheets&&o.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(o.contentDocument.adoptedStyleSheets,this.mirror.getId(o.contentDocument))}handleMessage(o){const s=o;if(s.data.type!=="rrweb"||s.origin!==s.data.origin||!o.source)return;const $=this.crossOriginIframeMap.get(o.source);if(!$)return;const c=this.transformCrossOriginEvent($,s.data.event);c&&this.wrappedEmit(c,s.data.isCheckout)}transformCrossOriginEvent(o,s){var a;switch(s.type){case EventType$1.FullSnapshot:{this.crossOriginIframeMirror.reset(o),this.crossOriginIframeStyleMirror.reset(o),this.replaceIdOnNode(s.data.node,o);const $=s.data.node.id;return this.crossOriginIframeRootIdMap.set(o,$),this.patchRootIdOnNode(s.data.node,$),{timestamp:s.timestamp,type:EventType$1.IncrementalSnapshot,data:{source:IncrementalSource$1.Mutation,adds:[{parentId:this.mirror.getId(o),nextId:null,node:s.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case EventType$1.Meta:case EventType$1.Load:case EventType$1.DomContentLoaded:return!1;case EventType$1.Plugin:return s;case EventType$1.Custom:return this.replaceIds(s.data.payload,o,["id","parentId","previousId","nextId"]),s;case EventType$1.IncrementalSnapshot:switch(s.data.source){case IncrementalSource$1.Mutation:return s.data.adds.forEach($=>{this.replaceIds($,o,["parentId","nextId","previousId"]),this.replaceIdOnNode($.node,o);const c=this.crossOriginIframeRootIdMap.get(o);c&&this.patchRootIdOnNode($.node,c)}),s.data.removes.forEach($=>{this.replaceIds($,o,["parentId","id"])}),s.data.attributes.forEach($=>{this.replaceIds($,o,["id"])}),s.data.texts.forEach($=>{this.replaceIds($,o,["id"])}),s;case IncrementalSource$1.Drag:case IncrementalSource$1.TouchMove:case IncrementalSource$1.MouseMove:return s.data.positions.forEach($=>{this.replaceIds($,o,["id"])}),s;case IncrementalSource$1.ViewportResize:return!1;case IncrementalSource$1.MediaInteraction:case IncrementalSource$1.MouseInteraction:case IncrementalSource$1.Scroll:case IncrementalSource$1.CanvasMutation:case IncrementalSource$1.Input:return this.replaceIds(s.data,o,["id"]),s;case IncrementalSource$1.StyleSheetRule:case IncrementalSource$1.StyleDeclaration:return this.replaceIds(s.data,o,["id"]),this.replaceStyleIds(s.data,o,["styleId"]),s;case IncrementalSource$1.Font:return s;case IncrementalSource$1.Selection:return s.data.ranges.forEach($=>{this.replaceIds($,o,["start","end"])}),s;case IncrementalSource$1.AdoptedStyleSheet:return this.replaceIds(s.data,o,["id"]),this.replaceStyleIds(s.data,o,["styleIds"]),(a=s.data.styles)===null||a===void 0||a.forEach($=>{this.replaceStyleIds($,o,["styleId"])}),s}}return!1}replace(o,s,a,$){for(const c of $)!Array.isArray(s[c])&&typeof s[c]!="number"||(Array.isArray(s[c])?s[c]=o.getIds(a,s[c]):s[c]=o.getId(a,s[c]));return s}replaceIds(o,s,a){return this.replace(this.crossOriginIframeMirror,o,s,a)}replaceStyleIds(o,s,a){return this.replace(this.crossOriginIframeStyleMirror,o,s,a)}replaceIdOnNode(o,s){this.replaceIds(o,s,["id","rootId"]),"childNodes"in o&&o.childNodes.forEach(a=>{this.replaceIdOnNode(a,s)})}patchRootIdOnNode(o,s){o.type!==NodeType.Document&&!o.rootId&&(o.rootId=s),"childNodes"in o&&o.childNodes.forEach(a=>{this.patchRootIdOnNode(a,s)})}}class ShadowDomManager{constructor(o){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=o.mutationCb,this.scrollCb=o.scrollCb,this.bypassOptions=o.bypassOptions,this.mirror=o.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(o,s){if(!isNativeShadowDom(o)||this.shadowDoms.has(o))return;this.shadowDoms.add(o);const a=initMutationObserver(Object.assign(Object.assign({},this.bypassOptions),{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),o);this.restoreHandlers.push(()=>a.disconnect()),this.restoreHandlers.push(initScrollObserver(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:o,mirror:this.mirror}))),setTimeout(()=>{o.adoptedStyleSheets&&o.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(o.adoptedStyleSheets,this.mirror.getId(o.host)),this.restoreHandlers.push(initAdoptedStyleSheetObserver({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},o))},0)}observeAttachShadow(o){!o.contentWindow||!o.contentDocument||this.patchAttachShadow(o.contentWindow.Element,o.contentDocument)}patchAttachShadow(o,s){const a=this;this.restoreHandlers.push(patch(o.prototype,"attachShadow",function($){return function(c){const nt=$.call(this,c);return this.shadowRoot&&inDom(this)&&a.addShadowRoot(this.shadowRoot,s),nt}}))}reset(){this.restoreHandlers.forEach(o=>{try{o()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function __rest(e,o){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&o.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $=0,a=Object.getOwnPropertySymbols(e);$<a.length;$++)o.indexOf(a[$])<0&&Object.prototype.propertyIsEnumerable.call(e,a[$])&&(s[a[$]]=e[a[$]]);return s}function __awaiter(e,o,s,a){function $(c){return c instanceof s?c:new s(function(nt){nt(c)})}return new(s||(s=Promise))(function(c,nt){function at(it){try{et(a.next(it))}catch(st){nt(st)}}function lt(it){try{et(a.throw(it))}catch(st){nt(st)}}function et(it){it.done?c(it.value):$(it.value).then(at,lt)}et((a=a.apply(e,[])).next())})}var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var i=0;i<chars.length;i++)lookup[chars.charCodeAt(i)]=i;var encode=function(e){var o=new Uint8Array(e),s,a=o.length,$="";for(s=0;s<a;s+=3)$+=chars[o[s]>>2],$+=chars[(o[s]&3)<<4|o[s+1]>>4],$+=chars[(o[s+1]&15)<<2|o[s+2]>>6],$+=chars[o[s+2]&63];return a%3===2?$=$.substring(0,$.length-1)+"=":a%3===1&&($=$.substring(0,$.length-2)+"=="),$};const canvasVarMap=new Map;function variableListFor(e,o){let s=canvasVarMap.get(e);return s||(s=new Map,canvasVarMap.set(e,s)),s.has(o)||s.set(o,[]),s.get(o)}const saveWebGLVar=(e,o,s)=>{if(!e||!(isInstanceOfWebGLObject(e,o)||typeof e=="object"))return;const a=e.constructor.name,$=variableListFor(s,a);let c=$.indexOf(e);return c===-1&&(c=$.length,$.push(e)),c};function serializeArg(e,o,s){if(e instanceof Array)return e.map(a=>serializeArg(a,o,s));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const a=e.constructor.name,$=encode(e);return{rr_type:a,base64:$}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[serializeArg(e.buffer,o,s),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const a=e.constructor.name,{src:$}=e;return{rr_type:a,src:$}}else if(e instanceof HTMLCanvasElement){const a="HTMLImageElement",$=e.toDataURL();return{rr_type:a,src:$}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[serializeArg(e.data,o,s),e.width,e.height]};if(isInstanceOfWebGLObject(e,o)||typeof e=="object"){const a=e.constructor.name,$=saveWebGLVar(e,o,s);return{rr_type:a,index:$}}}}return e}const serializeArgs=(e,o,s)=>e.map(a=>serializeArg(a,o,s)),isInstanceOfWebGLObject=(e,o)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter($=>typeof o[$]=="function").find($=>e instanceof o[$]);function initCanvas2DMutationObserver(e,o,s,a){const $=[],c=Object.getOwnPropertyNames(o.CanvasRenderingContext2D.prototype);for(const nt of c)try{if(typeof o.CanvasRenderingContext2D.prototype[nt]!="function")continue;const at=patch(o.CanvasRenderingContext2D.prototype,nt,function(lt){return function(...et){return isBlocked(this.canvas,s,a,!0)||setTimeout(()=>{const it=serializeArgs(et,o,this);e(this.canvas,{type:CanvasContext["2D"],property:nt,args:it})},0),lt.apply(this,et)}});$.push(at)}catch{const lt=hookSetter(o.CanvasRenderingContext2D.prototype,nt,{set(et){e(this.canvas,{type:CanvasContext["2D"],property:nt,args:[et],setter:!0})}});$.push(lt)}return()=>{$.forEach(nt=>nt())}}function getNormalizedContextName(e){return e==="experimental-webgl"?"webgl":e}function initCanvasContextObserver(e,o,s,a){const $=[];try{const c=patch(e.HTMLCanvasElement.prototype,"getContext",function(nt){return function(at,...lt){if(!isBlocked(this,o,s,!0)){const et=getNormalizedContextName(at);if("__context"in this||(this.__context=et),a&&["webgl","webgl2"].includes(et))if(lt[0]&&typeof lt[0]=="object"){const it=lt[0];it.preserveDrawingBuffer||(it.preserveDrawingBuffer=!0)}else lt.splice(0,1,{preserveDrawingBuffer:!0})}return nt.apply(this,[at,...lt])}});$.push(c)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{$.forEach(c=>c())}}function patchGLPrototype(e,o,s,a,$,c,nt){const at=[],lt=Object.getOwnPropertyNames(e);for(const et of lt)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(et))try{if(typeof e[et]!="function")continue;const it=patch(e,et,function(st){return function(...ct){const ft=st.apply(this,ct);if(saveWebGLVar(ft,nt,this),"tagName"in this.canvas&&!isBlocked(this.canvas,a,$,!0)){const pt=serializeArgs(ct,nt,this),gt={type:o,property:et,args:pt};s(this.canvas,gt)}return ft}});at.push(it)}catch{const st=hookSetter(e,et,{set(ct){s(this.canvas,{type:o,property:et,args:[ct],setter:!0})}});at.push(st)}return at}function initCanvasWebGLMutationObserver(e,o,s,a,$){const c=[];return c.push(...patchGLPrototype(o.WebGLRenderingContext.prototype,CanvasContext.WebGL,e,s,a,$,o)),typeof o.WebGL2RenderingContext<"u"&&c.push(...patchGLPrototype(o.WebGL2RenderingContext.prototype,CanvasContext.WebGL2,e,s,a,$,o)),()=>{c.forEach(nt=>nt())}}function funcToSource(e,o){var s=e.toString(),a=s.split(`
`);a.pop(),a.shift();for(var $=a[0].search(/\S/),c=/(['"])__worker_loader_strict__(['"])/g,nt=0,at=a.length;nt<at;++nt)a[nt]=a[nt].substring($).replace(c,"$1use strict$2")+`
`;return a}function createURL(e,o){var s=funcToSource(e),a=new Blob(s,{type:"application/javascript"});return URL.createObjectURL(a)}function createInlineWorkerFactory(e,o){var s;return function($){return s=s||createURL(e),new Worker(s,$)}}var WorkerFactory=createInlineWorkerFactory(function(){(function(){"__worker_loader_strict__";/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function e(et,it,st,ct){function ft(pt){return pt instanceof st?pt:new st(function(gt){gt(pt)})}return new(st||(st=Promise))(function(pt,gt){function wt($t){try{_t(ct.next($t))}catch(Pt){gt(Pt)}}function vt($t){try{_t(ct.throw($t))}catch(Pt){gt(Pt)}}function _t($t){$t.done?pt($t.value):ft($t.value).then(wt,vt)}_t((ct=ct.apply(et,[])).next())})}for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=typeof Uint8Array>"u"?[]:new Uint8Array(256),a=0;a<o.length;a++)s[o.charCodeAt(a)]=a;var $=function(et){var it=new Uint8Array(et),st,ct=it.length,ft="";for(st=0;st<ct;st+=3)ft+=o[it[st]>>2],ft+=o[(it[st]&3)<<4|it[st+1]>>4],ft+=o[(it[st+1]&15)<<2|it[st+2]>>6],ft+=o[it[st+2]&63];return ct%3===2?ft=ft.substring(0,ft.length-1)+"=":ct%3===1&&(ft=ft.substring(0,ft.length-2)+"=="),ft};const c=new Map,nt=new Map;function at(et,it,st){return e(this,void 0,void 0,function*(){const ct=`${et}-${it}`;if("OffscreenCanvas"in globalThis){if(nt.has(ct))return nt.get(ct);const ft=new OffscreenCanvas(et,it);ft.getContext("2d");const gt=yield(yield ft.convertToBlob(st)).arrayBuffer(),wt=$(gt);return nt.set(ct,wt),wt}else return""})}const lt=self;lt.onmessage=function(et){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:it,bitmap:st,width:ct,height:ft,dataURLOptions:pt}=et.data,gt=at(ct,ft,pt),wt=new OffscreenCanvas(ct,ft);wt.getContext("2d").drawImage(st,0,0),st.close();const _t=yield wt.convertToBlob(pt),$t=_t.type,Pt=yield _t.arrayBuffer(),Nt=$(Pt);if(!c.has(it)&&(yield gt)===Nt)return c.set(it,Nt),lt.postMessage({id:it});if(c.get(it)===Nt)return lt.postMessage({id:it});lt.postMessage({id:it,type:$t,base64:Nt,width:ct,height:ft}),c.set(it,Nt)}else return lt.postMessage({id:et.data.id})})}})()});class CanvasManager{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(o){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(lt,et)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(lt)||this.pendingCanvasMutations.set(lt,[]),this.pendingCanvasMutations.get(lt).push(et)};const{sampling:s="all",win:a,blockClass:$,blockSelector:c,recordCanvas:nt,dataURLOptions:at}=o;this.mutationCb=o.mutationCb,this.mirror=o.mirror,nt&&s==="all"&&this.initCanvasMutationObserver(a,$,c),nt&&typeof s=="number"&&this.initCanvasFPSObserver(s,a,$,c,{dataURLOptions:at})}initCanvasFPSObserver(o,s,a,$,c){const nt=initCanvasContextObserver(s,a,$,!0),at=new Map,lt=new WorkerFactory;lt.onmessage=pt=>{const{id:gt}=pt.data;if(at.set(gt,!1),!("base64"in pt.data))return;const{base64:wt,type:vt,width:_t,height:$t}=pt.data;this.mutationCb({id:gt,type:CanvasContext["2D"],commands:[{property:"clearRect",args:[0,0,_t,$t]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:wt}],type:vt}]},0,0]}]})};const et=1e3/o;let it=0,st;const ct=()=>{const pt=[];return s.document.querySelectorAll("canvas").forEach(gt=>{isBlocked(gt,a,$,!0)||pt.push(gt)}),pt},ft=pt=>{if(it&&pt-it<et){st=requestAnimationFrame(ft);return}it=pt,ct().forEach(gt=>__awaiter(this,void 0,void 0,function*(){var wt;const vt=this.mirror.getId(gt);if(at.get(vt)||gt.width===0||gt.height===0)return;if(at.set(vt,!0),["webgl","webgl2"].includes(gt.__context)){const $t=gt.getContext(gt.__context);((wt=$t?.getContextAttributes())===null||wt===void 0?void 0:wt.preserveDrawingBuffer)===!1&&$t.clear($t.COLOR_BUFFER_BIT)}const _t=yield createImageBitmap(gt);lt.postMessage({id:vt,bitmap:_t,width:gt.width,height:gt.height,dataURLOptions:c.dataURLOptions},[_t])})),st=requestAnimationFrame(ft)};st=requestAnimationFrame(ft),this.resetObservers=()=>{nt(),cancelAnimationFrame(st)}}initCanvasMutationObserver(o,s,a){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const $=initCanvasContextObserver(o,s,a,!1),c=initCanvas2DMutationObserver(this.processMutation.bind(this),o,s,a),nt=initCanvasWebGLMutationObserver(this.processMutation.bind(this),o,s,a,this.mirror);this.resetObservers=()=>{$(),c(),nt()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const o=s=>{this.rafStamps.latestId=s,requestAnimationFrame(o)};requestAnimationFrame(o)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((o,s)=>{const a=this.mirror.getId(s);this.flushPendingCanvasMutationFor(s,a)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(o,s){if(this.frozen||this.locked)return;const a=this.pendingCanvasMutations.get(o);if(!a||s===-1)return;const $=a.map(nt=>__rest(nt,["type"])),{type:c}=a[0];this.mutationCb({id:s,type:c,commands:$}),this.pendingCanvasMutations.delete(o)}}class StylesheetManager{constructor(o){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=o.mutationCb,this.adoptedStyleSheetCb=o.adoptedStyleSheetCb}attachLinkElement(o,s){"_cssText"in s.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:s.id,attributes:s.attributes}]}),this.trackLinkElement(o)}trackLinkElement(o){this.trackedLinkElements.has(o)||(this.trackedLinkElements.add(o),this.trackStylesheetInLinkElement(o))}adoptStyleSheets(o,s){if(o.length===0)return;const a={id:s,styleIds:[]},$=[];for(const c of o){let nt;this.styleMirror.has(c)?nt=this.styleMirror.getId(c):(nt=this.styleMirror.add(c),$.push({styleId:nt,rules:Array.from(c.rules||CSSRule,(at,lt)=>({rule:stringifyRule(at),index:lt}))})),a.styleIds.push(nt)}$.length>0&&(a.styles=$),this.adoptedStyleSheetCb(a)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(o){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(o,s){const a=this.nodeMap.get(o);return a&&Array.from(a).some($=>$!==s)}add(o,s){this.nodeMap.set(o,(this.nodeMap.get(o)||new Set).add(s))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(e){return Object.assign(Object.assign({},e),{timestamp:nowTimestamp()})}let wrappedEmit,takeFullSnapshot,canvasManager,recording=!1;const mirror=createMirror();function record(e={}){const{emit:o,checkoutEveryNms:s,checkoutEveryNth:a,blockClass:$="rr-block",blockSelector:c=null,ignoreClass:nt="rr-ignore",ignoreSelector:at=null,maskTextClass:lt="rr-mask",maskTextSelector:et=null,inlineStylesheet:it=!0,maskAllInputs:st,maskInputOptions:ct,slimDOMOptions:ft,maskInputFn:pt,maskTextFn:gt,hooks:wt,packFn:vt,sampling:_t={},dataURLOptions:$t={},mousemoveWait:Pt,recordDOM:Nt=!0,recordCanvas:Lt=!1,recordCrossOriginIframes:Ft=!1,recordAfter:Jt=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:_r=!1,collectFonts:wr=!1,inlineImages:tn=!1,plugins:Wt,keepIframeSrcFn:Yr=()=>!1,ignoreCSSAttributes:Ot=new Set([]),errorHandler:gr}=e;registerErrorHandler(gr);const $o=Ft?window.parent===window:!0;let In=!1;if(!$o)try{window.parent.document&&(In=!1)}catch{In=!0}if($o&&!o)throw new Error("emit function is required");Pt!==void 0&&_t.mousemove===void 0&&(_t.mousemove=Pt),mirror.reset();const en=st===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:ct!==void 0?ct:{password:!0},Lr=ft===!0||ft==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:ft==="all",headMetaDescKeywords:ft==="all"}:ft||{};polyfill();let ko,Ir=0;const Dr=Fo=>{for(const Js of Wt||[])Js.eventProcessor&&(Fo=Js.eventProcessor(Fo));return vt&&!In&&(Fo=vt(Fo)),Fo};wrappedEmit=(Fo,Js)=>{var Ks;if(!((Ks=mutationBuffers[0])===null||Ks===void 0)&&Ks.isFrozen()&&Fo.type!==EventType$1.FullSnapshot&&!(Fo.type===EventType$1.IncrementalSnapshot&&Fo.data.source===IncrementalSource$1.Mutation)&&mutationBuffers.forEach(Dt=>Dt.unfreeze()),$o)o?.(Dr(Fo),Js);else if(In){const Dt={type:"rrweb",event:Dr(Fo),origin:window.location.origin,isCheckout:Js};window.parent.postMessage(Dt,"*")}if(Fo.type===EventType$1.FullSnapshot)ko=Fo,Ir=0;else if(Fo.type===EventType$1.IncrementalSnapshot){if(Fo.data.source===IncrementalSource$1.Mutation&&Fo.data.isAttachIframe)return;Ir++;const Dt=a&&Ir>=a,Eo=s&&Fo.timestamp-ko.timestamp>s;(Dt||Eo)&&takeFullSnapshot(!0)}};const Zr=Fo=>{wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.Mutation},Fo)}))},rn=Fo=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.Scroll},Fo)})),On=Fo=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.CanvasMutation},Fo)})),zo=Fo=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.AdoptedStyleSheet},Fo)})),Yo=new StylesheetManager({mutationCb:Zr,adoptedStyleSheetCb:zo}),jo=new IframeManager({mirror,mutationCb:Zr,stylesheetManager:Yo,recordCrossOriginIframes:Ft,wrappedEmit});for(const Fo of Wt||[])Fo.getMirror&&Fo.getMirror({nodeMirror:mirror,crossOriginIframeMirror:jo.crossOriginIframeMirror,crossOriginIframeStyleMirror:jo.crossOriginIframeStyleMirror});const Ko=new ProcessedNodeManager;canvasManager=new CanvasManager({recordCanvas:Lt,mutationCb:On,win:window,blockClass:$,blockSelector:c,mirror,sampling:_t.canvas,dataURLOptions:$t});const Zo=new ShadowDomManager({mutationCb:Zr,scrollCb:rn,bypassOptions:{blockClass:$,blockSelector:c,maskTextClass:lt,maskTextSelector:et,inlineStylesheet:it,maskInputOptions:en,dataURLOptions:$t,maskTextFn:gt,maskInputFn:pt,recordCanvas:Lt,inlineImages:tn,sampling:_t,slimDOMOptions:Lr,iframeManager:jo,stylesheetManager:Yo,canvasManager,keepIframeSrcFn:Yr,processedNodeManager:Ko},mirror});takeFullSnapshot=(Fo=!1)=>{if(!Nt)return;wrappedEmit(wrapEvent({type:EventType$1.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),Fo),Yo.reset(),Zo.init(),mutationBuffers.forEach(Ks=>Ks.lock());const Js=snapshot(document,{mirror,blockClass:$,blockSelector:c,maskTextClass:lt,maskTextSelector:et,inlineStylesheet:it,maskAllInputs:en,maskTextFn:gt,slimDOM:Lr,dataURLOptions:$t,recordCanvas:Lt,inlineImages:tn,onSerialize:Ks=>{isSerializedIframe(Ks,mirror)&&jo.addIframe(Ks),isSerializedStylesheet(Ks,mirror)&&Yo.trackLinkElement(Ks),hasShadowRoot(Ks)&&Zo.addShadowRoot(Ks.shadowRoot,document)},onIframeLoad:(Ks,Dt)=>{jo.attachIframe(Ks,Dt),Zo.observeAttachShadow(Ks)},onStylesheetLoad:(Ks,Dt)=>{Yo.attachLinkElement(Ks,Dt)},keepIframeSrcFn:Yr});if(!Js)return console.warn("Failed to snapshot the document");wrappedEmit(wrapEvent({type:EventType$1.FullSnapshot,data:{node:Js,initialOffset:getWindowScroll(window)}}),Fo),mutationBuffers.forEach(Ks=>Ks.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Yo.adoptStyleSheets(document.adoptedStyleSheets,mirror.getId(document))};try{const Fo=[],Js=Dt=>{var Eo;return callbackWrapper(initObservers)({mutationCb:Zr,mousemoveCb:(Jr,ar)=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:{source:ar,positions:Jr}})),mouseInteractionCb:Jr=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.MouseInteraction},Jr)})),scrollCb:rn,viewportResizeCb:Jr=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.ViewportResize},Jr)})),inputCb:Jr=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.Input},Jr)})),mediaInteractionCb:Jr=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.MediaInteraction},Jr)})),styleSheetRuleCb:Jr=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.StyleSheetRule},Jr)})),styleDeclarationCb:Jr=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.StyleDeclaration},Jr)})),canvasMutationCb:On,fontCb:Jr=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.Font},Jr)})),selectionCb:Jr=>{wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.Selection},Jr)}))},customElementCb:Jr=>{wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.CustomElement},Jr)}))},blockClass:$,ignoreClass:nt,ignoreSelector:at,maskTextClass:lt,maskTextSelector:et,maskInputOptions:en,inlineStylesheet:it,sampling:_t,recordDOM:Nt,recordCanvas:Lt,inlineImages:tn,userTriggeredOnInput:_r,collectFonts:wr,doc:Dt,maskInputFn:pt,maskTextFn:gt,keepIframeSrcFn:Yr,blockSelector:c,slimDOMOptions:Lr,dataURLOptions:$t,mirror,iframeManager:jo,stylesheetManager:Yo,shadowDomManager:Zo,processedNodeManager:Ko,canvasManager,ignoreCSSAttributes:Ot,plugins:((Eo=Wt?.filter(Jr=>Jr.observer))===null||Eo===void 0?void 0:Eo.map(Jr=>({observer:Jr.observer,options:Jr.options,callback:ar=>wrappedEmit(wrapEvent({type:EventType$1.Plugin,data:{plugin:Jr.name,payload:ar}}))})))||[]},wt)};jo.addLoadListener(Dt=>{try{Fo.push(Js(Dt.contentDocument))}catch(Eo){console.warn(Eo)}});const Ks=()=>{takeFullSnapshot(),Fo.push(Js(document)),recording=!0};return document.readyState==="interactive"||document.readyState==="complete"?Ks():(Fo.push(on("DOMContentLoaded",()=>{wrappedEmit(wrapEvent({type:EventType$1.DomContentLoaded,data:{}})),Jt==="DOMContentLoaded"&&Ks()})),Fo.push(on("load",()=>{wrappedEmit(wrapEvent({type:EventType$1.Load,data:{}})),Jt==="load"&&Ks()},window))),()=>{Fo.forEach(Dt=>Dt()),Ko.destroy(),recording=!1,unregisterErrorHandler()}}catch(Fo){console.warn(Fo)}}record.addCustomEvent=(e,o)=>{if(!recording)throw new Error("please add custom event after start recording");wrappedEmit(wrapEvent({type:EventType$1.Custom,data:{tag:e,payload:o}}))};record.freezePage=()=>{mutationBuffers.forEach(e=>e.freeze())};record.takeFullSnapshot=e=>{if(!recording)throw new Error("please take full snapshot after start recording");takeFullSnapshot(e)};record.mirror=mirror;var EventType=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(EventType||{}),IncrementalSource=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(IncrementalSource||{}),Config={DEBUG:!1,LIB_VERSION:"2.55.1"},win;if(typeof window>"u"){var loc={hostname:""};win={navigator:{userAgent:"",onLine:!0},document:{location:loc,referrer:""},screen:{width:0,height:0},location:loc}}else win=window;var MAX_RECORDING_MS=24*60*60*1e3,MAX_VALUE_FOR_MIN_RECORDING_MS=8*1e3,ArrayProto$1=Array.prototype,FuncProto=Function.prototype,ObjProto$1=Object.prototype,slice$1=ArrayProto$1.slice,toString$1=ObjProto$1.toString,hasOwnProperty$1=ObjProto$1.hasOwnProperty,windowConsole=win.console,navigator$1=win.navigator,document$1=win.document,windowOpera=win.opera,screen=win.screen,userAgent=navigator$1.userAgent,nativeBind=FuncProto.bind,nativeForEach=ArrayProto$1.forEach,nativeIndexOf=ArrayProto$1.indexOf,nativeMap=ArrayProto$1.map,nativeIsArray$1=Array.isArray,breaker={},_$3={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},console$1={log:function(){if(Config.DEBUG&&!_$3.isUndefined(windowConsole)&&windowConsole)try{windowConsole.log.apply(windowConsole,arguments)}catch{_$3.each(arguments,function(o){windowConsole.log(o)})}},warn:function(){if(Config.DEBUG&&!_$3.isUndefined(windowConsole)&&windowConsole){var e=["Mixpanel warning:"].concat(_$3.toArray(arguments));try{windowConsole.warn.apply(windowConsole,e)}catch{_$3.each(e,function(s){windowConsole.warn(s)})}}},error:function(){if(Config.DEBUG&&!_$3.isUndefined(windowConsole)&&windowConsole){var e=["Mixpanel error:"].concat(_$3.toArray(arguments));try{windowConsole.error.apply(windowConsole,e)}catch{_$3.each(e,function(s){windowConsole.error(s)})}}},critical:function(){if(!_$3.isUndefined(windowConsole)&&windowConsole){var e=["Mixpanel error:"].concat(_$3.toArray(arguments));try{windowConsole.error.apply(windowConsole,e)}catch{_$3.each(e,function(s){windowConsole.error(s)})}}}},log_func_with_prefix=function(e,o){return function(){return arguments[0]="["+o+"] "+arguments[0],e.apply(console$1,arguments)}},console_with_prefix=function(e){return{log:log_func_with_prefix(console$1.log,e),error:log_func_with_prefix(console$1.error,e),critical:log_func_with_prefix(console$1.critical,e)}};_$3.bind=function(e,o){var s,a;if(nativeBind&&e.bind===nativeBind)return nativeBind.apply(e,slice$1.call(arguments,1));if(!_$3.isFunction(e))throw new TypeError;return s=slice$1.call(arguments,2),a=function(){if(!(this instanceof a))return e.apply(o,s.concat(slice$1.call(arguments)));var $={};$.prototype=e.prototype;var c=new $;$.prototype=null;var nt=e.apply(c,s.concat(slice$1.call(arguments)));return Object(nt)===nt?nt:c},a};_$3.each=function(e,o,s){if(e!=null){if(nativeForEach&&e.forEach===nativeForEach)e.forEach(o,s);else if(e.length===+e.length){for(var a=0,$=e.length;a<$;a++)if(a in e&&o.call(s,e[a],a,e)===breaker)return}else for(var c in e)if(hasOwnProperty$1.call(e,c)&&o.call(s,e[c],c,e)===breaker)return}};_$3.extend=function(e){return _$3.each(slice$1.call(arguments,1),function(o){for(var s in o)o[s]!==void 0&&(e[s]=o[s])}),e};_$3.isArray=nativeIsArray$1||function(e){return toString$1.call(e)==="[object Array]"};_$3.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}};_$3.isArguments=function(e){return!!(e&&hasOwnProperty$1.call(e,"callee"))};_$3.toArray=function(e){return e?e.toArray?e.toArray():_$3.isArray(e)||_$3.isArguments(e)?slice$1.call(e):_$3.values(e):[]};_$3.map=function(e,o,s){if(nativeMap&&e.map===nativeMap)return e.map(o,s);var a=[];return _$3.each(e,function($){a.push(o.call(s,$))}),a};_$3.keys=function(e){var o=[];return e===null||_$3.each(e,function(s,a){o[o.length]=a}),o};_$3.values=function(e){var o=[];return e===null||_$3.each(e,function(s){o[o.length]=s}),o};_$3.include=function(e,o){var s=!1;return e===null?s:nativeIndexOf&&e.indexOf===nativeIndexOf?e.indexOf(o)!=-1:(_$3.each(e,function(a){if(s||(s=a===o))return breaker}),s)};_$3.includes=function(e,o){return e.indexOf(o)!==-1};_$3.inherit=function(e,o){return e.prototype=new o,e.prototype.constructor=e,e.superclass=o.prototype,e};_$3.isObject=function(e){return e===Object(e)&&!_$3.isArray(e)};_$3.isEmptyObject=function(e){if(_$3.isObject(e)){for(var o in e)if(hasOwnProperty$1.call(e,o))return!1;return!0}return!1};_$3.isUndefined=function(e){return e===void 0};_$3.isString=function(e){return toString$1.call(e)=="[object String]"};_$3.isDate=function(e){return toString$1.call(e)=="[object Date]"};_$3.isNumber=function(e){return toString$1.call(e)=="[object Number]"};_$3.isElement=function(e){return!!(e&&e.nodeType===1)};_$3.encodeDates=function(e){return _$3.each(e,function(o,s){_$3.isDate(o)?e[s]=_$3.formatDate(o):_$3.isObject(o)&&(e[s]=_$3.encodeDates(o))}),e};_$3.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()};_$3.formatDate=function(e){function o(s){return s<10?"0"+s:s}return e.getUTCFullYear()+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())};_$3.strip_empty_properties=function(e){var o={};return _$3.each(e,function(s,a){_$3.isString(s)&&s.length>0&&(o[a]=s)}),o};_$3.truncate=function(e,o){var s;return typeof e=="string"?s=e.slice(0,o):_$3.isArray(e)?(s=[],_$3.each(e,function(a){s.push(_$3.truncate(a,o))})):_$3.isObject(e)?(s={},_$3.each(e,function(a,$){s[$]=_$3.truncate(a,o)})):s=e,s};_$3.JSONEncode=function(){return function(e){var o=e,s=function($){var c=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,nt={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return c.lastIndex=0,c.test($)?'"'+$.replace(c,function(at){var lt=nt[at];return typeof lt=="string"?lt:"\\u"+("0000"+at.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+$+'"'},a=function($,c){var nt="",at=" ",lt=0,et="",it="",st=0,ct=nt,ft=[],pt=c[$];switch(pt&&typeof pt=="object"&&typeof pt.toJSON=="function"&&(pt=pt.toJSON($)),typeof pt){case"string":return s(pt);case"number":return isFinite(pt)?String(pt):"null";case"boolean":case"null":return String(pt);case"object":if(!pt)return"null";if(nt+=at,ft=[],toString$1.apply(pt)==="[object Array]"){for(st=pt.length,lt=0;lt<st;lt+=1)ft[lt]=a(lt,pt)||"null";return it=ft.length===0?"[]":nt?`[
`+nt+ft.join(`,
`+nt)+`
`+ct+"]":"["+ft.join(",")+"]",nt=ct,it}for(et in pt)hasOwnProperty$1.call(pt,et)&&(it=a(et,pt),it&&ft.push(s(et)+(nt?": ":":")+it));return it=ft.length===0?"{}":nt?"{"+ft.join(",")+ct+"}":"{"+ft.join(",")+"}",nt=ct,it}};return a("",{"":o})}}();_$3.JSONDecode=function(){var e,o,s={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:" "},a,$=function(ft){var pt=new SyntaxError(ft);throw pt.at=e,pt.text=a,pt},c=function(ft){return ft&&ft!==o&&$("Expected '"+ft+"' instead of '"+o+"'"),o=a.charAt(e),e+=1,o},nt=function(){var ft,pt="";for(o==="-"&&(pt="-",c("-"));o>="0"&&o<="9";)pt+=o,c();if(o===".")for(pt+=".";c()&&o>="0"&&o<="9";)pt+=o;if(o==="e"||o==="E")for(pt+=o,c(),(o==="-"||o==="+")&&(pt+=o,c());o>="0"&&o<="9";)pt+=o,c();if(ft=+pt,!isFinite(ft))$("Bad number");else return ft},at=function(){var ft,pt,gt="",wt;if(o==='"')for(;c();){if(o==='"')return c(),gt;if(o==="\\")if(c(),o==="u"){for(wt=0,pt=0;pt<4&&(ft=parseInt(c(),16),!!isFinite(ft));pt+=1)wt=wt*16+ft;gt+=String.fromCharCode(wt)}else if(typeof s[o]=="string")gt+=s[o];else break;else gt+=o}$("Bad string")},lt=function(){for(;o&&o<=" ";)c()},et=function(){switch(o){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null}$('Unexpected "'+o+'"')},it,st=function(){var ft=[];if(o==="["){if(c("["),lt(),o==="]")return c("]"),ft;for(;o;){if(ft.push(it()),lt(),o==="]")return c("]"),ft;c(","),lt()}}$("Bad array")},ct=function(){var ft,pt={};if(o==="{"){if(c("{"),lt(),o==="}")return c("}"),pt;for(;o;){if(ft=at(),lt(),c(":"),Object.hasOwnProperty.call(pt,ft)&&$('Duplicate key "'+ft+'"'),pt[ft]=it(),lt(),o==="}")return c("}"),pt;c(","),lt()}}$("Bad object")};return it=function(){switch(lt(),o){case"{":return ct();case"[":return st();case'"':return at();case"-":return nt();default:return o>="0"&&o<="9"?nt():et()}},function(ft){var pt;return a=ft,e=0,o=" ",pt=it(),lt(),o&&$("Syntax error"),pt}}();_$3.base64Encode=function(e){var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s,a,$,c,nt,at,lt,et,it=0,st=0,ct="",ft=[];if(!e)return e;e=_$3.utf8Encode(e);do s=e.charCodeAt(it++),a=e.charCodeAt(it++),$=e.charCodeAt(it++),et=s<<16|a<<8|$,c=et>>18&63,nt=et>>12&63,at=et>>6&63,lt=et&63,ft[st++]=o.charAt(c)+o.charAt(nt)+o.charAt(at)+o.charAt(lt);while(it<e.length);switch(ct=ft.join(""),e.length%3){case 1:ct=ct.slice(0,-2)+"==";break;case 2:ct=ct.slice(0,-1)+"=";break}return ct};_$3.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`);var o="",s,a,$=0,c;for(s=a=0,$=e.length,c=0;c<$;c++){var nt=e.charCodeAt(c),at=null;nt<128?a++:nt>127&&nt<2048?at=String.fromCharCode(nt>>6|192,nt&63|128):at=String.fromCharCode(nt>>12|224,nt>>6&63|128,nt&63|128),at!==null&&(a>s&&(o+=e.substring(s,a)),o+=at,s=a=c+1)}return a>s&&(o+=e.substring(s,e.length)),o};_$3.UUID=function(){var e=function(){var a=1*new Date,$;if(win.performance&&win.performance.now)$=win.performance.now();else for($=0;a==1*new Date;)$++;return a.toString(16)+Math.floor($).toString(16)},o=function(){return Math.random().toString(16).replace(".","")},s=function(){var a=userAgent,$,c,nt=[],at=0;function lt(et,it){var st,ct=0;for(st=0;st<it.length;st++)ct|=nt[st]<<st*8;return et^ct}for($=0;$<a.length;$++)c=a.charCodeAt($),nt.unshift(c&255),nt.length>=4&&(at=lt(at,nt),nt=[]);return nt.length>0&&(at=lt(at,nt)),at.toString(16)};return function(){var a=(screen.height*screen.width).toString(16);return e()+"-"+o()+"-"+s()+"-"+a+"-"+e()}}();var BLOCKED_UA_STRS=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];_$3.isBlockedUA=function(e){var o;for(e=e.toLowerCase(),o=0;o<BLOCKED_UA_STRS.length;o++)if(e.indexOf(BLOCKED_UA_STRS[o])!==-1)return!0;return!1};_$3.HTTPBuildQuery=function(e,o){var s,a,$=[];return _$3.isUndefined(o)&&(o="&"),_$3.each(e,function(c,nt){s=encodeURIComponent(c.toString()),a=encodeURIComponent(nt),$[$.length]=a+"="+s}),$.join(o)};_$3.getQueryParam=function(e,o){o=o.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var s="[\\?&]"+o+"=([^&#]*)",a=new RegExp(s),$=a.exec(e);if($===null||$&&typeof $[1]!="string"&&$[1].length)return"";var c=$[1];try{c=decodeURIComponent(c)}catch{console$1.error("Skipping decoding for malformed query param: "+c)}return c.replace(/\+/g," ")};_$3.cookie={get:function(e){for(var o=e+"=",s=document$1.cookie.split(";"),a=0;a<s.length;a++){for(var $=s[a];$.charAt(0)==" ";)$=$.substring(1,$.length);if($.indexOf(o)===0)return decodeURIComponent($.substring(o.length,$.length))}return null},parse:function(e){var o;try{o=_$3.JSONDecode(_$3.cookie.get(e))||{}}catch{}return o},set_seconds:function(e,o,s,a,$,c,nt){var at="",lt="",et="";if(nt)at="; domain="+nt;else if(a){var it=extract_domain(document$1.location.hostname);at=it?"; domain=."+it:""}if(s){var st=new Date;st.setTime(st.getTime()+s*1e3),lt="; expires="+st.toGMTString()}c&&($=!0,et="; SameSite=None"),$&&(et+="; secure"),document$1.cookie=e+"="+encodeURIComponent(o)+lt+"; path=/"+at+et},set:function(e,o,s,a,$,c,nt){var at="",lt="",et="";if(nt)at="; domain="+nt;else if(a){var it=extract_domain(document$1.location.hostname);at=it?"; domain=."+it:""}if(s){var st=new Date;st.setTime(st.getTime()+s*24*60*60*1e3),lt="; expires="+st.toGMTString()}c&&($=!0,et="; SameSite=None"),$&&(et+="; secure");var ct=e+"="+encodeURIComponent(o)+lt+"; path=/"+at+et;return document$1.cookie=ct,ct},remove:function(e,o,s){_$3.cookie.set(e,"",-1,o,!1,!1,s)}};var _localStorageSupported=null,localStorageSupported=function(e,o){if(_localStorageSupported!==null&&!o)return _localStorageSupported;var s=!0;try{e=e||window.localStorage;var a="__mplss_"+cheap_guid(8),$="xyz";e.setItem(a,$),e.getItem(a)!==$&&(s=!1),e.removeItem(a)}catch{s=!1}return _localStorageSupported=s,s};_$3.localStorage={is_supported:function(e){var o=localStorageSupported(null,e);return o||console$1.error("localStorage unsupported; falling back to cookie store"),o},error:function(e){console$1.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(o){_$3.localStorage.error(o)}return null},parse:function(e){try{return _$3.JSONDecode(_$3.localStorage.get(e))||{}}catch{}return null},set:function(e,o){try{window.localStorage.setItem(e,o)}catch(s){_$3.localStorage.error(s)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(o){_$3.localStorage.error(o)}}};_$3.register_event=function(){var e=function(a,$,c,nt,at){if(!a){console$1.error("No valid element provided to register_event");return}if(a.addEventListener&&!nt)a.addEventListener($,c,!!at);else{var lt="on"+$,et=a[lt];a[lt]=o(a,c,et)}};function o(a,$,c){var nt=function(at){if(at=at||s(window.event),!!at){var lt=!0,et,it;return _$3.isFunction(c)&&(et=c(at)),it=$.call(a,at),(et===!1||it===!1)&&(lt=!1),lt}};return nt}function s(a){return a&&(a.preventDefault=s.preventDefault,a.stopPropagation=s.stopPropagation),a}return s.preventDefault=function(){this.returnValue=!1},s.stopPropagation=function(){this.cancelBubble=!0},e}();var TOKEN_MATCH_REGEX=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');_$3.dom_query=function(){function e($){return $.all?$.all:$.getElementsByTagName("*")}var o=/[\t\r\n]/g;function s($,c){var nt=" "+c+" ";return(" "+$.className+" ").replace(o," ").indexOf(nt)>=0}function a($){if(!document$1.getElementsByTagName)return[];var c=$.split(" "),nt,at,lt,et,it,st,ct,ft,pt,gt,wt=[document$1];for(st=0;st<c.length;st++){if(nt=c[st].replace(/^\s+/,"").replace(/\s+$/,""),nt.indexOf("#")>-1){at=nt.split("#"),lt=at[0];var vt=at[1],_t=document$1.getElementById(vt);if(!_t||lt&&_t.nodeName.toLowerCase()!=lt)return[];wt=[_t];continue}if(nt.indexOf(".")>-1){at=nt.split("."),lt=at[0];var $t=at[1];for(lt||(lt="*"),et=[],it=0,ct=0;ct<wt.length;ct++)for(lt=="*"?pt=e(wt[ct]):pt=wt[ct].getElementsByTagName(lt),ft=0;ft<pt.length;ft++)et[it++]=pt[ft];for(wt=[],gt=0,ct=0;ct<et.length;ct++)et[ct].className&&_$3.isString(et[ct].className)&&s(et[ct],$t)&&(wt[gt++]=et[ct]);continue}var Pt=nt.match(TOKEN_MATCH_REGEX);if(Pt){lt=Pt[1];var Nt=Pt[2],Lt=Pt[3],Ft=Pt[4];for(lt||(lt="*"),et=[],it=0,ct=0;ct<wt.length;ct++)for(lt=="*"?pt=e(wt[ct]):pt=wt[ct].getElementsByTagName(lt),ft=0;ft<pt.length;ft++)et[it++]=pt[ft];wt=[],gt=0;var Jt;switch(Lt){case"=":Jt=function(_r){return _r.getAttribute(Nt)==Ft};break;case"~":Jt=function(_r){return _r.getAttribute(Nt).match(new RegExp("\\b"+Ft+"\\b"))};break;case"|":Jt=function(_r){return _r.getAttribute(Nt).match(new RegExp("^"+Ft+"-?"))};break;case"^":Jt=function(_r){return _r.getAttribute(Nt).indexOf(Ft)===0};break;case"$":Jt=function(_r){return _r.getAttribute(Nt).lastIndexOf(Ft)==_r.getAttribute(Nt).length-Ft.length};break;case"*":Jt=function(_r){return _r.getAttribute(Nt).indexOf(Ft)>-1};break;default:Jt=function(_r){return _r.getAttribute(Nt)}}for(wt=[],gt=0,ct=0;ct<et.length;ct++)Jt(et[ct])&&(wt[gt++]=et[ct]);continue}for(lt=nt,et=[],it=0,ct=0;ct<wt.length;ct++)for(pt=wt[ct].getElementsByTagName(lt),ft=0;ft<pt.length;ft++)et[it++]=pt[ft];wt=et}return wt}return function($){return _$3.isElement($)?[$]:_$3.isObject($)&&!_$3.isUndefined($.length)?$:a.call(this,$)}}();var CAMPAIGN_KEYWORDS=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],CLICK_IDS=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];_$3.info={campaignParams:function(e){var o="",s={};return _$3.each(CAMPAIGN_KEYWORDS,function(a){o=_$3.getQueryParam(document$1.URL,a),o.length?s[a]=o:e!==void 0&&(s[a]=e)}),s},clickParams:function(){var e="",o={};return _$3.each(CLICK_IDS,function(s){e=_$3.getQueryParam(document$1.URL,s),e.length&&(o[s]=e)}),o},marketingParams:function(){return _$3.extend(_$3.info.campaignParams(),_$3.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var o=_$3.info.searchEngine(e),s=o!="yahoo"?"q":"p",a={};if(o!==null){a.$search_engine=o;var $=_$3.getQueryParam(e,s);$.length&&(a.mp_keyword=$)}return a},browser:function(e,o,s){return o=o||"",s||_$3.includes(e," OPR/")?_$3.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":_$3.includes(e,"IEMobile")||_$3.includes(e,"WPDesktop")?"Internet Explorer Mobile":_$3.includes(e,"SamsungBrowser/")?"Samsung Internet":_$3.includes(e,"Edge")||_$3.includes(e,"Edg/")?"Microsoft Edge":_$3.includes(e,"FBIOS")?"Facebook Mobile":_$3.includes(e,"Chrome")?"Chrome":_$3.includes(e,"CriOS")?"Chrome iOS":_$3.includes(e,"UCWEB")||_$3.includes(e,"UCBrowser")?"UC Browser":_$3.includes(e,"FxiOS")?"Firefox iOS":_$3.includes(o,"Apple")?_$3.includes(e,"Mobile")?"Mobile Safari":"Safari":_$3.includes(e,"Android")?"Android Mobile":_$3.includes(e,"Konqueror")?"Konqueror":_$3.includes(e,"Firefox")?"Firefox":_$3.includes(e,"MSIE")||_$3.includes(e,"Trident/")?"Internet Explorer":_$3.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,o,s){var a=_$3.info.browser(e,o,s),$={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},c=$[a];if(c===void 0)return null;var nt=e.match(c);return nt?parseFloat(nt[nt.length-2]):null},os:function(){var e=userAgent;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var o=e.split("/");return o.length>=3?o[2]:""},currentUrl:function(){return win.location.href},properties:function(e){return typeof e!="object"&&(e={}),_$3.extend(_$3.strip_empty_properties({$os:_$3.info.os(),$browser:_$3.info.browser(userAgent,navigator$1.vendor,windowOpera),$referrer:document$1.referrer,$referring_domain:_$3.info.referringDomain(document$1.referrer),$device:_$3.info.device(userAgent)}),{$current_url:_$3.info.currentUrl(),$browser_version:_$3.info.browserVersion(userAgent,navigator$1.vendor,windowOpera),$screen_height:screen.height,$screen_width:screen.width,mp_lib:"web",$lib_version:Config.LIB_VERSION,$insert_id:cheap_guid(),time:_$3.timestamp()/1e3},_$3.strip_empty_properties(e))},people_properties:function(){return _$3.extend(_$3.strip_empty_properties({$os:_$3.info.os(),$browser:_$3.info.browser(userAgent,navigator$1.vendor,windowOpera)}),{$browser_version:_$3.info.browserVersion(userAgent,navigator$1.vendor,windowOpera)})},mpPageViewProperties:function(){return _$3.strip_empty_properties({current_page_title:document$1.title,current_domain:win.location.hostname,current_url_path:win.location.pathname,current_url_protocol:win.location.protocol,current_url_search:win.location.search})}};var cheap_guid=function(e){var o=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?o.substring(0,e):o},SIMPLE_DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(e){var o=DOMAIN_MATCH_REGEX,s=e.split("."),a=s[s.length-1];(a.length>4||a==="com"||a==="org")&&(o=SIMPLE_DOMAIN_MATCH_REGEX);var $=e.match(o);return $?$[0]:""},isOnline=function(){var e=win.navigator.onLine;return _$3.isUndefined(e)||e},JSONStringify=null,JSONParse=null;typeof JSON<"u"&&(JSONStringify=JSON.stringify,JSONParse=JSON.parse);JSONStringify=JSONStringify||_$3.JSONEncode;JSONParse=JSONParse||_$3.JSONDecode;_$3.toArray=_$3.toArray;_$3.isObject=_$3.isObject;_$3.JSONEncode=_$3.JSONEncode;_$3.JSONDecode=_$3.JSONDecode;_$3.isBlockedUA=_$3.isBlockedUA;_$3.isEmptyObject=_$3.isEmptyObject;_$3.info=_$3.info;_$3.info.device=_$3.info.device;_$3.info.browser=_$3.info.browser;_$3.info.browserVersion=_$3.info.browserVersion;_$3.info.properties=_$3.info.properties;var GDPR_DEFAULT_PERSISTENCE_PREFIX="__mp_opt_in_out_";function optIn(e,o){_optInOut(!0,e,o)}function optOut(e,o){_optInOut(!1,e,o)}function hasOptedIn(e,o){return _getStorageValue(e,o)==="1"}function hasOptedOut(e,o){if(_hasDoNotTrackFlagOn(o))return console$1.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var s=_getStorageValue(e,o)==="0";return s&&console$1.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),s}function addOptOutCheckMixpanelLib(e){return _addOptOutCheck(e,function(o){return this.get_config(o)})}function addOptOutCheckMixpanelPeople(e){return _addOptOutCheck(e,function(o){return this._get_config(o)})}function addOptOutCheckMixpanelGroup(e){return _addOptOutCheck(e,function(o){return this._get_config(o)})}function clearOptInOut(e,o){o=o||{},_getStorage(o).remove(_getStorageKey(e,o),!!o.crossSubdomainCookie,o.cookieDomain)}function _getStorage(e){return e=e||{},e.persistenceType==="localStorage"?_$3.localStorage:_$3.cookie}function _getStorageKey(e,o){return o=o||{},(o.persistencePrefix||GDPR_DEFAULT_PERSISTENCE_PREFIX)+e}function _getStorageValue(e,o){return _getStorage(o).get(_getStorageKey(e,o))}function _hasDoNotTrackFlagOn(e){if(e&&e.ignoreDnt)return!1;var o=e&&e.window||win,s=o.navigator||{},a=!1;return _$3.each([s.doNotTrack,s.msDoNotTrack,o.doNotTrack],function($){_$3.includes([!0,1,"1","yes"],$)&&(a=!0)}),a}function _optInOut(e,o,s){if(!_$3.isString(o)||!o.length){console$1.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}s=s||{},_getStorage(s).set(_getStorageKey(o,s),e?1:0,_$3.isNumber(s.cookieExpiration)?s.cookieExpiration:null,!!s.crossSubdomainCookie,!!s.secureCookie,!!s.crossSiteCookie,s.cookieDomain),s.track&&e&&s.track(s.trackEventName||"$opt_in",s.trackProperties,{send_immediately:!0})}function _addOptOutCheck(e,o){return function(){var s=!1;try{var a=o.call(this,"token"),$=o.call(this,"ignore_dnt"),c=o.call(this,"opt_out_tracking_persistence_type"),nt=o.call(this,"opt_out_tracking_cookie_prefix"),at=o.call(this,"window");a&&(s=hasOptedOut(a,{ignoreDnt:$,persistenceType:c,persistencePrefix:nt,window:at}))}catch(et){console$1.error("Unexpected error when checking tracking opt-out status: "+et)}if(!s)return e.apply(this,arguments);var lt=arguments[arguments.length-1];typeof lt=="function"&&lt(0)}}var logger$3=console_with_prefix("lock"),SharedLock=function(e,o){o=o||{},this.storageKey=e,this.storage=o.storage||window.localStorage,this.pollIntervalMS=o.pollIntervalMS||100,this.timeoutMS=o.timeoutMS||2e3};SharedLock.prototype.withLock=function(e,o,s){!s&&typeof o!="function"&&(s=o,o=null);var a=s||new Date().getTime()+"|"+Math.random(),$=new Date().getTime(),c=this.storageKey,nt=this.pollIntervalMS,at=this.timeoutMS,lt=this.storage,et=c+":X",it=c+":Y",st=c+":Z",ct=function(_t){o&&o(_t)},ft=function(_t){if(new Date().getTime()-$>at){logger$3.error("Timeout waiting for mutex on "+c+"; clearing lock. ["+a+"]"),lt.removeItem(st),lt.removeItem(it),wt();return}setTimeout(function(){try{_t()}catch($t){ct($t)}},nt*(Math.random()+.1))},pt=function(_t,$t){_t()?$t():ft(function(){pt(_t,$t)})},gt=function(){var _t=lt.getItem(it);if(_t&&_t!==a)return!1;if(lt.setItem(it,a),lt.getItem(it)===a)return!0;if(!localStorageSupported(lt,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},wt=function(){lt.setItem(et,a),pt(gt,function(){if(lt.getItem(et)===a){vt();return}ft(function(){if(lt.getItem(it)!==a){wt();return}pt(function(){return!lt.getItem(st)},vt)})})},vt=function(){lt.setItem(st,"1");try{e()}finally{lt.removeItem(st),lt.getItem(it)===a&&lt.removeItem(it),lt.getItem(et)===a&&lt.removeItem(et)}};try{if(localStorageSupported(lt,!0))wt();else throw new Error("localStorage support check failed")}catch(_t){ct(_t)}};var logger$2=console_with_prefix("batch"),RequestQueue=function(e,o){o=o||{},this.storageKey=e,this.storage=o.storage||window.localStorage,this.reportError=o.errorReporter||_$3.bind(logger$2.error,logger$2),this.lock=new SharedLock(e,{storage:this.storage}),this.usePersistence=o.usePersistence,this.pid=o.pid||null,this.memQueue=[]};RequestQueue.prototype.enqueue=function(e,o,s){var a={id:cheap_guid(),flushAfter:new Date().getTime()+o*2,payload:e};this.usePersistence?this.lock.withLock(_$3.bind(function(){var c;try{var nt=this.readFromStorage();nt.push(a),c=this.saveToStorage(nt),c&&this.memQueue.push(a)}catch{this.reportError("Error enqueueing item",e),c=!1}s&&s(c)},this),_$3.bind(function(c){this.reportError("Error acquiring storage lock",c),s&&s(!1)},this),this.pid):(this.memQueue.push(a),s&&s(!0))};RequestQueue.prototype.fillBatch=function(e){var o=this.memQueue.slice(0,e);if(this.usePersistence&&o.length<e){var s=this.readFromStorage();if(s.length){var a={};_$3.each(o,function(nt){a[nt.id]=!0});for(var $=0;$<s.length;$++){var c=s[$];if(new Date().getTime()>c.flushAfter&&!a[c.id]&&(c.orphaned=!0,o.push(c),o.length>=e))break}}}return o};var filterOutIDsAndInvalid=function(e,o){var s=[];return _$3.each(e,function(a){a.id&&!o[a.id]&&s.push(a)}),s};RequestQueue.prototype.removeItemsByID=function(e,o){var s={};if(_$3.each(e,function($){s[$]=!0}),this.memQueue=filterOutIDsAndInvalid(this.memQueue,s),!this.usePersistence)o&&o(!0);else{var a=_$3.bind(function(){var $;try{var c=this.readFromStorage();if(c=filterOutIDsAndInvalid(c,s),$=this.saveToStorage(c),$){c=this.readFromStorage();for(var nt=0;nt<c.length;nt++){var at=c[nt];if(at.id&&s[at.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",e),$=!1}return $},this);this.lock.withLock(function(){var c=a();o&&o(c)},_$3.bind(function(c){var nt=!1;if(this.reportError("Error acquiring storage lock",c),!localStorageSupported(this.storage,!0)&&(nt=a(),!nt))try{this.storage.removeItem(this.storageKey)}catch(at){this.reportError("Error clearing queue",at)}o&&o(nt)},this),this.pid)}};var updatePayloads=function(e,o){var s=[];return _$3.each(e,function(a){var $=a.id;if($ in o){var c=o[$];c!==null&&(a.payload=c,s.push(a))}else s.push(a)}),s};RequestQueue.prototype.updatePayloads=function(e,o){this.memQueue=updatePayloads(this.memQueue,e),this.usePersistence?this.lock.withLock(_$3.bind(function(){var a;try{var $=this.readFromStorage();$=updatePayloads($,e),a=this.saveToStorage($)}catch{this.reportError("Error updating items",e),a=!1}o&&o(a)},this),_$3.bind(function(a){this.reportError("Error acquiring storage lock",a),o&&o(!1)},this),this.pid):o&&o(!0)};RequestQueue.prototype.readFromStorage=function(){var e;try{e=this.storage.getItem(this.storageKey),e&&(e=JSONParse(e),_$3.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(o){this.reportError("Error retrieving queue",o),e=null}return e||[]};RequestQueue.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,JSONStringify(e)),!0}catch(o){return this.reportError("Error saving queue",o),!1}};RequestQueue.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var MAX_RETRY_INTERVAL_MS=10*60*1e3,logger$1=console_with_prefix("batch"),RequestBatcher=function(e,o){this.errorReporter=o.errorReporter,this.queue=new RequestQueue(e,{errorReporter:_$3.bind(this.reportError,this),storage:o.storage,usePersistence:o.usePersistence}),this.libConfig=o.libConfig,this.sendRequest=o.sendRequestFunc,this.beforeSendHook=o.beforeSendHook,this.stopAllBatching=o.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=o.flushOnlyOnInterval||!1};RequestBatcher.prototype.enqueue=function(e,o){this.queue.enqueue(e,this.flushInterval,o)};RequestBatcher.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()};RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)};RequestBatcher.prototype.clear=function(){this.queue.clear()};RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size};RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)};RequestBatcher.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(_$3.bind(function(){this.stopped||this.flush()},this),this.flushInterval))};RequestBatcher.prototype.flush=function(e){try{if(this.requestInProgress){logger$1.log("Flush: Request already in progress");return}e=e||{};var o=this.libConfig.batch_request_timeout_ms,s=new Date().getTime(),a=this.batchSize,$=this.queue.fillBatch(a),c=$.length===a,nt=[],at={};if(_$3.each($,function(it){var st=it.payload;if(this.beforeSendHook&&!it.orphaned&&(st=this.beforeSendHook(st)),st){st.event&&st.properties&&(st.properties=_$3.extend({},st.properties,{mp_sent_by_lib_version:Config.LIB_VERSION}));var ct=!0,ft=it.id;ft?(this.itemIdsSentSuccessfully[ft]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:it,batchSize:$.length,timesSent:this.itemIdsSentSuccessfully[ft]}),ct=!1):this.reportError("[dupe] found item with no ID",{item:it}),ct&&nt.push(st)}at[it.id]=st},this),nt.length<1){this.resetFlush();return}this.requestInProgress=!0;var lt=_$3.bind(function(it){this.requestInProgress=!1;try{var st=!1;if(e.unloading)this.queue.updatePayloads(at);else if(_$3.isObject(it)&&it.error==="timeout"&&new Date().getTime()-s>=o)this.reportError("Network timeout; retrying"),this.flush();else if(_$3.isObject(it)&&(it.httpStatusCode>=500||it.httpStatusCode===429||it.httpStatusCode<=0&&!isOnline()||it.error==="timeout")){var ct=this.flushInterval*2;it.retryAfter&&(ct=parseInt(it.retryAfter,10)*1e3||ct),ct=Math.min(MAX_RETRY_INTERVAL_MS,ct),this.reportError("Error; retry in "+ct+" ms"),this.scheduleFlush(ct)}else if(_$3.isObject(it)&&it.httpStatusCode===413)if($.length>1){var ft=Math.max(1,Math.floor(a/2));this.batchSize=Math.min(this.batchSize,ft,$.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",$),this.resetBatchSize(),st=!0;else st=!0;st&&(this.queue.removeItemsByID(_$3.map($,function(pt){return pt.id}),_$3.bind(function(pt){pt?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!c?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),_$3.each($,_$3.bind(function(pt){var gt=pt.id;gt?(this.itemIdsSentSuccessfully[gt]=this.itemIdsSentSuccessfully[gt]||0,this.itemIdsSentSuccessfully[gt]++,this.itemIdsSentSuccessfully[gt]>5&&this.reportError("[dupe] item ID sent too many times",{item:pt,batchSize:$.length,timesSent:this.itemIdsSentSuccessfully[gt]})):this.reportError("[dupe] found item with no ID while removing",{item:pt})},this)))}catch(pt){this.reportError("Error handling API response",pt),this.resetFlush()}},this),et={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:o};e.unloading&&(et.transport="sendBeacon"),logger$1.log("MIXPANEL REQUEST:",nt),this.sendRequest(nt,et,lt)}catch(it){this.reportError("Error flushing request queue",it),this.resetFlush()}};RequestBatcher.prototype.reportError=function(e,o){if(logger$1.error.apply(logger$1.error,arguments),this.errorReporter)try{o instanceof Error||(o=new Error(e)),this.errorReporter(e,o)}catch(s){logger$1.error(s)}};var logger=console_with_prefix("recorder"),CompressionStream=win.CompressionStream,RECORDER_BATCHER_LIB_CONFIG={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},ACTIVE_SOURCES=new Set([IncrementalSource.MouseMove,IncrementalSource.MouseInteraction,IncrementalSource.Scroll,IncrementalSource.ViewportResize,IncrementalSource.Input,IncrementalSource.TouchMove,IncrementalSource.MediaInteraction,IncrementalSource.Drag,IncrementalSource.Selection]);function isUserEvent(e){return e.type===EventType.IncrementalSnapshot&&ACTIVE_SOURCES.has(e.data.source)}var MixpanelRecorder=function(e){this._mixpanel=e,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=MAX_RECORDING_MS,this.recordMinMs=0,this._initBatcher()};MixpanelRecorder.prototype._initBatcher=function(){this.batcher=new RequestBatcher("__mprec",{libConfig:RECORDER_BATCHER_LIB_CONFIG,sendRequestFunc:_$3.bind(this.flushEventsWithOptOut,this),errorReporter:_$3.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})};MixpanelRecorder.prototype.get_config=function(e){return this._mixpanel.get_config(e)};MixpanelRecorder.prototype.startRecording=function(e){if(this._stopRecording!==null){logger.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>MAX_RECORDING_MS&&(this.recordMaxMs=MAX_RECORDING_MS,logger.critical("record_max_ms cannot be greater than "+MAX_RECORDING_MS+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>MAX_VALUE_FOR_MIN_RECORDING_MS&&(this.recordMinMs=MAX_VALUE_FOR_MIN_RECORDING_MS,logger.critical("record_min_ms cannot be greater than "+MAX_VALUE_FOR_MIN_RECORDING_MS+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=new Date().getTime(),this.replayId=_$3.UUID(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var o=_$3.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(_$3.bind(function(){logger.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this),s=this.get_config("record_block_selector");(s===""||s===null)&&(s=void 0),this._stopRecording=record({emit:_$3.bind(function(a){this.batcher.enqueue(a),isUserEvent(a)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),o())},this),blockClass:this.get_config("record_block_class"),blockSelector:s,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),o(),this.maxTimeoutId=setTimeout(_$3.bind(this.resetRecording,this),this.recordMaxMs)};MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)};MixpanelRecorder.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)};MixpanelRecorder.prototype.flushEventsWithOptOut=function(e,o,s){this._flushEvents(e,o,s,_$3.bind(this._onOptOut,this))};MixpanelRecorder.prototype._onOptOut=function(e){e===0&&(this.recEvents=[],this.stopRecording())};MixpanelRecorder.prototype._sendRequest=function(e,o,s,a){var $=_$3.bind(function(c,nt){c.status===200&&this.replayId===e&&this.seqNo++,a({status:0,httpStatusCode:c.status,responseBody:nt,retryAfter:c.headers.get("Retry-After")})},this);win.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(o),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:s}).then(function(c){c.json().then(function(nt){$(c,nt)}).catch(function(nt){a({error:nt})})}).catch(function(c){a({error:c,httpStatusCode:0})})};MixpanelRecorder.prototype._flushEvents=addOptOutCheckMixpanelLib(function(e,o,s){const a=e.length;if(a>0){var $=this.replayId,c=e[0].timestamp;(this.seqNo===0||!this.replayStartTime)&&(this.seqNo!==0&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=c);var nt=e[a-1].timestamp-this.replayStartTime,at={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:c/1e3,replay_id:$,replay_length_ms:nt,replay_start_time:this.replayStartTime/1e3},lt=_$3.JSONEncode(e),et=this._mixpanel.get_property("$device_id");et&&(at.$device_id=et);var it=this._mixpanel.get_property("$user_id");if(it&&(at.$user_id=it),CompressionStream){var st=new Blob([lt],{type:"application/json"}).stream(),ct=st.pipeThrough(new CompressionStream("gzip"));new Response(ct).blob().then(_$3.bind(function(ft){at.format="gzip",this._sendRequest($,at,ft,s)},this))}else at.format="body",this._sendRequest($,at,lt,s)}});MixpanelRecorder.prototype.reportError=function(e,o){logger.error.apply(logger.error,arguments);try{!o&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,o)}catch(s){logger.error(s)}};win.__mp_recorder=MixpanelRecorder;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){};DomTracker.prototype.event_handler=function(){};DomTracker.prototype.after_track_handler=function(){};DomTracker.prototype.init=function(e){return this.mp=e,this};DomTracker.prototype.track=function(e,o,s,a){var $=this,c=_$3.dom_query(e);if(c.length===0){console$1.error("The DOM query ("+e+") returned 0 elements");return}return _$3.each(c,function(nt){_$3.register_event(nt,this.override_event,function(at){var lt={},et=$.create_properties(s,this),it=$.mp.get_config("track_links_timeout");$.event_handler(at,this,lt),window.setTimeout($.track_callback(a,et,lt,!0),it),$.mp.track(o,et,$.track_callback(a,et,lt))})},this),!0};DomTracker.prototype.track_callback=function(e,o,s,a){a=a||!1;var $=this;return function(){s.callback_fired||(s.callback_fired=!0,!(e&&e(a,o)===!1)&&$.after_track_handler(o,s,a))}};DomTracker.prototype.create_properties=function(e,o){var s;return typeof e=="function"?s=e(o):s=_$3.extend({},e),s};var LinkTracker=function(){this.override_event="click"};_$3.inherit(LinkTracker,DomTracker);LinkTracker.prototype.create_properties=function(e,o){var s=LinkTracker.superclass.create_properties.apply(this,arguments);return o.href&&(s.url=o.href),s};LinkTracker.prototype.event_handler=function(e,o,s){s.new_tab=e.which===2||e.metaKey||e.ctrlKey||o.target==="_blank",s.href=o.href,s.new_tab||e.preventDefault()};LinkTracker.prototype.after_track_handler=function(e,o){o.new_tab||setTimeout(function(){window.location=o.href},0)};var FormTracker=function(){this.override_event="submit"};_$3.inherit(FormTracker,DomTracker);FormTracker.prototype.event_handler=function(e,o,s){s.element=o,e.preventDefault()};FormTracker.prototype.after_track_handler=function(e,o){setTimeout(function(){o.element.submit()},0)};var SET_ACTION="$set",SET_ONCE_ACTION="$set_once",UNSET_ACTION="$unset",ADD_ACTION="$add",APPEND_ACTION="$append",UNION_ACTION="$union",REMOVE_ACTION="$remove",DELETE_ACTION="$delete",apiActions={set_action:function(e,o){var s={},a={};return _$3.isObject(e)?_$3.each(e,function($,c){this._is_reserved_property(c)||(a[c]=$)},this):a[e]=o,s[SET_ACTION]=a,s},unset_action:function(e){var o={},s=[];return _$3.isArray(e)||(e=[e]),_$3.each(e,function(a){this._is_reserved_property(a)||s.push(a)},this),o[UNSET_ACTION]=s,o},set_once_action:function(e,o){var s={},a={};return _$3.isObject(e)?_$3.each(e,function($,c){this._is_reserved_property(c)||(a[c]=$)},this):a[e]=o,s[SET_ONCE_ACTION]=a,s},union_action:function(e,o){var s={},a={};return _$3.isObject(e)?_$3.each(e,function($,c){this._is_reserved_property(c)||(a[c]=_$3.isArray($)?$:[$])},this):a[e]=_$3.isArray(o)?o:[o],s[UNION_ACTION]=a,s},append_action:function(e,o){var s={},a={};return _$3.isObject(e)?_$3.each(e,function($,c){this._is_reserved_property(c)||(a[c]=$)},this):a[e]=o,s[APPEND_ACTION]=a,s},remove_action:function(e,o){var s={},a={};return _$3.isObject(e)?_$3.each(e,function($,c){this._is_reserved_property(c)||(a[c]=$)},this):a[e]=o,s[REMOVE_ACTION]=a,s},delete_action:function(){var e={};return e[DELETE_ACTION]="",e}},MixpanelGroup=function(){};_$3.extend(MixpanelGroup.prototype,apiActions);MixpanelGroup.prototype._init=function(e,o,s){this._mixpanel=e,this._group_key=o,this._group_id=s};MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup(function(e,o,s){var a=this.set_action(e,o);return _$3.isObject(e)&&(s=o),this._send_request(a,s)});MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup(function(e,o,s){var a=this.set_once_action(e,o);return _$3.isObject(e)&&(s=o),this._send_request(a,s)});MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup(function(e,o){var s=this.unset_action(e);return this._send_request(s,o)});MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup(function(e,o,s){_$3.isObject(e)&&(s=o);var a=this.union_action(e,o);return this._send_request(a,s)});MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup(function(e){var o=this.delete_action();return this._send_request(o,e)});MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup(function(e,o,s){var a=this.remove_action(e,o);return this._send_request(a,s)});MixpanelGroup.prototype._send_request=function(e,o){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var s=_$3.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:s,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},o)};MixpanelGroup.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"};MixpanelGroup.prototype._get_config=function(e){return this._mixpanel.get_config(e)};MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove;MixpanelGroup.prototype.set=MixpanelGroup.prototype.set;MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once;MixpanelGroup.prototype.union=MixpanelGroup.prototype.union;MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset;MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};_$3.extend(MixpanelPeople.prototype,apiActions);MixpanelPeople.prototype._init=function(e){this._mixpanel=e};MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople(function(e,o,s){var a=this.set_action(e,o);return _$3.isObject(e)&&(s=o),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),a[SET_ACTION]=_$3.extend({},_$3.info.people_properties(),a[SET_ACTION]),this._send_request(a,s)});MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople(function(e,o,s){var a=this.set_once_action(e,o);return _$3.isObject(e)&&(s=o),this._send_request(a,s)});MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople(function(e,o){var s=this.unset_action(e);return this._send_request(s,o)});MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople(function(e,o,s){var a={},$={};return _$3.isObject(e)?(_$3.each(e,function(c,nt){if(!this._is_reserved_property(nt))if(isNaN(parseFloat(c))){console$1.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else $[nt]=c},this),s=o):(_$3.isUndefined(o)&&(o=1),$[e]=o),a[ADD_ACTION]=$,this._send_request(a,s)});MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople(function(e,o,s){_$3.isObject(e)&&(s=o);var a=this.append_action(e,o);return this._send_request(a,s)});MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople(function(e,o,s){_$3.isObject(e)&&(s=o);var a=this.remove_action(e,o);return this._send_request(a,s)});MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople(function(e,o,s){_$3.isObject(e)&&(s=o);var a=this.union_action(e,o);return this._send_request(a,s)});MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople(function(e,o,s){if(!_$3.isNumber(e)&&(e=parseFloat(e),isNaN(e))){console$1.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",_$3.extend({$amount:e},o),s)});MixpanelPeople.prototype.clear_charges=function(e){return this.set("$transactions",[],e)};MixpanelPeople.prototype.delete_user=function(){if(!this._identify_called()){console$1.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)};MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+".people"};MixpanelPeople.prototype._send_request=function(e,o){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var s=this._mixpanel.get_property("$device_id"),a=this._mixpanel.get_property("$user_id"),$=this._mixpanel.get_property("$had_persisted_distinct_id");s&&(e.$device_id=s),a&&(e.$user_id=a),$&&(e.$had_persisted_distinct_id=$);var c=_$3.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:c,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},o):(this._enqueue(e),_$3.isUndefined(o)||(this._get_config("verbose")?o({status:-1,error:null}):o(-1)),_$3.truncate(c,255))};MixpanelPeople.prototype._get_config=function(e){return this._mixpanel.get_config(e)};MixpanelPeople.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};MixpanelPeople.prototype._enqueue=function(e){SET_ACTION in e?this._mixpanel.persistence._add_to_people_queue(SET_ACTION,e):SET_ONCE_ACTION in e?this._mixpanel.persistence._add_to_people_queue(SET_ONCE_ACTION,e):UNSET_ACTION in e?this._mixpanel.persistence._add_to_people_queue(UNSET_ACTION,e):ADD_ACTION in e?this._mixpanel.persistence._add_to_people_queue(ADD_ACTION,e):APPEND_ACTION in e?this._mixpanel.persistence._add_to_people_queue(APPEND_ACTION,e):REMOVE_ACTION in e?this._mixpanel.persistence._add_to_people_queue(REMOVE_ACTION,e):UNION_ACTION in e?this._mixpanel.persistence._add_to_people_queue(UNION_ACTION,e):console$1.error("Invalid call to _enqueue():",e)};MixpanelPeople.prototype._flush_one_queue=function(e,o,s,a){var $=this,c=_$3.extend({},this._mixpanel.persistence.load_queue(e)),nt=c;!_$3.isUndefined(c)&&_$3.isObject(c)&&!_$3.isEmptyObject(c)&&($._mixpanel.persistence._pop_from_people_queue(e,c),$._mixpanel.persistence.save(),a&&(nt=a(c)),o.call($,nt,function(at,lt){at===0&&$._mixpanel.persistence._add_to_people_queue(e,c),_$3.isUndefined(s)||s(at,lt)}))};MixpanelPeople.prototype._flush=function(e,o,s,a,$,c,nt){var at=this;this._flush_one_queue(SET_ACTION,this.set,e),this._flush_one_queue(SET_ONCE_ACTION,this.set_once,a),this._flush_one_queue(UNSET_ACTION,this.unset,c,function(wt){return _$3.keys(wt)}),this._flush_one_queue(ADD_ACTION,this.increment,o),this._flush_one_queue(UNION_ACTION,this.union,$);var lt=this._mixpanel.persistence.load_queue(APPEND_ACTION);if(!_$3.isUndefined(lt)&&_$3.isArray(lt)&&lt.length)for(var et,it=function(wt,vt){wt===0&&at._mixpanel.persistence._add_to_people_queue(APPEND_ACTION,et),_$3.isUndefined(s)||s(wt,vt)},st=lt.length-1;st>=0;st--)lt=this._mixpanel.persistence.load_queue(APPEND_ACTION),et=lt.pop(),at._mixpanel.persistence.save(),_$3.isEmptyObject(et)||at.append(et,it);var ct=this._mixpanel.persistence.load_queue(REMOVE_ACTION);if(!_$3.isUndefined(ct)&&_$3.isArray(ct)&&ct.length)for(var ft,pt=function(wt,vt){wt===0&&at._mixpanel.persistence._add_to_people_queue(REMOVE_ACTION,ft),_$3.isUndefined(nt)||nt(wt,vt)},gt=ct.length-1;gt>=0;gt--)ct=this._mixpanel.persistence.load_queue(REMOVE_ACTION),ft=ct.pop(),at._mixpanel.persistence.save(),_$3.isEmptyObject(ft)||at.remove(ft,pt)};MixpanelPeople.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"};MixpanelPeople.prototype.set=MixpanelPeople.prototype.set;MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once;MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset;MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment;MixpanelPeople.prototype.append=MixpanelPeople.prototype.append;MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove;MixpanelPeople.prototype.union=MixpanelPeople.prototype.union;MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge;MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges;MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user;MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var SET_QUEUE_KEY="__mps",SET_ONCE_QUEUE_KEY="__mpso",UNSET_QUEUE_KEY="__mpus",ADD_QUEUE_KEY="__mpa",APPEND_QUEUE_KEY="__mpap",REMOVE_QUEUE_KEY="__mpr",UNION_QUEUE_KEY="__mpu",PEOPLE_DISTINCT_ID_KEY="$people_distinct_id",ALIAS_ID_KEY="__alias",EVENT_TIMERS_KEY="__timers",RESERVED_PROPERTIES=[SET_QUEUE_KEY,SET_ONCE_QUEUE_KEY,UNSET_QUEUE_KEY,ADD_QUEUE_KEY,APPEND_QUEUE_KEY,REMOVE_QUEUE_KEY,UNION_QUEUE_KEY,PEOPLE_DISTINCT_ID_KEY,ALIAS_ID_KEY,EVENT_TIMERS_KEY],MixpanelPersistence=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var o=e.persistence;o!=="cookie"&&o!=="localStorage"&&(console$1.critical("Unknown persistence type "+o+"; falling back to cookie"),o=e.persistence="cookie"),o==="localStorage"&&_$3.localStorage.is_supported()?this.storage=_$3.localStorage:this.storage=_$3.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var e={};return this.load(),_$3.each(this.props,function(o,s){_$3.include(RESERVED_PROPERTIES,s)||(e[s]=o)}),e};MixpanelPersistence.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=_$3.extend({},e))}};MixpanelPersistence.prototype.upgrade=function(){var e,o;this.storage===_$3.localStorage?(e=_$3.cookie.parse(this.name),_$3.cookie.remove(this.name),_$3.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===_$3.cookie&&(o=_$3.localStorage.parse(this.name),_$3.localStorage.remove(this.name),o&&this.register_once(o))};MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,_$3.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};MixpanelPersistence.prototype.load_prop=function(e){return this.load(),this.props[e]};MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}};MixpanelPersistence.prototype.register_once=function(e,o,s){return _$3.isObject(e)?(typeof o>"u"&&(o="None"),this.expire_days=typeof s>"u"?this.default_expiry:s,this.load(),_$3.each(e,function(a,$){(!this.props.hasOwnProperty($)||this.props[$]===o)&&(this.props[$]=a)},this),this.save(),!0):!1};MixpanelPersistence.prototype.register=function(e,o){return _$3.isObject(e)?(this.expire_days=typeof o>"u"?this.default_expiry:o,this.load(),_$3.extend(this.props,e),this.save(),!0):!1};MixpanelPersistence.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())};MixpanelPersistence.prototype.update_search_keyword=function(e){this.register(_$3.info.searchInfo(e))};MixpanelPersistence.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:_$3.info.referringDomain(e)||"$direct"},"")};MixpanelPersistence.prototype.get_referrer_info=function(){return _$3.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};MixpanelPersistence.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)};MixpanelPersistence.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()};MixpanelPersistence.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())};MixpanelPersistence.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())};MixpanelPersistence.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())};MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain};MixpanelPersistence.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())};MixpanelPersistence.prototype._add_to_people_queue=function(e,o){var s=this._get_queue_key(e),a=o[e],$=this._get_or_create_queue(SET_ACTION),c=this._get_or_create_queue(SET_ONCE_ACTION),nt=this._get_or_create_queue(UNSET_ACTION),at=this._get_or_create_queue(ADD_ACTION),lt=this._get_or_create_queue(UNION_ACTION),et=this._get_or_create_queue(REMOVE_ACTION,[]),it=this._get_or_create_queue(APPEND_ACTION,[]);s===SET_QUEUE_KEY?(_$3.extend($,a),this._pop_from_people_queue(ADD_ACTION,a),this._pop_from_people_queue(UNION_ACTION,a),this._pop_from_people_queue(UNSET_ACTION,a)):s===SET_ONCE_QUEUE_KEY?(_$3.each(a,function(st,ct){ct in c||(c[ct]=st)}),this._pop_from_people_queue(UNSET_ACTION,a)):s===UNSET_QUEUE_KEY?_$3.each(a,function(st){_$3.each([$,c,at,lt],function(ct){st in ct&&delete ct[st]}),_$3.each(it,function(ct){st in ct&&delete ct[st]}),nt[st]=!0}):s===ADD_QUEUE_KEY?(_$3.each(a,function(st,ct){ct in $?$[ct]+=st:(ct in at||(at[ct]=0),at[ct]+=st)},this),this._pop_from_people_queue(UNSET_ACTION,a)):s===UNION_QUEUE_KEY?(_$3.each(a,function(st,ct){_$3.isArray(st)&&(ct in lt||(lt[ct]=[]),lt[ct]=lt[ct].concat(st))}),this._pop_from_people_queue(UNSET_ACTION,a)):s===REMOVE_QUEUE_KEY?(et.push(a),this._pop_from_people_queue(APPEND_ACTION,a)):s===APPEND_QUEUE_KEY&&(it.push(a),this._pop_from_people_queue(UNSET_ACTION,a)),console$1.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),console$1.log(o),this.save()};MixpanelPersistence.prototype._pop_from_people_queue=function(e,o){var s=this.props[this._get_queue_key(e)];_$3.isUndefined(s)||_$3.each(o,function(a,$){e===APPEND_ACTION||e===REMOVE_ACTION?_$3.each(s,function(c){c[$]===a&&delete c[$]}):delete s[$]},this)};MixpanelPersistence.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))};MixpanelPersistence.prototype._get_queue_key=function(e){if(e===SET_ACTION)return SET_QUEUE_KEY;if(e===SET_ONCE_ACTION)return SET_ONCE_QUEUE_KEY;if(e===UNSET_ACTION)return UNSET_QUEUE_KEY;if(e===ADD_ACTION)return ADD_QUEUE_KEY;if(e===APPEND_ACTION)return APPEND_QUEUE_KEY;if(e===REMOVE_ACTION)return REMOVE_QUEUE_KEY;if(e===UNION_ACTION)return UNION_QUEUE_KEY;console$1.error("Invalid queue:",e)};MixpanelPersistence.prototype._get_or_create_queue=function(e,o){var s=this._get_queue_key(e);return o=_$3.isUndefined(o)?{}:o,this.props[s]||(this.props[s]=o)};MixpanelPersistence.prototype.set_event_timer=function(e,o){var s=this.load_prop(EVENT_TIMERS_KEY)||{};s[e]=o,this.props[EVENT_TIMERS_KEY]=s,this.save()};MixpanelPersistence.prototype.remove_event_timer=function(e){var o=this.load_prop(EVENT_TIMERS_KEY)||{},s=o[e];return _$3.isUndefined(s)||(delete this.props[EVENT_TIMERS_KEY][e],this.save()),s};var init_type,load_extra_bundle=function(e,o){throw new Error(e+" not available in this build.")},mixpanel_master,INIT_MODULE=0,INIT_SNIPPET=1,IDENTITY_FUNC=function(e){return e},NOOP_FUNC=function(){},PRIMARY_INSTANCE_NAME="mixpanel",PAYLOAD_TYPE_BASE64="base64",PAYLOAD_TYPE_JSON="json",DEVICE_ID_PREFIX="$device:",USE_XHR=win.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ENQUEUE_REQUESTS=!USE_XHR&&userAgent.indexOf("MSIE")===-1&&userAgent.indexOf("Mozilla")===-1,sendBeacon=null;navigator$1.sendBeacon&&(sendBeacon=function(){return navigator$1.sendBeacon.apply(navigator$1,arguments)});var DEFAULT_API_ROUTES={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},DEFAULT_CONFIG={api_host:"https://api-js.mixpanel.com",api_routes:DEFAULT_API_ROUTES,api_method:"POST",api_transport:"XHR",api_payload_format:PAYLOAD_TYPE_BASE64,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:NOOP_FUNC,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:30*60*1e3,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:MAX_RECORDING_MS,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},DOM_LOADED=!1,MixpanelLib=function(){},create_mplib=function(e,o,s){var a,$=s===PRIMARY_INSTANCE_NAME?mixpanel_master:mixpanel_master[s];if($&&init_type===INIT_MODULE)a=$;else{if($&&!_$3.isArray($)){console$1.error("You have already initialized "+s);return}a=new MixpanelLib}if(a._cached_groups={},a._init(e,o,s),a.people=new MixpanelPeople,a.people._init(a),!a.get_config("skip_first_touch_marketing")){var c=_$3.info.campaignParams(null),nt={},at=!1;_$3.each(c,function(lt,et){nt["initial_"+et]=lt,lt&&(at=!0)}),at&&a.people.set_once(nt)}return Config.DEBUG=Config.DEBUG||a.get_config("debug"),!_$3.isUndefined($)&&_$3.isArray($)&&(a._execute_array.call(a.people,$.people),a._execute_array($)),a};MixpanelLib.prototype.init=function(e,o,s){if(_$3.isUndefined(s)){this.report_error("You must name your new library: init(token, config, name)");return}if(s===PRIMARY_INSTANCE_NAME){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var a=create_mplib(e,o,s);return mixpanel_master[s]=a,a._loaded(),a};MixpanelLib.prototype._init=function(e,o,s){o=o||{},this.__loaded=!0,this.config={};var a={};if(!("api_payload_format"in o)){var $=o.api_host||DEFAULT_CONFIG.api_host;$.match(/\.mixpanel\.com/)&&(a.api_payload_format=PAYLOAD_TYPE_JSON)}if(this.set_config(_$3.extend({},DEFAULT_CONFIG,a,o,{name:s,token:e,callback_fn:(s===PRIMARY_INSTANCE_NAME?s:PRIMARY_INSTANCE_NAME+"."+s)+"._jsc"})),this._jsc=NOOP_FUNC,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!_$3.localStorage.is_supported(!0)||!USE_XHR)this._batch_requests=!1,console$1.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),_$3.each(this.get_batcher_configs(),function(lt){console$1.log("Clearing batch queue "+lt.queue_key),_$3.localStorage.remove(lt.queue_key)});else if(this.init_batchers(),sendBeacon&&win.addEventListener){var c=_$3.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);win.addEventListener("pagehide",function(lt){lt.persisted&&c()}),win.addEventListener("visibilitychange",function(){document$1.visibilityState==="hidden"&&c()})}}this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var nt=_$3.UUID();this.get_distinct_id()||this.register_once({distinct_id:DEVICE_ID_PREFIX+nt,$device_id:nt},"");var at=this.get_config("track_pageview");at&&this._init_url_change_tracking(at),this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent")&&this.start_session_recording()};MixpanelLib.prototype.start_session_recording=addOptOutCheckMixpanelLib(function(){if(!win.MutationObserver){console$1.critical("Browser does not support MutationObserver; skipping session recording");return}var e=_$3.bind(function(){this._recorder=this._recorder||new win.__mp_recorder(this),this._recorder.startRecording()},this);_$3.isUndefined(win.__mp_recorder)?load_extra_bundle(this.get_config("recorder_src"),e):e()});MixpanelLib.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():console$1.critical("Session recorder module not loaded")};MixpanelLib.prototype.get_session_recording_properties=function(){var e={};if(this._recorder){var o=this._recorder.replayId;o&&(e.$mp_replay_id=o)}return e};MixpanelLib.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=_$3.info.campaignParams(null);_$3.each(e,function(o,s){this.unregister(s)}.bind(this))}};MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(document$1.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(_$3.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(document$1.referrer)};MixpanelLib.prototype._dom_loaded=function(){_$3.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||_$3.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue};MixpanelLib.prototype._track_dom=function(e,o){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!DOM_LOADED)return this.__dom_loaded_queue.push([e,o]),!1;var s=new e().init(this);return s.track.apply(s,o)};MixpanelLib.prototype._init_url_change_tracking=function(e){var o="",s=this.track_pageview();if(s&&(o=_$3.info.currentUrl()),_$3.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){win.addEventListener("popstate",function(){win.dispatchEvent(new Event("mp_locationchange"))}),win.addEventListener("hashchange",function(){win.dispatchEvent(new Event("mp_locationchange"))});var a=win.history.pushState;typeof a=="function"&&(win.history.pushState=function(c,nt,at){a.call(win.history,c,nt,at),win.dispatchEvent(new Event("mp_locationchange"))});var $=win.history.replaceState;typeof $=="function"&&(win.history.replaceState=function(c,nt,at){$.call(win.history,c,nt,at),win.dispatchEvent(new Event("mp_locationchange"))}),win.addEventListener("mp_locationchange",function(){var c=_$3.info.currentUrl(),nt=!1;if(e==="full-url"?nt=c!==o:e==="url-with-path-and-query-string"?nt=c.split("#")[0]!==o.split("#")[0]:e==="url-with-path"&&(nt=c.split("#")[0].split("?")[0]!==o.split("#")[0].split("?")[0]),nt){var at=this.track_pageview();at&&(o=c)}}.bind(this))}};MixpanelLib.prototype._prepare_callback=function(e,o){if(_$3.isUndefined(e))return null;if(USE_XHR){var s=function(nt){e(nt,o)};return s}else{var a=this._jsc,$=""+Math.floor(Math.random()*1e8),c=this.get_config("callback_fn")+"["+$+"]";return a[$]=function(nt){delete a[$],e(nt,o)},c}};MixpanelLib.prototype._send_request=function(e,o,s,a){var $=!0;if(ENQUEUE_REQUESTS)return this.__request_queue.push(arguments),$;var c={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},nt=null;!a&&(_$3.isFunction(s)||typeof s=="string")&&(a=s,s=null),s=_$3.extend(c,s||{}),USE_XHR||(s.method="GET");var at=s.method==="POST",lt=sendBeacon&&at&&s.transport.toLowerCase()==="sendbeacon",et=s.verbose;o.verbose&&(et=!0),this.get_config("test")&&(o.test=1),et&&(o.verbose=1),this.get_config("img")&&(o.img=1),USE_XHR||(a?o.callback=a:(et||this.get_config("test"))&&(o.callback="(function(){})")),o.ip=this.get_config("ip")?1:0,o._=new Date().getTime().toString(),at&&(nt="data="+encodeURIComponent(o.data),delete o.data),e+="?"+_$3.HTTPBuildQuery(o);var it=this;if("img"in o){var st=document$1.createElement("img");st.src=e,document$1.body.appendChild(st)}else if(lt){try{$=sendBeacon(e,nt)}catch(vt){it.report_error(vt),$=!1}try{a&&a($?1:0)}catch(vt){it.report_error(vt)}}else if(USE_XHR)try{var ct=new XMLHttpRequest;ct.open(s.method,e,!0);var ft=this.get_config("xhr_headers");if(at&&(ft["Content-Type"]="application/x-www-form-urlencoded"),_$3.each(ft,function(vt,_t){ct.setRequestHeader(_t,vt)}),s.timeout_ms&&typeof ct.timeout<"u"){ct.timeout=s.timeout_ms;var pt=new Date().getTime()}ct.withCredentials=!0,ct.onreadystatechange=function(){if(ct.readyState===4)if(ct.status===200){if(a)if(et){var vt;try{vt=_$3.JSONDecode(ct.responseText)}catch(Pt){if(it.report_error(Pt),s.ignore_json_errors)vt=ct.responseText;else return}a(vt)}else a(Number(ct.responseText))}else{var _t;if(ct.timeout&&!ct.status&&new Date().getTime()-pt>=ct.timeout?_t="timeout":_t="Bad HTTP status: "+ct.status+" "+ct.statusText,it.report_error(_t),a)if(et){var $t=ct.responseHeaders||{};a({status:0,httpStatusCode:ct.status,error:_t,retryAfter:$t["Retry-After"]})}else a(0)}},ct.send(nt)}catch(vt){it.report_error(vt),$=!1}else{var gt=document$1.createElement("script");gt.type="text/javascript",gt.async=!0,gt.defer=!0,gt.src=e;var wt=document$1.getElementsByTagName("script")[0];wt.parentNode.insertBefore(gt,wt)}return $};MixpanelLib.prototype._execute_array=function(e){var o,s=[],a=[],$=[];_$3.each(e,function(nt){nt&&(o=nt[0],_$3.isArray(o)?$.push(nt):typeof nt=="function"?nt.call(this):_$3.isArray(nt)&&o==="alias"?s.push(nt):_$3.isArray(nt)&&o.indexOf("track")!==-1&&typeof this[o]=="function"?$.push(nt):a.push(nt))},this);var c=function(nt,at){_$3.each(nt,function(lt){if(_$3.isArray(lt[0])){var et=at;_$3.each(lt,function(it){et=et[it[0]].apply(et,it.slice(1))})}else this[lt[0]].apply(this,lt.slice(1))},at)};c(s,this),c(a,this),c($,this)};MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};MixpanelLib.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),o=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+o.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+o.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+o.groups,queue_key:e+"_gr"}},this._batcher_configs};MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=_$3.bind(function(s){return new RequestBatcher(s.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:_$3.bind(function(a,$,c){this._send_request(this.get_config("api_host")+s.endpoint,this._encode_data_for_request(a),$,this._prepare_callback(c,a))},this),beforeSendHook:_$3.bind(function(a){return this._run_hook("before_send_"+s.type,a)},this),stopAllBatchingFunc:_$3.bind(this.stop_batch_senders,this),usePersistence:!0})},this),o=this.get_batcher_configs();this.request_batchers={events:e(o.events),people:e(o.people),groups:e(o.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()};MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,_$3.each(this.request_batchers,function(e){e.start()}))};MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,_$3.each(this.request_batchers,function(e){e.stop(),e.clear()})};MixpanelLib.prototype.push=function(e){this._execute_array([e])};MixpanelLib.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)};MixpanelLib.prototype._encode_data_for_request=function(e){var o=_$3.JSONEncode(e);return this.get_config("api_payload_format")===PAYLOAD_TYPE_BASE64&&(o=_$3.base64Encode(o)),{data:o}};MixpanelLib.prototype._track_or_batch=function(e,o){var s=_$3.truncate(e.data,255),a=e.endpoint,$=e.batcher,c=e.should_send_immediately,nt=e.send_request_options||{};o=o||NOOP_FUNC;var at=!0,lt=_$3.bind(function(){return nt.skip_hooks||(s=this._run_hook("before_send_"+e.type,s)),s?(console$1.log("MIXPANEL REQUEST:"),console$1.log(s),this._send_request(a,this._encode_data_for_request(s),nt,this._prepare_callback(o,s))):null},this);return this._batch_requests&&!c?$.enqueue(s,function(et){et?o(1,s):lt()}):at=lt(),at&&s};MixpanelLib.prototype.track=addOptOutCheckMixpanelLib(function(e,o,s,a){!a&&typeof s=="function"&&(a=s,s=null),s=s||{};var $=s.transport;$&&(s.transport=$);var c=s.send_immediately;if(typeof a!="function"&&(a=NOOP_FUNC),_$3.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){a(0);return}o=_$3.extend({},o),o.token=this.get_config("token");var nt=this.persistence.remove_event_timer(e);if(!_$3.isUndefined(nt)){var at=new Date().getTime()-nt;o.$duration=parseFloat((at/1e3).toFixed(3))}this._set_default_superprops();var lt=this.get_config("track_marketing")?_$3.info.marketingParams():{};o=_$3.extend({},_$3.info.properties({mp_loader:this.get_config("mp_loader")}),lt,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),o);var et=this.get_config("property_blacklist");_$3.isArray(et)?_$3.each(et,function(ct){delete o[ct]}):this.report_error("Invalid value for property_blacklist config: "+et);var it={event:e,properties:o},st=this._track_or_batch({type:"events",data:it,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:c,send_request_options:s},a);return st});MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib(function(e,o,s){_$3.isArray(o)||(o=[o]);var a={};return a[e]=o,this.register(a),this.people.set(e,o,s)});MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib(function(e,o,s){var a=this.get_property(e),$={};return a===void 0?($[e]=[o],this.register($)):a.indexOf(o)===-1&&(a.push(o),$[e]=a,this.register($)),this.people.union(e,o,s)});MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib(function(e,o,s){var a=this.get_property(e);if(a!==void 0){var $=a.indexOf(o);$>-1&&(a.splice($,1),this.register({group_key:a})),a.length===0&&this.unregister(e)}return this.people.remove(e,o,s)});MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib(function(e,o,s,a){var $=_$3.extend({},o||{});return _$3.each(s,function(c,nt){c!=null&&($[nt]=c)}),this.track(e,$,a)});MixpanelLib.prototype._create_map_key=function(e,o){return e+"_"+JSON.stringify(o)};MixpanelLib.prototype._remove_group_from_cache=function(e,o){delete this._cached_groups[this._create_map_key(e,o)]};MixpanelLib.prototype.get_group=function(e,o){var s=this._create_map_key(e,o),a=this._cached_groups[s];return(a===void 0||a._group_key!==e||a._group_id!==o)&&(a=new MixpanelGroup,a._init(this,e,o),this._cached_groups[s]=a),a};MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib(function(e,o){typeof e!="object"&&(e={}),o=o||{};var s=o.event_name||"$mp_web_page_view",a=_$3.extend(_$3.info.mpPageViewProperties(),_$3.info.campaignParams(),_$3.info.clickParams()),$=_$3.extend({},a,e);return this.track(s,$)});MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)};MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)};MixpanelLib.prototype.time_event=function(e){if(_$3.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var REGISTER_DEFAULTS={persistent:!0},options_for_register=function(e){var o;return _$3.isObject(e)?o=e:_$3.isUndefined(e)?o={}:o={days:e},_$3.extend({},REGISTER_DEFAULTS,o)};MixpanelLib.prototype.register=function(e,o){var s=options_for_register(o);s.persistent?this.persistence.register(e,s.days):_$3.extend(this.unpersisted_superprops,e)};MixpanelLib.prototype.register_once=function(e,o,s){var a=options_for_register(s);a.persistent?this.persistence.register_once(e,o,a.days):(typeof o>"u"&&(o="None"),_$3.each(e,function($,c){(!this.unpersisted_superprops.hasOwnProperty(c)||this.unpersisted_superprops[c]===o)&&(this.unpersisted_superprops[c]=$)},this))};MixpanelLib.prototype.unregister=function(e,o){o=options_for_register(o),o.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]};MixpanelLib.prototype._register_single=function(e,o){var s={};s[e]=o,this.register(s)};MixpanelLib.prototype.identify=function(e,o,s,a,$,c,nt,at){var lt=this.get_distinct_id();if(e&&lt!==e){if(typeof e=="string"&&e.indexOf(DEVICE_ID_PREFIX)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var et=lt;this.register_once({$had_persisted_distinct_id:!0,$device_id:et},"")}e!==lt&&e!==this.get_property(ALIAS_ID_KEY)&&(this.unregister(ALIAS_ID_KEY),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(o,s,a,$,c,nt,at),e!==lt&&this.track("$identify",{distinct_id:e,$anon_distinct_id:lt},{skip_hooks:!0})};MixpanelLib.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=_$3.UUID();this.register_once({distinct_id:DEVICE_ID_PREFIX+e,$device_id:e},"")};MixpanelLib.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};MixpanelLib.prototype.alias=function(e,o){if(e===this.get_property(PEOPLE_DISTINCT_ID_KEY))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var s=this;return _$3.isUndefined(o)&&(o=this.get_distinct_id()),e!==o?(this._register_single(ALIAS_ID_KEY,e),this.track("$create_alias",{alias:e,distinct_id:o},{skip_hooks:!0},function(){s.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)};MixpanelLib.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)};MixpanelLib.prototype.set_config=function(e){if(_$3.isObject(e)){_$3.extend(this.config,e);var o=e.batch_size;o&&_$3.each(this.request_batchers,function(s){s.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Config.DEBUG=Config.DEBUG||this.get_config("debug")}};MixpanelLib.prototype.get_config=function(e){return this.config[e]};MixpanelLib.prototype._run_hook=function(e){var o=(this.config.hooks[e]||IDENTITY_FUNC).apply(this,slice$1.call(arguments,1));return typeof o>"u"&&(this.report_error(e+" hook did not return a value"),o=null),o};MixpanelLib.prototype.get_property=function(e){return this.persistence.load_prop([e])};MixpanelLib.prototype.toString=function(){var e=this.get_config("name");return e!==PRIMARY_INSTANCE_NAME&&(e=PRIMARY_INSTANCE_NAME+"."+e),e};MixpanelLib.prototype._event_is_disabled=function(e){return _$3.isBlockedUA(userAgent)||this._flags.disable_all_events||_$3.include(this.__disabled_events,e)};MixpanelLib.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&_$3.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||_$3.cookie.get("mp_optout"))&&(_$3.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};MixpanelLib.prototype._gdpr_update_persistence=function(e){var o;if(e&&e.clear_persistence)o=!0;else if(e&&e.enable_persistence)o=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==o&&this.persistence.set_disabled(o),o?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()};MixpanelLib.prototype._gdpr_call_func=function(e,o){return o=_$3.extend({track:_$3.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},o),_$3.localStorage.is_supported()||(o.persistence_type="cookie"),e(this.get_config("token"),{track:o.track,trackEventName:o.track_event_name,trackProperties:o.track_properties,persistenceType:o.persistence_type,persistencePrefix:o.cookie_prefix,cookieDomain:o.cookie_domain,cookieExpiration:o.cookie_expiration,crossSiteCookie:o.cross_site_cookie,crossSubdomainCookie:o.cross_subdomain_cookie,secureCookie:o.secure_cookie,ignoreDnt:o.ignore_dnt})};MixpanelLib.prototype.opt_in_tracking=function(e){e=_$3.extend({enable_persistence:!0},e),this._gdpr_call_func(optIn,e),this._gdpr_update_persistence(e)};MixpanelLib.prototype.opt_out_tracking=function(e){e=_$3.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(optOut,e),this._gdpr_update_persistence(e)};MixpanelLib.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(hasOptedIn,e)};MixpanelLib.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(hasOptedOut,e)};MixpanelLib.prototype.clear_opt_in_out_tracking=function(e){e=_$3.extend({enable_persistence:!0},e),this._gdpr_call_func(clearOptInOut,e),this._gdpr_update_persistence(e)};MixpanelLib.prototype.report_error=function(e,o){console$1.error.apply(console$1.error,arguments);try{!o&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,o)}catch(s){console$1.error(s)}};MixpanelLib.prototype.init=MixpanelLib.prototype.init;MixpanelLib.prototype.reset=MixpanelLib.prototype.reset;MixpanelLib.prototype.disable=MixpanelLib.prototype.disable;MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event;MixpanelLib.prototype.track=MixpanelLib.prototype.track;MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links;MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms;MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview;MixpanelLib.prototype.register=MixpanelLib.prototype.register;MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once;MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister;MixpanelLib.prototype.identify=MixpanelLib.prototype.identify;MixpanelLib.prototype.alias=MixpanelLib.prototype.alias;MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag;MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config;MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config;MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property;MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id;MixpanelLib.prototype.toString=MixpanelLib.prototype.toString;MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking;MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking;MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking;MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking;MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking;MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group;MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group;MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group;MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group;MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups;MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders;MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders;MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording;MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording;MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties;MixpanelLib.prototype.DEFAULT_API_ROUTES=DEFAULT_API_ROUTES;MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties;MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword;MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info;MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain;MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var instances={},extend_mp=function(){_$3.each(instances,function(e,o){o!==PRIMARY_INSTANCE_NAME&&(mixpanel_master[o]=e)}),mixpanel_master._=_$3},override_mp_init_func=function(){mixpanel_master.init=function(e,o,s){if(s)return mixpanel_master[s]||(mixpanel_master[s]=instances[s]=create_mplib(e,o,s),mixpanel_master[s]._loaded()),mixpanel_master[s];var a=mixpanel_master;instances[PRIMARY_INSTANCE_NAME]?a=instances[PRIMARY_INSTANCE_NAME]:e&&(a=create_mplib(e,o,PRIMARY_INSTANCE_NAME),a._loaded(),instances[PRIMARY_INSTANCE_NAME]=a),mixpanel_master=a,init_type===INIT_SNIPPET&&(win[PRIMARY_INSTANCE_NAME]=mixpanel_master),extend_mp()}},add_dom_loaded_handler=function(){function e(){e.done||(e.done=!0,DOM_LOADED=!0,ENQUEUE_REQUESTS=!1,_$3.each(instances,function(a){a._dom_loaded()}))}function o(){try{document$1.documentElement.doScroll("left")}catch{setTimeout(o,1);return}e()}if(document$1.addEventListener)document$1.readyState==="complete"?e():document$1.addEventListener("DOMContentLoaded",e,!1);else if(document$1.attachEvent){document$1.attachEvent("onreadystatechange",e);var s=!1;try{s=win.frameElement===null}catch{}document$1.documentElement.doScroll&&s&&o()}_$3.register_event(win,"load",e,!0)};function init_as_module(e){return load_extra_bundle=e,init_type=INIT_MODULE,mixpanel_master=new MixpanelLib,override_mp_init_func(),mixpanel_master.init(),add_dom_loaded_handler(),mixpanel_master}function loadNoop(e,o){o()}init_as_module(loadNoop);function r(e){var o,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(o=0;o<e.length;o++)e[o]&&(s=r(e[o]))&&(a&&(a+=" "),a+=s);else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function clsx(){for(var e,o,s=0,a="";s<arguments.length;)(e=arguments[s++])&&(o=r(e))&&(a&&(a+=" "),a+=o);return a}const u=e=>typeof e=="number"&&!isNaN(e),d=e=>typeof e=="string",p=e=>typeof e=="function",m=e=>d(e)||p(e)?e:null,f=e=>reactExports.isValidElement(e)||d(e)||p(e)||u(e);function g(e,o,s){s===void 0&&(s=300);const{scrollHeight:a,style:$}=e;requestAnimationFrame(()=>{$.minHeight="initial",$.height=a+"px",$.transition=`all ${s}ms`,requestAnimationFrame(()=>{$.height="0",$.padding="0",$.margin="0",setTimeout(o,s)})})}function h(e){let{enter:o,exit:s,appendPosition:a=!1,collapse:$=!0,collapseDuration:c=300}=e;return function(nt){let{children:at,position:lt,preventExitTransition:et,done:it,nodeRef:st,isIn:ct}=nt;const ft=a?`${o}--${lt}`:o,pt=a?`${s}--${lt}`:s,gt=reactExports.useRef(0);return reactExports.useLayoutEffect(()=>{const wt=st.current,vt=ft.split(" "),_t=$t=>{$t.target===st.current&&(wt.dispatchEvent(new Event("d")),wt.removeEventListener("animationend",_t),wt.removeEventListener("animationcancel",_t),gt.current===0&&$t.type!=="animationcancel"&&wt.classList.remove(...vt))};wt.classList.add(...vt),wt.addEventListener("animationend",_t),wt.addEventListener("animationcancel",_t)},[]),reactExports.useEffect(()=>{const wt=st.current,vt=()=>{wt.removeEventListener("animationend",vt),$?g(wt,it,c):it()};ct||(et?vt():(gt.current=1,wt.className+=` ${pt}`,wt.addEventListener("animationend",vt)))},[ct]),t.createElement(t.Fragment,null,at)}}function y(e,o){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:o}:{}}const v={list:new Map,emitQueue:new Map,on(e,o){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(o),this},off(e,o){if(o){const s=this.list.get(e).filter(a=>a!==o);return this.list.set(e,s),this}return this.list.delete(e),this},cancelEmit(e){const o=this.emitQueue.get(e);return o&&(o.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(o=>{const s=setTimeout(()=>{o(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(s)})}},T=e=>{let{theme:o,type:s,...a}=e;return t.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:o==="colored"?"currentColor":`var(--toastify-icon-color-${s})`,...a})},E={info:function(e){return t.createElement(T,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return t.createElement(T,{...e},t.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return t.createElement(T,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return t.createElement(T,{...e},t.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return t.createElement("div",{className:"Toastify__spinner"})}};function C(e){const[,o]=reactExports.useReducer(ft=>ft+1,0),[s,a]=reactExports.useState([]),$=reactExports.useRef(null),c=reactExports.useRef(new Map).current,nt=ft=>s.indexOf(ft)!==-1,at=reactExports.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:nt,getToast:ft=>c.get(ft)}).current;function lt(ft){let{containerId:pt}=ft;const{limit:gt}=at.props;!gt||pt&&at.containerId!==pt||(at.count-=at.queue.length,at.queue=[])}function et(ft){a(pt=>ft==null?[]:pt.filter(gt=>gt!==ft))}function it(){const{toastContent:ft,toastProps:pt,staleId:gt}=at.queue.shift();ct(ft,pt,gt)}function st(ft,pt){let{delay:gt,staleId:wt,...vt}=pt;if(!f(ft)||function(Wt){return!$.current||at.props.enableMultiContainer&&Wt.containerId!==at.props.containerId||c.has(Wt.toastId)&&Wt.updateId==null}(vt))return;const{toastId:_t,updateId:$t,data:Pt}=vt,{props:Nt}=at,Lt=()=>et(_t),Ft=$t==null;Ft&&at.count++;const Jt={...Nt,style:Nt.toastStyle,key:at.toastKey++,...Object.fromEntries(Object.entries(vt).filter(Wt=>{let[Yr,Ot]=Wt;return Ot!=null})),toastId:_t,updateId:$t,data:Pt,closeToast:Lt,isIn:!1,className:m(vt.className||Nt.toastClassName),bodyClassName:m(vt.bodyClassName||Nt.bodyClassName),progressClassName:m(vt.progressClassName||Nt.progressClassName),autoClose:!vt.isLoading&&(_r=vt.autoClose,wr=Nt.autoClose,_r===!1||u(_r)&&_r>0?_r:wr),deleteToast(){const Wt=y(c.get(_t),"removed");c.delete(_t),v.emit(4,Wt);const Yr=at.queue.length;if(at.count=_t==null?at.count-at.displayedToast:at.count-1,at.count<0&&(at.count=0),Yr>0){const Ot=_t==null?at.props.limit:1;if(Yr===1||Ot===1)at.displayedToast++,it();else{const gr=Ot>Yr?Yr:Ot;at.displayedToast=gr;for(let $o=0;$o<gr;$o++)it()}}else o()}};var _r,wr;Jt.iconOut=function(Wt){let{theme:Yr,type:Ot,isLoading:gr,icon:$o}=Wt,In=null;const en={theme:Yr,type:Ot};return $o===!1||(p($o)?In=$o(en):reactExports.isValidElement($o)?In=reactExports.cloneElement($o,en):d($o)||u($o)?In=$o:gr?In=E.spinner():(Lr=>Lr in E)(Ot)&&(In=E[Ot](en))),In}(Jt),p(vt.onOpen)&&(Jt.onOpen=vt.onOpen),p(vt.onClose)&&(Jt.onClose=vt.onClose),Jt.closeButton=Nt.closeButton,vt.closeButton===!1||f(vt.closeButton)?Jt.closeButton=vt.closeButton:vt.closeButton===!0&&(Jt.closeButton=!f(Nt.closeButton)||Nt.closeButton);let tn=ft;reactExports.isValidElement(ft)&&!d(ft.type)?tn=reactExports.cloneElement(ft,{closeToast:Lt,toastProps:Jt,data:Pt}):p(ft)&&(tn=ft({closeToast:Lt,toastProps:Jt,data:Pt})),Nt.limit&&Nt.limit>0&&at.count>Nt.limit&&Ft?at.queue.push({toastContent:tn,toastProps:Jt,staleId:wt}):u(gt)?setTimeout(()=>{ct(tn,Jt,wt)},gt):ct(tn,Jt,wt)}function ct(ft,pt,gt){const{toastId:wt}=pt;gt&&c.delete(gt);const vt={content:ft,props:pt};c.set(wt,vt),a(_t=>[..._t,wt].filter($t=>$t!==gt)),v.emit(4,y(vt,vt.props.updateId==null?"added":"updated"))}return reactExports.useEffect(()=>(at.containerId=e.containerId,v.cancelEmit(3).on(0,st).on(1,ft=>$.current&&et(ft)).on(5,lt).emit(2,at),()=>{c.clear(),v.emit(3,at)}),[]),reactExports.useEffect(()=>{at.props=e,at.isToastActive=nt,at.displayedToast=s.length}),{getToastToRender:function(ft){const pt=new Map,gt=Array.from(c.values());return e.newestOnTop&&gt.reverse(),gt.forEach(wt=>{const{position:vt}=wt.props;pt.has(vt)||pt.set(vt,[]),pt.get(vt).push(wt)}),Array.from(pt,wt=>ft(wt[0],wt[1]))},containerRef:$,isToastActive:nt}}function b(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function I(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function _$2(e){const[o,s]=reactExports.useState(!1),[a,$]=reactExports.useState(!1),c=reactExports.useRef(null),nt=reactExports.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,at=reactExports.useRef(e),{autoClose:lt,pauseOnHover:et,closeToast:it,onClick:st,closeOnClick:ct}=e;function ft(Pt){if(e.draggable){Pt.nativeEvent.type==="touchstart"&&Pt.nativeEvent.preventDefault(),nt.didMove=!1,document.addEventListener("mousemove",vt),document.addEventListener("mouseup",_t),document.addEventListener("touchmove",vt),document.addEventListener("touchend",_t);const Nt=c.current;nt.canCloseOnClick=!0,nt.canDrag=!0,nt.boundingRect=Nt.getBoundingClientRect(),Nt.style.transition="",nt.x=b(Pt.nativeEvent),nt.y=I(Pt.nativeEvent),e.draggableDirection==="x"?(nt.start=nt.x,nt.removalDistance=Nt.offsetWidth*(e.draggablePercent/100)):(nt.start=nt.y,nt.removalDistance=Nt.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function pt(Pt){if(nt.boundingRect){const{top:Nt,bottom:Lt,left:Ft,right:Jt}=nt.boundingRect;Pt.nativeEvent.type!=="touchend"&&e.pauseOnHover&&nt.x>=Ft&&nt.x<=Jt&&nt.y>=Nt&&nt.y<=Lt?wt():gt()}}function gt(){s(!0)}function wt(){s(!1)}function vt(Pt){const Nt=c.current;nt.canDrag&&Nt&&(nt.didMove=!0,o&&wt(),nt.x=b(Pt),nt.y=I(Pt),nt.delta=e.draggableDirection==="x"?nt.x-nt.start:nt.y-nt.start,nt.start!==nt.x&&(nt.canCloseOnClick=!1),Nt.style.transform=`translate${e.draggableDirection}(${nt.delta}px)`,Nt.style.opacity=""+(1-Math.abs(nt.delta/nt.removalDistance)))}function _t(){document.removeEventListener("mousemove",vt),document.removeEventListener("mouseup",_t),document.removeEventListener("touchmove",vt),document.removeEventListener("touchend",_t);const Pt=c.current;if(nt.canDrag&&nt.didMove&&Pt){if(nt.canDrag=!1,Math.abs(nt.delta)>nt.removalDistance)return $(!0),void e.closeToast();Pt.style.transition="transform 0.2s, opacity 0.2s",Pt.style.transform=`translate${e.draggableDirection}(0)`,Pt.style.opacity="1"}}reactExports.useEffect(()=>{at.current=e}),reactExports.useEffect(()=>(c.current&&c.current.addEventListener("d",gt,{once:!0}),p(e.onOpen)&&e.onOpen(reactExports.isValidElement(e.children)&&e.children.props),()=>{const Pt=at.current;p(Pt.onClose)&&Pt.onClose(reactExports.isValidElement(Pt.children)&&Pt.children.props)}),[]),reactExports.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||wt(),window.addEventListener("focus",gt),window.addEventListener("blur",wt)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",gt),window.removeEventListener("blur",wt))}),[e.pauseOnFocusLoss]);const $t={onMouseDown:ft,onTouchStart:ft,onMouseUp:pt,onTouchEnd:pt};return lt&&et&&($t.onMouseEnter=wt,$t.onMouseLeave=gt),ct&&($t.onClick=Pt=>{st&&st(Pt),nt.canCloseOnClick&&it()}),{playToast:gt,pauseToast:wt,isRunning:o,preventExitTransition:a,toastRef:c,eventHandlers:$t}}function L(e){let{closeToast:o,theme:s,ariaLabel:a="close"}=e;return t.createElement("button",{className:`Toastify__close-button Toastify__close-button--${s}`,type:"button",onClick:$=>{$.stopPropagation(),o($)},"aria-label":a},t.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function O$1(e){let{delay:o,isRunning:s,closeToast:a,type:$="default",hide:c,className:nt,style:at,controlledProgress:lt,progress:et,rtl:it,isIn:st,theme:ct}=e;const ft=c||lt&&et===0,pt={...at,animationDuration:`${o}ms`,animationPlayState:s?"running":"paused",opacity:ft?0:1};lt&&(pt.transform=`scaleX(${et})`);const gt=clsx("Toastify__progress-bar",lt?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${ct}`,`Toastify__progress-bar--${$}`,{"Toastify__progress-bar--rtl":it}),wt=p(nt)?nt({rtl:it,type:$,defaultClassName:gt}):clsx(gt,nt);return t.createElement("div",{role:"progressbar","aria-hidden":ft?"true":"false","aria-label":"notification timer",className:wt,style:pt,[lt&&et>=1?"onTransitionEnd":"onAnimationEnd"]:lt&&et<1?null:()=>{st&&a()}})}const N=e=>{const{isRunning:o,preventExitTransition:s,toastRef:a,eventHandlers:$}=_$2(e),{closeButton:c,children:nt,autoClose:at,onClick:lt,type:et,hideProgressBar:it,closeToast:st,transition:ct,position:ft,className:pt,style:gt,bodyClassName:wt,bodyStyle:vt,progressClassName:_t,progressStyle:$t,updateId:Pt,role:Nt,progress:Lt,rtl:Ft,toastId:Jt,deleteToast:_r,isIn:wr,isLoading:tn,iconOut:Wt,closeOnClick:Yr,theme:Ot}=e,gr=clsx("Toastify__toast",`Toastify__toast-theme--${Ot}`,`Toastify__toast--${et}`,{"Toastify__toast--rtl":Ft},{"Toastify__toast--close-on-click":Yr}),$o=p(pt)?pt({rtl:Ft,position:ft,type:et,defaultClassName:gr}):clsx(gr,pt),In=!!Lt||!at,en={closeToast:st,type:et,theme:Ot};let Lr=null;return c===!1||(Lr=p(c)?c(en):reactExports.isValidElement(c)?reactExports.cloneElement(c,en):L(en)),t.createElement(ct,{isIn:wr,done:_r,position:ft,preventExitTransition:s,nodeRef:a},t.createElement("div",{id:Jt,onClick:lt,className:$o,...$,style:gt,ref:a},t.createElement("div",{...wr&&{role:Nt},className:p(wt)?wt({type:et}):clsx("Toastify__toast-body",wt),style:vt},Wt!=null&&t.createElement("div",{className:clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!tn})},Wt),t.createElement("div",null,nt)),Lr,t.createElement(O$1,{...Pt&&!In?{key:`pb-${Pt}`}:{},rtl:Ft,theme:Ot,delay:at,isRunning:o,isIn:wr,closeToast:st,hide:it,type:et,style:$t,className:_t,controlledProgress:In,progress:Lt||0})))},M=function(e,o){return o===void 0&&(o=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:o}},R=h(M("bounce",!0));h(M("slide",!0));h(M("zoom"));h(M("flip"));const k$1=reactExports.forwardRef((e,o)=>{const{getToastToRender:s,containerRef:a,isToastActive:$}=C(e),{className:c,style:nt,rtl:at,containerId:lt}=e;function et(it){const st=clsx("Toastify__toast-container",`Toastify__toast-container--${it}`,{"Toastify__toast-container--rtl":at});return p(c)?c({position:it,rtl:at,defaultClassName:st}):clsx(st,m(c))}return reactExports.useEffect(()=>{o&&(o.current=a.current)},[]),t.createElement("div",{ref:a,className:"Toastify",id:lt},s((it,st)=>{const ct=st.length?{...nt}:{...nt,pointerEvents:"none"};return t.createElement("div",{className:et(it),style:ct,key:`container-${it}`},st.map((ft,pt)=>{let{content:gt,props:wt}=ft;return t.createElement(N,{...wt,isIn:$(wt.toastId),style:{...wt.style,"--nth":pt+1,"--len":st.length},key:`toast-${wt.key}`},gt)}))}))});k$1.displayName="ToastContainer",k$1.defaultProps={position:"top-right",transition:R,autoClose:5e3,closeButton:L,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let P,B$1=new Map,D$1=[],A=1;function z$1(){return""+A++}function F$1(e){return e&&(d(e.toastId)||u(e.toastId))?e.toastId:z$1()}function H$1(e,o){return B$1.size>0?v.emit(0,e,o):D$1.push({content:e,options:o}),o.toastId}function S(e,o){return{...o,type:o&&o.type||e,toastId:F$1(o)}}function q$1(e){return(o,s)=>H$1(o,S(e,s))}function Q(e,o){return H$1(e,S("default",o))}Q.loading=(e,o)=>H$1(e,S("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...o})),Q.promise=function(e,o,s){let a,{pending:$,error:c,success:nt}=o;$&&(a=d($)?Q.loading($,s):Q.loading($.render,{...s,...$}));const at={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},lt=(it,st,ct)=>{if(st==null)return void Q.dismiss(a);const ft={type:it,...at,...s,data:ct},pt=d(st)?{render:st}:st;return a?Q.update(a,{...ft,...pt}):Q(pt.render,{...ft,...pt}),ct},et=p(e)?e():e;return et.then(it=>lt("success",nt,it)).catch(it=>lt("error",c,it)),et},Q.success=q$1("success"),Q.info=q$1("info"),Q.error=q$1("error"),Q.warning=q$1("warning"),Q.warn=Q.warning,Q.dark=(e,o)=>H$1(e,S("default",{theme:"dark",...o})),Q.dismiss=e=>{B$1.size>0?v.emit(1,e):D$1=D$1.filter(o=>e!=null&&o.options.toastId!==e)},Q.clearWaitingQueue=function(e){return e===void 0&&(e={}),v.emit(5,e)},Q.isActive=e=>{let o=!1;return B$1.forEach(s=>{s.isToastActive&&s.isToastActive(e)&&(o=!0)}),o},Q.update=function(e,o){o===void 0&&(o={}),setTimeout(()=>{const s=function(a,$){let{containerId:c}=$;const nt=B$1.get(c||P);return nt&&nt.getToast(a)}(e,o);if(s){const{props:a,content:$}=s,c={delay:100,...a,...o,toastId:o.toastId||e,updateId:z$1()};c.toastId!==e&&(c.staleId=e);const nt=c.render||$;delete c.render,H$1(nt,c)}},0)},Q.done=e=>{Q.update(e,{progress:1})},Q.onChange=e=>(v.on(4,e),()=>{v.off(4,e)}),Q.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Q.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},v.on(2,e=>{P=e.containerId||e,B$1.set(P,e),D$1.forEach(o=>{v.emit(0,o.content,o.options)}),D$1=[]}).on(3,e=>{B$1.delete(e.containerId||e),B$1.size===0&&v.off(0).off(1).off(5)});let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const byteToHex=[];for(let e=0;e<256;++e)byteToHex.push((e+256).toString(16).slice(1));function unsafeStringify(e,o=0){return byteToHex[e[o+0]]+byteToHex[e[o+1]]+byteToHex[e[o+2]]+byteToHex[e[o+3]]+"-"+byteToHex[e[o+4]]+byteToHex[e[o+5]]+"-"+byteToHex[e[o+6]]+byteToHex[e[o+7]]+"-"+byteToHex[e[o+8]]+byteToHex[e[o+9]]+"-"+byteToHex[e[o+10]]+byteToHex[e[o+11]]+byteToHex[e[o+12]]+byteToHex[e[o+13]]+byteToHex[e[o+14]]+byteToHex[e[o+15]]}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(e,o,s){if(native.randomUUID&&!o&&!e)return native.randomUUID();e=e||{};const a=e.random||(e.rng||rng)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,unsafeStringify(a)}function create_order_debug(e){return api.post("/create_order_debug",e)}const getExecutionFeeds=e=>api.get(`/agentexecutionfeeds/get/execution/${e}`),updateExecution=(e,o)=>api.put(`/agentexecutions/update/${e}`,o),getExecution=e=>api.get(`/agentexecutions/get/${e}`),getResources=e=>api.get(`/resources/get/all/${e}`),getTemplateResource=(e,o)=>api.get(`/resources/get/template/${e}/name/${o}`),uploadFile_embed_comfy=async(e,o)=>{api$1.get("accessToken");let s=localStorage.getItem("accessTokenHuaxiaobao");try{return(await axios.post(`${baseUrl()}resources/add/${e}`,o,{headers:{Authorization:`Bearer ${s}`}})).data}catch(a){console.error("Upload failed:",a.response?a.response.data:a.message)}},shareFile=e=>api.get(`/resources/share/${e}`),getDateTime=e=>api.get(`/agents/get/schedule_data/${e}`),publishToMarketplace=(e,o)=>api.post("/agent_templates/publish_template/with_executionid",{agent_execution_id:e,price:o}),formatTimeDifference=e=>{const o=["years","months","days","hours","minutes"],s=["year","month","day","hour","minute"];for(let a=0;a<o.length;a++){const $=o[a];if(e[$]!==0)return $==="minutes"?`${e[$]} ${e[$]===1?s[a]:$} 之前`:`${e[$]} ${e[$]===1?s[a]:$} 之前`}return"刚才"},formatBytes=(e,o=2)=>{if(e===0)return"0 Bytes";const s=1024,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],$=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/Math.pow(s,$)).toFixed(o))} ${a[$]}`},downloadFile=(e,o=null)=>{const s=api$1.get("accessToken"),a=`${baseUrl()}/resources/get/${e}`;if(localStorage.getItem("applicationEnvironment")==="PROD"){const c={Authorization:`Bearer ${s}`};return fetch(a,{headers:c}).then(nt=>nt.blob()).then(nt=>{if(o){const at=window.URL.createObjectURL(nt),lt=document.createElement("a");lt.href=at,lt.download=o,lt.click(),window.URL.revokeObjectURL(at)}else return nt}).catch(nt=>{console.error("Error downloading file:",nt)})}else if(o)window.open(a,"_blank");else return fetch(a).then(c=>c.blob()).catch(c=>{console.error("Error downloading file:",c)})},shareContent=e=>{shareFile(e).then(o=>{o.data.result=="success",alert(o.data.message)}).catch(o=>{console.error("Error fetching project:",o)})},downloadAllFiles=(e,o)=>{const s=new JSZip,a=[],$={};e.forEach((c,nt)=>{$[c.name]?$[c.name]++:$[c.name]=1;let at=c.name;if($[c.name]>1){const et=c.name.lastIndexOf("."),it=c.name.substring(0,et),st=c.name.substring(et+1);at=`${it} (${$[c.name]-1}).${st}`}const lt=downloadFile(c.id).then(et=>{const it=new Blob([et],{type:c.type});s.file(at,it)}).catch(et=>{console.error("Error downloading file:",et)});a.push(lt)}),Promise.all(a).then(()=>{s.generateAsync({type:"blob"}).then(c=>{const nt=new Date,at=`${nt.getFullYear()}-${("0"+(nt.getMonth()+1)).slice(-2)}-${("0"+nt.getDate()).slice(-2)}_${nt.getHours()}:${nt.getMinutes()}:${nt.getSeconds()}`.replace(/:/g,"-"),lt=`${o}_${at}.zip`,et=document.createElement("a");et.href=URL.createObjectURL(c),et.download=lt,et.click()}).catch(c=>{console.error("Error generating zip:",c)})})},getFileExtension=e=>{const o=e.split(".");return o[o.length-1]},loadingTextEffect=(e,o,s)=>{const a=e;let $="";const c=setInterval(()=>{$=$.length<3?$+".":"",o(`${a}${$}`)},s);return()=>clearInterval(c)},setLocalStorageValue=(e,o,s)=>{s(o),localStorage.setItem(e,o)},returnResourceIcon=e=>{const o=e.type;switch(!0){case o.includes("image"):return"/images/img_file.svg";case o==="application/pdf":return"/images/pdf_file.svg";case(o==="application/txt"||o==="text/plain"):return"/images/txt_file.svg";default:return"/images/default_file.svg"}},convertWaitingPeriod=e=>{let o=e,s="seconds";return o>=60&&o<3600?(o=Math.floor(o/60),s="minutes"):o>=3600&&o<86400?(o=Math.floor(o/3600),s="hours"):o>=86400&&o<604800?(o=Math.floor(o/86400),s="days"):o>=604800&&(o=Math.floor(o/604800),s="weeks"),o+" "+s};function openDatabase(){const e=indexedDB.open("MyFilesDB",1);return new Promise((o,s)=>{e.onerror=()=>s(e.error),e.onsuccess=()=>o(e.result),e.onupgradeneeded=a=>{const $=a.target.result;$.objectStoreNames.contains("files")||$.createObjectStore("files",{keyPath:"id"})}})}async function saveFile(e,o){return new Promise((s,a)=>{openDatabase().then($=>{const nt=$.transaction("files","readwrite").objectStore("files"),at=nt.get(o);at.onsuccess=()=>{if(at.result)$.close(),s(URL.createObjectURL(at.result.file));else{const lt=nt.put({id:o,file:e});lt.onerror=()=>{$.close(),a(lt.error)},lt.onsuccess=()=>{const et=URL.createObjectURL(e);$.close(),s(et)}}},at.onerror=()=>{$.close(),a(at.error)}}).catch($=>{a($)})})}function parseIdentifier(e){const o=e.split("_");if(o.length<3)return console.error("Invalid identifier: expected at least three parts"),null;const s=o.pop(),a=o.pop();return{filename:o.join("_"),filetype:a,filesize:s}}async function getLocalResourceURL(e,o){if(!e)return{url:null,file:null};const{filename:s,filetype:a,filesize:$}=parseIdentifier(e);var c=await getFileUrl(e,!1),nt=null;if(!c&&o){const lt=await fetchResources(o,s);if(lt){var at=await fetchMedia_indirect(lt);c=URL.createObjectURL(at);const it=s.toLowerCase().match(/\.(jpg|png|webp|jpeg)$/)?.[0].substring(1),st=it?`image/${it}`:at.type;nt=new File([at],s,{type:st}),await saveFile(nt,e)}}else nt=await getFileObject(e);return{url:c,file:nt}}async function fetchResources(e,o){try{const a=(await getTemplateResource(e,o)).data;return a&&a.length>0&&a.find(c=>c.name===o)||null}catch(s){return console.error("Error fetching resources:",s),null}}async function getFileUrl(e,o=!1){const s=await openDatabase(),$=s.transaction("files","readwrite").objectStore("files"),c=$.get(e);return new Promise((nt,at)=>{c.onerror=()=>{s.close(),at(c.error)},c.onsuccess=()=>{const lt=c.result?c.result.file:null;if(lt){const et=URL.createObjectURL(lt);if(o){const it=$.delete(e);it.onsuccess=()=>{s.close(),nt(null)},it.onerror=()=>{s.close(),at("Error deleting file from database")}}else s.close(),nt(et)}else s.close(),nt(null)}})}async function getFileObject(e,o=!1){const s=await openDatabase(),$=s.transaction("files","readwrite").objectStore("files"),c=$.get(e);return new Promise((nt,at)=>{c.onerror=()=>{s.close(),at(c.error)},c.onsuccess=()=>{const lt=c.result?c.result.file:null;if(lt)if(o){const et=$.delete(e);et.onsuccess=()=>{s.close(),nt(null)},et.onerror=()=>{s.close(),nt(null)}}else s.close(),nt(lt);else s.close(),nt(null)}})}async function uploadResource(e,o,s="INPUT"){const a=new FormData;return o.file instanceof Blob||(o.file=await getFileObject(`${o.name}_${o.type}_${o.size}`)),a.append("file",o.file),a.append("name",o.name),a.append("size",o.size),a.append("type",o.type),a.append("channel",s),await uploadFile_embed_comfy(e,a)}function MediaDisplay({url:e,type:o="",onMediaClick:s,style:a,content:$="",contentstyle:c=null,muted:nt=!1,controls:at=!0,autoplay:lt=!0,watermark:et=!1}){const[it,st]=reactExports.useState(!1);reactExports.useState(o);const ct=()=>{st(!0),document.body.style.cursor="zoom-in"},ft=()=>{st(!1),document.body.style.cursor="auto"},pt=wt=>{if(o==""){const vt=wt.split(".").pop();return["jpg","jpeg","png","gif","webp"].includes(vt)?"image/"+vt:["mp4","mov"].includes(vt)?"video/"+vt:["mp3","wav"].includes(vt)?"audio/"+vt:["json"].includes(vt)?"application/json":""}else return o};function gt(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[pt(e).startsWith("image/")&&jsxRuntimeExports.jsxs("div",{style:{position:"relative",maxHeight:"100%",height:"inherit"},children:[jsxRuntimeExports.jsx("img",{src:e,style:c||{maxWidth:"100%",width:"auto",maxHeight:"100%",height:"auto",marginTop:"1px",display:"block",marginLeft:"auto",marginRight:"auto",borderRadius:"8px"},onMouseEnter:ct,onMouseLeave:ft,onClick:s,alt:"加载中"}),et&&jsxRuntimeExports.jsx("img",{src:"/logo/hxb_logo1.png",style:{position:"absolute",bottom:"10px",right:"10px",width:"50%",height:"auto",opacity:.2,zIndex:1},alt:"水印"})]}),(pt(e).startsWith("video/")||e.includes("mp4"))&&jsxRuntimeExports.jsxs("div",{style:{position:"relative"},children:[jsxRuntimeExports.jsxs("video",{style:c||{maxWidth:"100%",width:"auto",maxHeight:"100%",height:"auto",marginTop:"1px",display:"block",marginLeft:"auto",marginRight:"auto",borderRadius:"8px"},muted:nt,controls:at,autoPlay:lt,playsInline:!0,loop:!0,onMouseEnter:ct,onMouseLeave:ft,onClick:s,alt:"加载中",children:[jsxRuntimeExports.jsx("source",{src:e,type:"video/mp4"}),"Your browser does not support the video tag."]}),et&&jsxRuntimeExports.jsx("img",{src:"/logo/hxb_logo1.png",style:{position:"absolute",bottom:"10px",right:"10px",width:"50%",height:"auto",opacity:.2,zIndex:1},alt:"水印"})]}),pt(e).startsWith("audio/")&&jsxRuntimeExports.jsxs("audio",{style:c||{maxWidth:"100%",width:"auto",maxHeight:"100%",height:"auto",marginTop:"1px",display:"block",marginLeft:"auto",marginRight:"auto",borderRadius:"8px"},muted:nt,controls:at,onMouseEnter:ct,onMouseLeave:ft,onClick:s,alt:"加载中",children:[jsxRuntimeExports.jsx("source",{src:e,type:"audio/mpeg"}),"Your browser does not support the audio tag."]}),pt(e).startsWith("application/json")&&jsxRuntimeExports.jsxs("div",{style:c||{maxWidth:"100%",width:"auto",maxHeight:"100%",height:"3rem",marginTop:"1px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"auto",marginRight:"auto",borderRadius:"8px",fontSize:"13px",flexDirection:"column"},onMouseEnter:ct,onMouseLeave:ft,onClick:s,children:[$," 工作流文件只有作者可以看得到, 用户不可见"]})]})}return jsxRuntimeExports.jsx("div",{style:a||{maxWidth:"100%",maxHeight:"100%",width:"inherit",height:"inherit"},children:gt()})}function ImageModal({imageUrl:e,closeModal:o}){const s=reactExports.useRef(null),a=reactExports.useRef(null),[$,c]=reactExports.useState(!1),[nt,at]=reactExports.useState(0),[lt,et]=reactExports.useState(0),[it,st]=reactExports.useState(0),[ct,ft]=reactExports.useState(0),[pt,gt]=reactExports.useState(1);reactExports.useEffect(()=>{const Lt=Ft=>{Ft.key==="Escape"&&o()};return document.addEventListener("keydown",Lt),()=>{document.removeEventListener("keydown",Lt)}},[o]);const wt=reactExports.useCallback(Lt=>{Lt.preventDefault(),c(!0),at(Lt.pageX),et(Lt.pageY),st(s.current.scrollLeft),ft(s.current.scrollTop),s.current.style.cursor="grabbing"},[]),vt=reactExports.useCallback(Lt=>{if(!$)return;Lt.preventDefault();const Ft=Lt.pageX,Jt=Lt.pageY,_r=(Ft-nt)*3,wr=(Jt-lt)*3;s.current.scrollLeft=it-_r,s.current.scrollTop=ct-wr},[$,nt,lt,it,ct]),_t=reactExports.useCallback(()=>{c(!1),s.current.style.cursor="grab"},[]),$t=reactExports.useCallback(()=>{$&&(c(!1),s.current.style.cursor="grab")},[$]),Pt=reactExports.useCallback(Lt=>{Lt.preventDefault()},[]),Nt=reactExports.useCallback(Lt=>{const Ft=pt+Lt.deltaY*-.01;gt(Math.min(Math.max(.5,Ft),3))},[pt]);return reactExports.useEffect(()=>{if(a.current){const Lt=a.current.naturalWidth,Ft=a.current.naturalHeight;a.current.style.width=`${Lt*pt}px`,a.current.style.height=`${Ft*pt}px`}},[pt]),reactExports.useEffect(()=>{Q.success("滚轮放大缩小,拖动上下观察,ESC健或者右上角X关闭",{autoClose:1800})},[]),jsxRuntimeExports.jsxs("div",{className:"modal_max_image",style:{overflow:"auto",position:"fixed",top:0,left:0},onWheel:Nt,children:[jsxRuntimeExports.jsx("button",{onClick:o,style:{position:"absolute",top:"10px",right:"10px",background:"red",border:"none",color:"white",fontSize:"30px",cursor:"pointer",outline:"none",zIndex:"2000"},children:"✕"}),jsxRuntimeExports.jsx("div",{className:"modal-content_max_image",ref:s,onMouseDown:wt,onMouseMove:vt,onMouseUp:_t,onMouseLeave:$t,style:{maxWidth:"100%",overflow:"auto",paddingTop:"40px"},children:jsxRuntimeExports.jsx("img",{src:e,ref:a,alt:"Original Picture",style:{display:"block",height:"auto",width:"auto"},onDragStart:Pt})})]})}async function fetchMedia_indirect(e){const o=api$1.get("accessToken"),s=`${baseUrl()}/resources/get/${e.id}`,a={Authorization:`Bearer ${o}`};try{return await(await fetch(s,{headers:a})).blob()}catch($){console.error("Error fetching image:",$)}}function handleImageScale(e){const s=e.width,a=e.height,$=s/a;let c,nt;s>a?(c=Math.min(s,2048),nt=c/$):(nt=Math.min(a,2048),c=nt*$);const at=c/s;return{width:Math.round(c),height:Math.round(nt),samScale:at}}function loadImage(e){return new Promise((o,s)=>{const a=new Image;a.onload=()=>o(a),a.onerror=s,a.src=e})}function resizeImage(e,o,s,a){const $={file:a,name:a.name,size:a.size,type:a.type};return new Promise((c,nt)=>{const at=document.createElement("canvas"),lt=at.getContext("2d");at.width=o,at.height=s,lt.drawImage(e,0,0,o,s),at.toBlob(et=>{const it=new File([et],$.name,{type:$.type,lastModified:Date.now()}),st={...$,file:it,size:it.size};c(st)},$.type)})}function generateUniqueFilename(e){const o=new Date,s=o.getFullYear()+("0"+(o.getMonth()+1)).slice(-2)+("0"+o.getDate()).slice(-2)+"_"+("0"+o.getHours()).slice(-2)+("0"+o.getMinutes()).slice(-2)+("0"+o.getSeconds()).slice(-2),a=v4().replace(/-/g,""),$=`${s}_${a}_`,c=e.split("/").pop();return`${$}${c}`}const fetchMediaURL=async e=>{const o=api$1.get("accessToken"),s=`${baseUrl()}/resources/getresourceurl/${e.id}`,a={Authorization:`Bearer ${o}`};try{const $=await fetch(s,{headers:a});if(!$.ok)throw new Error(`HTTP error! status: ${$.status}`);const c=await $.json();return console.log("Resource URL:",c.url),c.url}catch($){console.error("Error fetching media:",$)}},uploadParameterFiles=(e,o)=>{const s=e.map(a=>{if(a.type==="file"||a.type==="image_editer"||a.type==="combo_image_selection"&&a.value.file){const $=a.value;uploadResource(o,$,"INPUT").then(c=>(console.log("Upload successful:",c),Promise.resolve())).catch(c=>(console.error("Error uploading resource:",c),alert("不支持这个文件类型"+o),Promise.reject(c)))}else{if(a.type==="mask")return a.value.forEach(c=>{uploadResource(o,c,"INPUT").then(nt=>{console.log("Upload successful:",nt)}).catch(nt=>(console.error("Error uploading resource:",nt),alert("不支持这个文件类型 "+o),Promise.reject(nt)))}),Promise.resolve();if(a.type==="workflow"){const $=a.value;return uploadParameterFiles($,o),Promise.resolve()}else return Promise.resolve()}});Promise.all(s).then(()=>{console.info("success uploading files:")}).catch(a=>{console.error("Error uploading files:",a)})},uploadLogos=(e,o,s=!1)=>{const a=e.map($=>{if($.type=="file"){const c=$.value;return uploadResource(o,c,s?"PUBLIC":"LOGO_AGENT").catch(nt=>(console.error("Error uploading resource:",nt),alert("不支持这个文件类型"+o),Promise.reject(nt)))}else return Promise.resolve()});Promise.all(a).then(()=>{}).catch($=>{console.error("Error uploading files:",$)})},fetchAndSetImage=async e=>{const o=`resource_${e.id}`;let s=await getFileUrl(o);return s||(s=await fetchMediaURL(e)),s},fileDisplayAble=async e=>!!(e.type.startsWith("image/")||e.type.startsWith("video/")||e.type.startsWith("audio/")||e.type==="application/misc"&&["mp3","wav"].includes(getFileExtension(e.name))||e.type==="application/octet-stream"&&["png","jpg","jpeg","webp"].includes(getFileExtension(e.name))||e.type==="application/misc"&&e.name.toLowerCase().endsWith(".mp4")),transformNodesFromFile=async e=>new Promise((o,s)=>{let a=new FileReader;a.onload=function($){try{let c=JSON.parse($.target.result),nt=[],at=0,lt=0;for(let et in c)if(c.hasOwnProperty(et)&&c[et].class_type=="ComfyUIAppstoreParam"){let it=c[et];const st=[0,it.inputs&&it.inputs.序号,it.inputs&&it.inputs.参数名称,it.inputs&&it.inputs.类型,it.inputs&&it.inputs.数值约束或依赖项,it.inputs&&it.inputs.替换项];if(st){let ct=tranformNodes(st,it.inputs&&it.inputs.标注节点接入[0]);nt.push(ct),at+=1}}else c.hasOwnProperty(et)&&c[et].class_type=="ComfyUIAppstoreHost"?nt.push({name:"ComfyUIAppstoreHost",type:"host",accept:"host",value:c[et].inputs["ComfyUI 主机地址"]}):c.hasOwnProperty(et)&&c[et].class_type=="SaveImageWebsocket"&&(lt+=1);at<1?s(new Error("文件不符合要求,至少包括一个ComfyUIAppstoreParam节点")):(nt.sort((et,it)=>et.index-it.index),o(nt))}catch(c){s(c)}},a.onerror=function($){s($)},a.readAsText(e)}),tranformNodes=(e,o)=>{if(e){let s=e[1]||"",a=e[2]||"",$=e[3]||"",c=e[4]||"",nt=e[5]||"",at={index:s,name:a,type:$,accept:c,value:"",target:nt,key:o};return $==="combo_image_selection"?c==="模特"?at.options='[{"value":"/app/workspace/public/new_ref_models/男模特07.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E7%94%B7%E6%A8%A1%E7%89%B907.png"},{"value":"/app/workspace/public/new_ref_models/男模特06.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E7%94%B7%E6%A8%A1%E7%89%B906.png"},{"value":"/app/workspace/public/new_ref_models/男模特05.jpg","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E7%94%B7%E6%A8%A1%E7%89%B905.jpg"},{"value":"/app/workspace/public/new_ref_models/男模特04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E7%94%B7%E6%A8%A1%E7%89%B904.png"},{"value":"/app/workspace/public/new_ref_models/男模特03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E7%94%B7%E6%A8%A1%E7%89%B903.png"},{"value":"/app/workspace/public/new_ref_models/男模特02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E7%94%B7%E6%A8%A1%E7%89%B902.png"},{"value":"/app/workspace/public/new_ref_models/男模特01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E7%94%B7%E6%A8%A1%E7%89%B901.png"},{"value":"/app/workspace/public/new_ref_models/女模特14.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B914.png"},{"value":"/app/workspace/public/new_ref_models/女模特13.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B913.png"},{"value":"/app/workspace/public/new_ref_models/女模特12.jpg","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B912.jpg"},{"value":"/app/workspace/public/new_ref_models/女模特11.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B911.png"},{"value":"/app/workspace/public/new_ref_models/女模特10.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B910.png"},{"value":"/app/workspace/public/new_ref_models/女模特09.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B909.png"},{"value":"/app/workspace/public/new_ref_models/女模特08.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B908.png"},{"value":"/app/workspace/public/new_ref_models/女模特07.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B907.png"},{"value":"/app/workspace/public/new_ref_models/女模特06.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B906.png"},{"value":"/app/workspace/public/new_ref_models/女模特05.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B905.png"},{"value":"/app/workspace/public/new_ref_models/女模特04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B904.png"},{"value":"/app/workspace/public/new_ref_models/女模特03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B903.png"},{"value":"/app/workspace/public/new_ref_models/女模特02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B902.png"},{"value":"/app/workspace/public/new_ref_models/女模特01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%A5%B3%E6%A8%A1%E7%89%B901.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特10.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B910.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特09.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B909.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特08.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B908.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特07.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B907.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特06.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B906.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特05.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B905.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B904.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B903.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B902.png"},{"value":"/app/workspace/public/new_ref_models/儿童模特01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E5%84%BF%E7%AB%A5%E6%A8%A1%E7%89%B901.png"},{"value":"/app/workspace/public/new_ref_models/中老年模特05.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E4%B8%AD%E8%80%81%E5%B9%B4%E6%A8%A1%E7%89%B905.png"},{"value":"/app/workspace/public/new_ref_models/中老年模特04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E4%B8%AD%E8%80%81%E5%B9%B4%E6%A8%A1%E7%89%B904.png"},{"value":"/app/workspace/public/new_ref_models/中老年模特03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E4%B8%AD%E8%80%81%E5%B9%B4%E6%A8%A1%E7%89%B903.png"},{"value":"/app/workspace/public/new_ref_models/中老年模特02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E4%B8%AD%E8%80%81%E5%B9%B4%E6%A8%A1%E7%89%B902.png"},{"value":"/app/workspace/public/new_ref_models/中老年模特01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_models/%E4%B8%AD%E8%80%81%E5%B9%B4%E6%A8%A1%E7%89%B901.png"}]':c==="背景"?at.options='[{"value":"/app/workspace/public/new_ref_backgrounds/酒店大堂03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E9%85%92%E5%BA%97%E5%A4%A7%E5%A0%8203.png"},{"value":"/app/workspace/public/new_ref_backgrounds/酒店大堂02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E9%85%92%E5%BA%97%E5%A4%A7%E5%A0%8202.png"},{"value":"/app/workspace/public/new_ref_backgrounds/酒店大堂01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E9%85%92%E5%BA%97%E5%A4%A7%E5%A0%8201.png"},{"value":"/app/workspace/public/new_ref_backgrounds/街拍05.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E8%A1%97%E6%8B%8D05.png"},{"value":"/app/workspace/public/new_ref_backgrounds/街拍04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E8%A1%97%E6%8B%8D04.png"},{"value":"/app/workspace/public/new_ref_backgrounds/街拍03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E8%A1%97%E6%8B%8D03.png"},{"value":"/app/workspace/public/new_ref_backgrounds/街拍02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E8%A1%97%E6%8B%8D02.png"},{"value":"/app/workspace/public/new_ref_backgrounds/街拍01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E8%A1%97%E6%8B%8D01.png"},{"value":"/app/workspace/public/new_ref_backgrounds/草地01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E8%8D%89%E5%9C%B001.png"},{"value":"/app/workspace/public/new_ref_backgrounds/背景墙01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E8%83%8C%E6%99%AF%E5%A2%9901.png"},{"value":"/app/workspace/public/new_ref_backgrounds/纯色背景-白.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E7%BA%AF%E8%89%B2%E8%83%8C%E6%99%AF-%E7%99%BD.png"},{"value":"/app/workspace/public/new_ref_backgrounds/纯色背景-灰白.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E7%BA%AF%E8%89%B2%E8%83%8C%E6%99%AF-%E7%81%B0%E7%99%BD.png"},{"value":"/app/workspace/public/new_ref_backgrounds/纯色背景-灰.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E7%BA%AF%E8%89%B2%E8%83%8C%E6%99%AF-%E7%81%B0.png"},{"value":"/app/workspace/public/new_ref_backgrounds/秋天03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E7%A7%8B%E5%A4%A903.png"},{"value":"/app/workspace/public/new_ref_backgrounds/秋天02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E7%A7%8B%E5%A4%A902.png"},{"value":"/app/workspace/public/new_ref_backgrounds/秋天01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E7%A7%8B%E5%A4%A901.png"},{"value":"/app/workspace/public/new_ref_backgrounds/湖边02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B9%96%E8%BE%B902.png"},{"value":"/app/workspace/public/new_ref_backgrounds/湖边01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B9%96%E8%BE%B901.png"},{"value":"/app/workspace/public/new_ref_backgrounds/海边06.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B5%B7%E8%BE%B906.png"},{"value":"/app/workspace/public/new_ref_backgrounds/海边05.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B5%B7%E8%BE%B905.png"},{"value":"/app/workspace/public/new_ref_backgrounds/海边04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B5%B7%E8%BE%B904.png"},{"value":"/app/workspace/public/new_ref_backgrounds/海边03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B5%B7%E8%BE%B903.png"},{"value":"/app/workspace/public/new_ref_backgrounds/海边02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B5%B7%E8%BE%B902.png"},{"value":"/app/workspace/public/new_ref_backgrounds/海边01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E6%B5%B7%E8%BE%B901.png"},{"value":"/app/workspace/public/new_ref_backgrounds/庭院04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%BA%AD%E9%99%A204.png"},{"value":"/app/workspace/public/new_ref_backgrounds/庭院03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%BA%AD%E9%99%A203.png"},{"value":"/app/workspace/public/new_ref_backgrounds/庭院02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%BA%AD%E9%99%A202.png"},{"value":"/app/workspace/public/new_ref_backgrounds/庭院01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%BA%AD%E9%99%A201.png"},{"value":"/app/workspace/public/new_ref_backgrounds/室内背景墙02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%AE%A4%E5%86%85%E8%83%8C%E6%99%AF%E5%A2%9902.png"},{"value":"/app/workspace/public/new_ref_backgrounds/室内背景墙01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%AE%A4%E5%86%85%E8%83%8C%E6%99%AF%E5%A2%9901.png"},{"value":"/app/workspace/public/new_ref_backgrounds/室内03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%AE%A4%E5%86%8503.png"},{"value":"/app/workspace/public/new_ref_backgrounds/室内02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%AE%A4%E5%86%8502.png"},{"value":"/app/workspace/public/new_ref_backgrounds/室内01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%AE%A4%E5%86%8501.png"},{"value":"/app/workspace/public/new_ref_backgrounds/咖啡厅03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%92%96%E5%95%A1%E5%8E%8503.png"},{"value":"/app/workspace/public/new_ref_backgrounds/咖啡厅02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%92%96%E5%95%A1%E5%8E%8502.png"},{"value":"/app/workspace/public/new_ref_backgrounds/咖啡厅01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%92%96%E5%95%A1%E5%8E%8501.png"},{"value":"/app/workspace/public/new_ref_backgrounds/办公室02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%8A%9E%E5%85%AC%E5%AE%A402.png"},{"value":"/app/workspace/public/new_ref_backgrounds/办公室01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%8A%9E%E5%85%AC%E5%AE%A401.png"},{"value":"/app/workspace/public/new_ref_backgrounds/冬天03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%86%AC%E5%A4%A903.png"},{"value":"/app/workspace/public/new_ref_backgrounds/冬天02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%86%AC%E5%A4%A902.png"},{"value":"/app/workspace/public/new_ref_backgrounds/冬天01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%86%AC%E5%A4%A901.png"},{"value":"/app/workspace/public/new_ref_backgrounds/公园02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%AC%E5%9B%AD02.png"},{"value":"/app/workspace/public/new_ref_backgrounds/公园01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%AC%E5%9B%AD01.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景09.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF09.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景08.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF08.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景07.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF07.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景06.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF06.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景05.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF05.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景04.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF04.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景03.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF03.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景02.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF02.png"},{"value":"/app/workspace/public/new_ref_backgrounds/光影背景01.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/new_ref_backgrounds/%E5%85%89%E5%BD%B1%E8%83%8C%E6%99%AF01.png"}]':c==="近景"&&(at.options='[{"value":"/app/workspace/public/backgrounds/9.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/9.png"},{"value":"/app/workspace/public/backgrounds/8.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/8.png"},{"value":"/app/workspace/public/backgrounds/7.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/7.png"},{"value":"/app/workspace/public/backgrounds/6.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/6.png"},{"value":"/app/workspace/public/backgrounds/5.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/5.png"},{"value":"/app/workspace/public/backgrounds/4.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/4.png"},{"value":"/app/workspace/public/backgrounds/39.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/39.png"},{"value":"/app/workspace/public/backgrounds/38.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/38.png"},{"value":"/app/workspace/public/backgrounds/37.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/37.png"},{"value":"/app/workspace/public/backgrounds/36.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/36.png"},{"value":"/app/workspace/public/backgrounds/35.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/35.png"},{"value":"/app/workspace/public/backgrounds/34.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/34.png"},{"value":"/app/workspace/public/backgrounds/33.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/33.png"},{"value":"/app/workspace/public/backgrounds/32.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/32.png"},{"value":"/app/workspace/public/backgrounds/31.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/31.png"},{"value":"/app/workspace/public/backgrounds/30.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/30.png"},{"value":"/app/workspace/public/backgrounds/3.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/3.png"},{"value":"/app/workspace/public/backgrounds/29.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/29.png"},{"value":"/app/workspace/public/backgrounds/28.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/28.png"},{"value":"/app/workspace/public/backgrounds/27.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/27.png"},{"value":"/app/workspace/public/backgrounds/26.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/26.png"},{"value":"/app/workspace/public/backgrounds/25.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/25.png"},{"value":"/app/workspace/public/backgrounds/24.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/24.png"},{"value":"/app/workspace/public/backgrounds/23.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/23.png"},{"value":"/app/workspace/public/backgrounds/22.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/22.png"},{"value":"/app/workspace/public/backgrounds/21.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/21.png"},{"value":"/app/workspace/public/backgrounds/20.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/20.png"},{"value":"/app/workspace/public/backgrounds/2.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/2.png"},{"value":"/app/workspace/public/backgrounds/19.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/19.png"},{"value":"/app/workspace/public/backgrounds/18.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/18.png"},{"value":"/app/workspace/public/backgrounds/17.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/17.png"},{"value":"/app/workspace/public/backgrounds/16.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/16.png"},{"value":"/app/workspace/public/backgrounds/15.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/15.png"},{"value":"/app/workspace/public/backgrounds/14.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/14.png"},{"value":"/app/workspace/public/backgrounds/12.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/12.png"},{"value":"/app/workspace/public/backgrounds/11.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/11.png"},{"value":"/app/workspace/public/backgrounds/10.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/10.png"},{"value":"/app/workspace/public/backgrounds/1.png","option":"https://taoaibj.oss-rg-china-mainland.aliyuncs.com/resources/app/workspace/public/backgrounds/1.png"}]'):$==="selection"?at.options=c:$==="mask"?at.maskSourceUrl=c:$==="text"&&(at.default=c,at.value=c),at}else return null},container="_container_43fx0_1",title_box="_title_box_43fx0_7",title_text="_title_text_43fx0_14",wrapper="_wrapper_43fx0_24",agent_active="_agent_active_43fx0_29",text_block="_text_block_43fx0_36",form_label="_form_label_43fx0_45",item_title_area="_item_title_area_43fx0_55",form_label_text="_form_label_text_43fx0_68",form_label_con="_form_label_con_43fx0_78",form_label_red="_form_label_red_43fx0_98",page_title="_page_title_43fx0_106",tool_text="_tool_text_43fx0_118",detail_top="_detail_top_43fx0_127",detail_body="_detail_body_43fx0_136",detail_content="_detail_content_43fx0_142",detail_content_rightpanel="_detail_content_rightpanel_43fx0_151",tab_button="_tab_button_43fx0_162",tab_text="_tab_text_43fx0_178",run_history_button="_run_history_button_43fx0_190",run_button="_run_button_43fx0_201",pause_button="_pause_button_43fx0_219",history_box="_history_box_43fx0_235",agent_detailed_information="_agent_detailed_information_43fx0_248",notification_bubble="_notification_bubble_43fx0_264",history_info="_history_info_43fx0_277",feed_icon="_feed_icon_43fx0_288",custom_task_box="_custom_task_box_43fx0_295",console_icons="_console_icons_43fx0_307",maintainance="_maintainance_43fx0_311",detail_name="_detail_name_43fx0_322",separator="_separator_43fx0_331",agent_info_box="_agent_info_box_43fx0_337",agent_info_tools="_agent_info_tools_43fx0_344",resources="_resources_43fx0_351",agent_resources="_agent_resources_43fx0_357",large_text_box="_large_text_box_43fx0_362",show_more_button="_show_more_button_43fx0_367",single_line_block="_single_line_block_43fx0_374",three_dots="_three_dots_43fx0_381",more_details="_more_details_43fx0_388",more_details_wrapper="_more_details_wrapper_43fx0_394",task_header="_task_header_43fx0_401",text_12_n="_text_12_n_43fx0_409",notification_circle="_notification_circle_43fx0_422",delete_agent_modal_label="_delete_agent_modal_label_43fx0_441",delete_button="_delete_button_43fx0_451",delete_modal_text="_delete_modal_text_43fx0_469",rdtPicker="_rdtPicker_43fx0_479",permission_changes="_permission_changes_43fx0_518",modal_buttons="_modal_buttons_43fx0_524",modal_info_class="_modal_info_class_43fx0_530",table_contents="_table_contents_43fx0_535",create_settings_button="_create_settings_button_43fx0_544",button_margin="_button_margin_43fx0_551",dropdown_separator="_dropdown_separator_43fx0_555",dropdown_container_agent="_dropdown_container_agent_43fx0_561",dropdown_item_agent="_dropdown_item_agent_43fx0_575",image_selection_container="_image_selection_container_43fx0_581",image_option="_image_option_43fx0_591",image_selected="_image_selected_43fx0_603",combo_image_option="_combo_image_option_43fx0_626",combo_image_option_old="_combo_image_option_old_43fx0_646",imageContainer="_imageContainer_43fx0_685",overlay="_overlay_43fx0_689",image_list_container="_image_list_container_43fx0_719",button_container="_button_container_43fx0_728",more_button="_more_button_43fx0_735",inputMedium="_inputMedium_43fx0_765",nameInput="_nameInput_43fx0_774",dropzone="_dropzone_43fx0_781",previewContainer="_previewContainer_43fx0_791",fullWidthImage="_fullWidthImage_43fx0_797",closeButton="_closeButton_43fx0_803",modal="_modal_43fx0_524",close="_close_43fx0_803",myQuestTab="_myQuestTab_43fx0_869",downBth="_downBth_43fx0_881",picListBot="_picListBot_43fx0_894",compileCon="_compileCon_43fx0_899",stateInteraction="_stateInteraction_43fx0_907",styles={container,title_box,title_text,wrapper,agent_active,text_block,form_label,item_title_area,form_label_text,form_label_con,form_label_red,page_title,tool_text,detail_top,detail_body,detail_content,detail_content_rightpanel,tab_button,tab_text,run_history_button,run_button,pause_button,history_box,agent_detailed_information,notification_bubble,history_info,feed_icon,custom_task_box,console_icons,maintainance,detail_name,separator,agent_info_box,agent_info_tools,resources,agent_resources,large_text_box,show_more_button,single_line_block,three_dots,more_details,more_details_wrapper,task_header,text_12_n,notification_circle,delete_agent_modal_label,delete_button,delete_modal_text,rdtPicker,permission_changes,modal_buttons,modal_info_class,table_contents,create_settings_button,button_margin,dropdown_separator,dropdown_container_agent,dropdown_item_agent,image_selection_container,image_option,image_selected,combo_image_option,combo_image_option_old,imageContainer,overlay,image_list_container,button_container,more_button,inputMedium,nameInput,dropzone,previewContainer,fullWidthImage,closeButton,"media-container":"_media-container_43fx0_816",modal,"modal-content":"_modal-content_43fx0_843",close,myQuestTab,downBth,picListBot,compileCon,stateInteraction};function FileUpload({index:e,param:o,handleInputChange:s,previewUrl:a,visible:$=!0,verbose:c=!0}){api$1.get("userType");const[nt,at]=reactExports.useState(!1),[lt,et]=reactExports.useState(!0),it=reactExports.useRef(null),st=reactExports.useRef(null),ct=vt=>{vt.preventDefault(),at(!0)},ft=vt=>{vt.preventDefault(),at(!1)},pt=vt=>{vt.preventDefault()},gt=vt=>{if(vt.stopPropagation(),lt){alert("请稍等加载中");return}vt.preventDefault(),at(!1);const _t=vt.dataTransfer.files[0];if(_t){const $t=o.accept.split(","),Pt=_t.name.split(".").pop().toLowerCase();if($t==""||$t.includes(`.${Pt}`)){const Nt={target:{name:o.name,files:[_t]}};s(e,Nt)}else alert("文件类型暂不支持,请上传如下类型文件:"+o.accept)}},wt=vt=>{vt.preventDefault(),vt.target.files[0]&&s(e,vt)};return reactExports.useEffect(()=>{o.type=="file"&&o.value&&!a?et(!0):et(!1)},[a]),jsxRuntimeExports.jsxs("div",{className:`my-file-drop-area ${nt?"dragging":""}`,onDragEnter:ct,onDragLeave:ft,onDragOver:pt,onDrop:gt,onClick:()=>{it.current.click()},style:{position:"relative",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",background:"none"},children:[jsxRuntimeExports.jsx("input",{type:"file",ref:it,style:{display:"none"},name:o.name,accept:o.accept,onChange:vt=>{wt(vt)}}),a?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:$&&jsxRuntimeExports.jsxs("div",{style:{width:"80%",height:"100%",objectFit:"contain",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},ref:st,children:[jsxRuntimeExports.jsx(MediaDisplay,{url:a,content:o.value?.name?o.value.name:"",type:o.value?.type?o.value.type:"image",alt:"Preview"}),jsxRuntimeExports.jsx("button",{type:"button",className:"cancel",onClick:vt=>{vt.stopPropagation(),it.current.value="",s(e,null)},style:{position:"absolute",top:"0px",right:"10px",padding:"2px",fontSize:"10px",borderRadius:"5%",border:"none",cursor:"pointer"},children:"X"})]})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lt?jsxRuntimeExports.jsxs("p",{style:{textAlign:"center",margin:0,fontSize:"12px"},children:[jsxRuntimeExports.jsx("img",{className:"mix_blend_mode mr_7",loading:"lazy",width:14,height:14,src:`${WEB_SITE}/images/loading.gif`,alt:"loading-icon"}),"加载中,稍等。或者点击上传新的图像"]}):jsxRuntimeExports.jsx("p",{style:{textAlign:"center",margin:0,fontSize:"12px"},children:window.innerWidth>1e3?"点击上传, 或者拖入文件:"+(o.accept?o.accept:".json"):c?"点击上传, 或者拖入文件":"+"})})]})}const ImageList=({optionsObject:e,param:o,handleImageSelect:s,paramIndex:a})=>{const[$,c]=reactExports.useState(20),nt=10,at=2,lt=()=>{c(ct=>ct+nt*at)},et=()=>{c(20)},it=e.length>$,st=$>nt*at;return jsxRuntimeExports.jsxs("div",{className:styles.image_list_container,children:[jsxRuntimeExports.jsx("div",{className:styles.image_selection_container,children:e.slice(0,$).map((ct,ft)=>jsxRuntimeExports.jsx("div",{className:styles.image_option,children:jsxRuntimeExports.jsx("img",{src:ct.option,alt:ct.value,onClick:()=>s(a,ct.value),className:o.value===ct.value?styles.image_selected:""})},ft))}),jsxRuntimeExports.jsx("div",{className:styles.image_selection_container,children:jsxRuntimeExports.jsx("br",{})}),jsxRuntimeExports.jsxs("div",{className:styles.button_container,children:[it&&jsxRuntimeExports.jsx("div",{className:styles.more_button,onClick:lt,children:"更多"}),st&&jsxRuntimeExports.jsx("div",{className:styles.more_button,onClick:et,children:"收回"})]})]})},ComboImageList=({optionsObject:e,param:o,paramIndex:s,handleImageSelect:a,handleInputChange:$,uploadPreviewUrl:c})=>{const nt=reactExports.useRef(0),at=4,[lt,et]=reactExports.useState(nt.current*at),[it,st]=reactExports.useState(o.type=="file"),ct=reactExports.useRef(null);reactExports.useRef(!0);const[ft,pt]=reactExports.useState(JSON.parse(e)),gt=reactExports.useRef(null);reactExports.useEffect(()=>{gt&&gt.current&&(nt.current=Math.floor(window.innerWidth>1e3?(gt.current.clientWidth-5)/85:(gt.current.clientWidth-5)/55),et(nt.current*at))},[gt.current]);const wt=()=>{et(Nt=>Nt+nt.current*at)},vt=()=>{et(nt.current*at)},_t=e.length>lt,$t=lt>nt.current*at,Pt=(Nt,Lt)=>{Lt?st(!0):(st(!1),ct.current&&ct.current.click()),$(Nt,Lt)};return reactExports.useEffect(()=>{o&&o.type=="file"&&setfilevalue(o.value)},[o]),jsxRuntimeExports.jsxs("div",{className:styles.image_list_container,ref:gt,children:[jsxRuntimeExports.jsxs("div",{className:styles.image_selection_container,children:[jsxRuntimeExports.jsx("div",{className:styles.combo_image_option,style:{borderColor:it?"#4CAF50":"",border:it?"6px solid #bf0f78":""},children:jsxRuntimeExports.jsx(FileUpload,{index:s,param:o,handleInputChange:Pt,previewUrl:c,verbose:!1})},-1),ft.slice(0,lt-1).map((Nt,Lt)=>jsxRuntimeExports.jsx("div",{className:styles.combo_image_option,children:jsxRuntimeExports.jsxs("div",{className:styles.imageContainer,onClick:()=>{st(!1),a(s,Nt.value)},children:[jsxRuntimeExports.jsx("img",{src:Nt.option+"?x-oss-process=image/resize,w_100/quality,q_60",alt:Nt.value,ref:Lt===0?ct:null,className:o.value===Nt.value?styles.image_selected:""}),jsxRuntimeExports.jsx("div",{className:styles.overlay,style:{overflow:"hidden"},children:jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("span",{style:{fontSize:"8px",opacity:"100%",color:"#ffffff"},children:Nt.value.split("/").pop().split(".")[0]})})})]})},Lt))]}),jsxRuntimeExports.jsx("div",{className:styles.image_selection_container,children:jsxRuntimeExports.jsx("br",{})}),jsxRuntimeExports.jsxs("div",{className:styles.button_container,children:[_t&&jsxRuntimeExports.jsx("div",{className:styles.more_button,onClick:wt,children:"更多"}),$t&&jsxRuntimeExports.jsx("div",{className:styles.more_button,onClick:vt,children:"收回"})]})]})};/*!
* ONNX Runtime Web v1.20.0
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/var Hd=Object.create,an=Object.defineProperty,qd=Object.getOwnPropertyDescriptor,jd=Object.getOwnPropertyNames,Xd=Object.getPrototypeOf,Kd=Object.prototype.hasOwnProperty,Co=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,s)=>(typeof require<"u"?require:o)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),O=(e,o)=>()=>(e&&(o=e(e=0)),o),mt=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),Or=(e,o)=>{for(var s in o)an(e,s,{get:o[s],enumerable:!0})},Qa=(e,o,s,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let $ of jd(o))!Kd.call(e,$)&&$!==s&&an(e,$,{get:()=>o[$],enumerable:!(a=qd(o,$))||a.enumerable});return e},rr=(e,o,s)=>(s=e!=null?Hd(Xd(e)):{},Qa(!e||!e.__esModule?an(s,"default",{value:e,enumerable:!0}):s,e)),sn=e=>Qa(an({},"__esModule",{value:!0}),e),un,ke,nr,Jd,ln,fn=O(()=>{un=new Map,ke=[],nr=(e,o,s)=>{if(o&&typeof o.init=="function"&&typeof o.createInferenceSessionHandler=="function"){let a=un.get(e);if(a===void 0)un.set(e,{backend:o,priority:s});else{if(a.priority>s)return;if(a.priority===s&&a.backend!==o)throw new Error(`cannot register backend "${e}" using priority ${s}`)}if(s>=0){let $=ke.indexOf(e);$!==-1&&ke.splice($,1);for(let c=0;c<ke.length;c++)if(un.get(ke[c]).priority<=s){ke.splice(c,0,e);return}ke.push(e)}return}throw new TypeError("not a valid backend")},Jd=async e=>{let o=un.get(e);if(!o)return"backend not found.";if(o.initialized)return o.backend;if(o.aborted)return o.error;{let s=!!o.initPromise;try{return s||(o.initPromise=o.backend.init(e)),await o.initPromise,o.initialized=!0,o.backend}catch(a){return s||(o.error=`${a}`,o.aborted=!0),o.error}finally{delete o.initPromise}}},ln=async e=>{let o=e.executionProviders||[],s=o.map(lt=>typeof lt=="string"?lt:lt.name),a=s.length===0?ke:s,$,c=[],nt=new Set;for(let lt of a){let et=await Jd(lt);typeof et=="string"?c.push({name:lt,err:et}):($||($=et),$===et&&nt.add(lt))}if(!$)throw new Error(`no available backend found. ERR: ${c.map(lt=>`[${lt.name}] ${lt.err}`).join(", ")}`);for(let{name:lt,err:et}of c)s.includes(lt)&&console.warn(`removing requested execution provider "${lt}" from session options because it is not available: ${et}`);let at=o.filter(lt=>nt.has(typeof lt=="string"?lt:lt.name));return[$,new Proxy(e,{get:(lt,et)=>et==="executionProviders"?at:Reflect.get(lt,et)})]}}),ts=O(()=>{fn()}),es,rs=O(()=>{es="1.20.0"}),ns,Gt,No=O(()=>{rs(),ns="warning",Gt={wasm:{},webgl:{},webgpu:{},versions:{common:es},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);ns=e}},get logLevel(){return ns}},Object.defineProperty(Gt,"logLevel",{enumerable:!0})}),z,os=O(()=>{No(),z=Gt}),is,as,ss=O(()=>{is=(e,o)=>{let s=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);s.width=e.dims[3],s.height=e.dims[2];let a=s.getContext("2d");if(a!=null){let $,c;o?.tensorLayout!==void 0&&o.tensorLayout==="NHWC"?($=e.dims[2],c=e.dims[3]):($=e.dims[3],c=e.dims[2]);let nt=o?.format!==void 0?o.format:"RGB",at=o?.norm,lt,et;at===void 0||at.mean===void 0?lt=[255,255,255,255]:typeof at.mean=="number"?lt=[at.mean,at.mean,at.mean,at.mean]:(lt=[at.mean[0],at.mean[1],at.mean[2],0],at.mean[3]!==void 0&&(lt[3]=at.mean[3])),at===void 0||at.bias===void 0?et=[0,0,0,0]:typeof at.bias=="number"?et=[at.bias,at.bias,at.bias,at.bias]:(et=[at.bias[0],at.bias[1],at.bias[2],0],at.bias[3]!==void 0&&(et[3]=at.bias[3]));let it=c*$,st=0,ct=it,ft=it*2,pt=-1;nt==="RGBA"?(st=0,ct=it,ft=it*2,pt=it*3):nt==="RGB"?(st=0,ct=it,ft=it*2):nt==="RBG"&&(st=0,ft=it,ct=it*2);for(let gt=0;gt<c;gt++)for(let wt=0;wt<$;wt++){let vt=(e.data[st++]-et[0])*lt[0],_t=(e.data[ct++]-et[1])*lt[1],$t=(e.data[ft++]-et[2])*lt[2],Pt=pt===-1?255:(e.data[pt++]-et[3])*lt[3];a.fillStyle="rgba("+vt+","+_t+","+$t+","+Pt+")",a.fillRect(wt,gt,1,1)}if("toDataURL"in s)return s.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},as=(e,o)=>{let s=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),a;if(s!=null){let $,c,nt;o?.tensorLayout!==void 0&&o.tensorLayout==="NHWC"?($=e.dims[2],c=e.dims[1],nt=e.dims[3]):($=e.dims[3],c=e.dims[2],nt=e.dims[1]);let at=o!==void 0&&o.format!==void 0?o.format:"RGB",lt=o?.norm,et,it;lt===void 0||lt.mean===void 0?et=[255,255,255,255]:typeof lt.mean=="number"?et=[lt.mean,lt.mean,lt.mean,lt.mean]:(et=[lt.mean[0],lt.mean[1],lt.mean[2],255],lt.mean[3]!==void 0&&(et[3]=lt.mean[3])),lt===void 0||lt.bias===void 0?it=[0,0,0,0]:typeof lt.bias=="number"?it=[lt.bias,lt.bias,lt.bias,lt.bias]:(it=[lt.bias[0],lt.bias[1],lt.bias[2],0],lt.bias[3]!==void 0&&(it[3]=lt.bias[3]));let st=c*$;if(o!==void 0&&(o.format!==void 0&&nt===4&&o.format!=="RGBA"||nt===3&&o.format!=="RGB"&&o.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let ct=4,ft=0,pt=1,gt=2,wt=3,vt=0,_t=st,$t=st*2,Pt=-1;at==="RGBA"?(vt=0,_t=st,$t=st*2,Pt=st*3):at==="RGB"?(vt=0,_t=st,$t=st*2):at==="RBG"&&(vt=0,$t=st,_t=st*2),a=s.createImageData($,c);for(let Nt=0;Nt<c*$;ft+=ct,pt+=ct,gt+=ct,wt+=ct,Nt++)a.data[ft]=(e.data[vt++]-it[0])*et[0],a.data[pt]=(e.data[_t++]-it[1])*et[1],a.data[gt]=(e.data[$t++]-it[2])*et[2],a.data[wt]=Pt===-1?255:(e.data[Pt++]-it[3])*et[3]}else throw new Error("Can not access image data");return a}}),Ro,us,ls,fs,cs,ps,ds=O(()=>{cn(),Ro=(e,o)=>{if(e===void 0)throw new Error("Image buffer must be defined");if(o.height===void 0||o.width===void 0)throw new Error("Image height and width must be defined");if(o.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:s,width:a}=o,$=o.norm??{mean:255,bias:0},c,nt;typeof $.mean=="number"?c=[$.mean,$.mean,$.mean,$.mean]:c=[$.mean[0],$.mean[1],$.mean[2],$.mean[3]??255],typeof $.bias=="number"?nt=[$.bias,$.bias,$.bias,$.bias]:nt=[$.bias[0],$.bias[1],$.bias[2],$.bias[3]??0];let at=o.format!==void 0?o.format:"RGBA",lt=o.tensorFormat!==void 0&&o.tensorFormat!==void 0?o.tensorFormat:"RGB",et=s*a,it=lt==="RGBA"?new Float32Array(et*4):new Float32Array(et*3),st=4,ct=0,ft=1,pt=2,gt=3,wt=0,vt=et,_t=et*2,$t=-1;at==="RGB"&&(st=3,ct=0,ft=1,pt=2,gt=-1),lt==="RGBA"?$t=et*3:lt==="RBG"?(wt=0,_t=et,vt=et*2):lt==="BGR"&&(_t=0,vt=et,wt=et*2);for(let Pt=0;Pt<et;Pt++,ct+=st,pt+=st,ft+=st,gt+=st)it[wt++]=(e[ct]+nt[0])/c[0],it[vt++]=(e[ft]+nt[1])/c[1],it[_t++]=(e[pt]+nt[2])/c[2],$t!==-1&&gt!==-1&&(it[$t++]=(e[gt]+nt[3])/c[3]);return lt==="RGBA"?new St("float32",it,[1,4,s,a]):new St("float32",it,[1,3,s,a])},us=async(e,o)=>{let s=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,a=typeof ImageData<"u"&&e instanceof ImageData,$=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,c=typeof e=="string",nt,at=o??{},lt=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},et=it=>typeof HTMLCanvasElement<"u"&&it instanceof HTMLCanvasElement||it instanceof OffscreenCanvas?it.getContext("2d"):null;if(s){let it=lt();it.width=e.width,it.height=e.height;let st=et(it);if(st!=null){let ct=e.height,ft=e.width;if(o!==void 0&&o.resizedHeight!==void 0&&o.resizedWidth!==void 0&&(ct=o.resizedHeight,ft=o.resizedWidth),o!==void 0){if(at=o,o.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");at.tensorFormat="RGBA",at.height=ct,at.width=ft}else at.tensorFormat="RGBA",at.height=ct,at.width=ft;st.drawImage(e,0,0),nt=st.getImageData(0,0,ft,ct).data}else throw new Error("Can not access image data")}else if(a){let it,st;if(o!==void 0&&o.resizedWidth!==void 0&&o.resizedHeight!==void 0?(it=o.resizedHeight,st=o.resizedWidth):(it=e.height,st=e.width),o!==void 0&&(at=o),at.format="RGBA",at.height=it,at.width=st,o!==void 0){let ct=lt();ct.width=st,ct.height=it;let ft=et(ct);if(ft!=null)ft.putImageData(e,0,0),nt=ft.getImageData(0,0,st,it).data;else throw new Error("Can not access image data")}else nt=e.data}else if($){if(o===void 0)throw new Error("Please provide image config with format for Imagebitmap");let it=lt();it.width=e.width,it.height=e.height;let st=et(it);if(st!=null){let ct=e.height,ft=e.width;return st.drawImage(e,0,0,ft,ct),nt=st.getImageData(0,0,ft,ct).data,at.height=ct,at.width=ft,Ro(nt,at)}else throw new Error("Can not access image data")}else{if(c)return new Promise((it,st)=>{let ct=lt(),ft=et(ct);if(!e||!ft)return st();let pt=new Image;pt.crossOrigin="Anonymous",pt.src=e,pt.onload=()=>{ct.width=pt.width,ct.height=pt.height,ft.drawImage(pt,0,0,ct.width,ct.height);let gt=ft.getImageData(0,0,ct.width,ct.height);at.height=ct.height,at.width=ct.width,it(Ro(gt.data,at))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(nt!==void 0)return Ro(nt,at);throw new Error("Input data provided is not supported - aborted tensor creation")},ls=(e,o)=>{let{width:s,height:a,download:$,dispose:c}=o,nt=[1,a,s,4];return new St({location:"texture",type:"float32",texture:e,dims:nt,download:$,dispose:c})},fs=(e,o)=>{let{dataType:s,dims:a,download:$,dispose:c}=o;return new St({location:"gpu-buffer",type:s??"float32",gpuBuffer:e,dims:a,download:$,dispose:c})},cs=(e,o)=>{let{dataType:s,dims:a,download:$,dispose:c}=o;return new St({location:"ml-tensor",type:s??"float32",mlTensor:e,dims:a,download:$,dispose:c})},ps=(e,o,s)=>new St({location:"cpu-pinned",type:e,data:o,dims:s??[o.length]})}),Be,Sr,hs,ms,bs=O(()=>{Be=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Sr=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),hs=!1,ms=()=>{if(!hs){hs=!0;let e=typeof BigInt64Array<"u"&&BigInt64Array.from,o=typeof BigUint64Array<"u"&&BigUint64Array.from,s=typeof Float16Array<"u"&&Float16Array.from;e&&(Be.set("int64",BigInt64Array),Sr.set(BigInt64Array,"int64")),o&&(Be.set("uint64",BigUint64Array),Sr.set(BigUint64Array,"uint64")),s?(Be.set("float16",Float16Array),Sr.set(Float16Array,"float16")):Be.set("float16",Uint16Array)}}}),gs,ys,xs=O(()=>{cn(),gs=e=>{let o=1;for(let s=0;s<e.length;s++){let a=e[s];if(typeof a!="number"||!Number.isSafeInteger(a))throw new TypeError(`dims[${s}] must be an integer, got: ${a}`);if(a<0)throw new RangeError(`dims[${s}] must be a non-negative integer, got: ${a}`);o*=a}return o},ys=(e,o)=>{switch(e.location){case"cpu":return new St(e.type,e.data,o);case"cpu-pinned":return new St({location:"cpu-pinned",data:e.data,type:e.type,dims:o});case"texture":return new St({location:"texture",texture:e.texture,type:e.type,dims:o});case"gpu-buffer":return new St({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:o});case"ml-tensor":return new St({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:o});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),St,cn=O(()=>{ss(),ds(),bs(),xs(),St=class{constructor(e,o,s){ms();let a,$;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,a=e.type,$=e.dims,e.location){case"cpu-pinned":{let nt=Be.get(a);if(!nt)throw new TypeError(`unsupported type "${a}" to create tensor from pinned buffer`);if(!(e.data instanceof nt))throw new TypeError(`buffer should be of type ${nt.name}`);this.cpuData=e.data;break}case"texture":{if(a!=="float32")throw new TypeError(`unsupported type "${a}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(a!=="float32"&&a!=="float16"&&a!=="int32"&&a!=="int64"&&a!=="uint32"&&a!=="uint8"&&a!=="bool"&&a!=="uint4"&&a!=="int4")throw new TypeError(`unsupported type "${a}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(a!=="float32"&&a!=="float16"&&a!=="int32"&&a!=="int64"&&a!=="uint32"&&a!=="uint64"&&a!=="int8"&&a!=="uint8"&&a!=="bool")throw new TypeError(`unsupported type "${a}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let nt,at;if(typeof e=="string")if(a=e,at=s,e==="string"){if(!Array.isArray(o))throw new TypeError("A string tensor's data must be a string array.");nt=o}else{let lt=Be.get(e);if(lt===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(o)){if(e==="float16"&&lt===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${lt.name} as data.`);e==="uint64"||e==="int64"?nt=lt.from(o,BigInt):nt=lt.from(o)}else if(o instanceof lt)nt=o;else if(o instanceof Uint8ClampedArray)if(e==="uint8")nt=Uint8Array.from(o);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else throw new TypeError(`A ${a} tensor's data must be type of ${lt}`)}else if(at=o,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let lt=typeof e[0];if(lt==="string")a="string",nt=e;else if(lt==="boolean")a="bool",nt=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${lt}.`)}else if(e instanceof Uint8ClampedArray)a="uint8",nt=Uint8Array.from(e);else{let lt=Sr.get(e.constructor);if(lt===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);a=lt,nt=e}if(at===void 0)at=[nt.length];else if(!Array.isArray(at))throw new TypeError("A tensor's dims must be a number array");$=at,this.cpuData=nt,this.dataLocation="cpu"}let c=gs($);if(this.cpuData&&c!==this.cpuData.length&&!((a==="uint4"||a==="int4")&&Math.ceil(c/2)===this.cpuData.length))throw new Error(`Tensor's size(${c}) does not match data length(${this.cpuData.length}).`);this.type=a,this.dims=$,this.size=c}static async fromImage(e,o){return us(e,o)}static fromTexture(e,o){return ls(e,o)}static fromGpuBuffer(e,o){return fs(e,o)}static fromMLTensor(e,o){return cs(e,o)}static fromPinnedBuffer(e,o,s){return ps(e,o,s)}toDataURL(e){return is(this,e)}toImageData(e){return as(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let o=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=o,e&&this.disposer&&(this.disposer(),this.disposer=void 0),o}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return ys(this,e)}}}),yt,pn=O(()=>{cn(),yt=St}),Ts,ws,Fe,Ce,Go=O(()=>{No(),Ts=(e,o)=>{(typeof Gt.trace>"u"?!Gt.wasm.trace:!Gt.trace)||console.timeStamp(`${e}::ORT::${o}`)},ws=(e,o)=>{let s=new Error().stack?.split(/\r\n|\r|\n/g)||[],a=!1;for(let $=0;$<s.length;$++){if(a&&!s[$].includes("TRACE_FUNC")){let c=`FUNC_${e}::${s[$].trim().split(" ")[1]}`;o&&(c+=`::${o}`),Ts("CPU",c);return}s[$].includes("TRACE_FUNC")&&(a=!0)}},Fe=e=>{(typeof Gt.trace>"u"?!Gt.wasm.trace:!Gt.trace)||ws("BEGIN",e)},Ce=e=>{(typeof Gt.trace>"u"?!Gt.wasm.trace:!Gt.trace)||ws("END",e)}}),dn,vs=O(()=>{fn(),pn(),Go(),dn=class Vy{constructor(o){this.handler=o}async run(o,s,a){Fe();let $={},c={};if(typeof o!="object"||o===null||o instanceof yt||Array.isArray(o))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let nt=!0;if(typeof s=="object"){if(s===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(s instanceof yt)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(s)){if(s.length===0)throw new TypeError("'fetches' cannot be an empty array.");nt=!1;for(let et of s){if(typeof et!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(et)===-1)throw new RangeError(`'fetches' contains invalid output name: ${et}.`);$[et]=null}if(typeof a=="object"&&a!==null)c=a;else if(typeof a<"u")throw new TypeError("'options' must be an object.")}else{let et=!1,it=Object.getOwnPropertyNames(s);for(let st of this.outputNames)if(it.indexOf(st)!==-1){let ct=s[st];(ct===null||ct instanceof yt)&&(et=!0,nt=!1,$[st]=ct)}if(et){if(typeof a=="object"&&a!==null)c=a;else if(typeof a<"u")throw new TypeError("'options' must be an object.")}else c=s}}else if(typeof s<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let et of this.inputNames)if(typeof o[et]>"u")throw new Error(`input '${et}' is missing in 'feeds'.`);if(nt)for(let et of this.outputNames)$[et]=null;let at=await this.handler.run(o,$,c),lt={};for(let et in at)if(Object.hasOwnProperty.call(at,et)){let it=at[et];it instanceof yt?lt[et]=it:lt[et]=new yt(it.type,it.data,it.dims)}return Ce(),lt}async release(){return this.handler.dispose()}static async create(o,s,a,$){Fe();let c,nt={};if(typeof o=="string"){if(c=o,typeof s=="object"&&s!==null)nt=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(o instanceof Uint8Array){if(c=o,typeof s=="object"&&s!==null)nt=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(o instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&o instanceof SharedArrayBuffer){let it=o,st=0,ct=o.byteLength;if(typeof s=="object"&&s!==null)nt=s;else if(typeof s=="number"){if(st=s,!Number.isSafeInteger(st))throw new RangeError("'byteOffset' must be an integer.");if(st<0||st>=it.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${it.byteLength}).`);if(ct=o.byteLength-st,typeof a=="number"){if(ct=a,!Number.isSafeInteger(ct))throw new RangeError("'byteLength' must be an integer.");if(ct<=0||st+ct>it.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${it.byteLength-st}].`);if(typeof $=="object"&&$!==null)nt=$;else if(typeof $<"u")throw new TypeError("'options' must be an object.")}else if(typeof a<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof s<"u")throw new TypeError("'options' must be an object.");c=new Uint8Array(it,st,ct)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[at,lt]=await ln(nt),et=await at.createInferenceSessionHandler(c,lt);return Ce(),new Vy(et)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}}),Yd,Is=O(()=>{vs(),Yd=dn}),_s=O(()=>{}),Os=O(()=>{}),Ss=O(()=>{}),As=O(()=>{}),Zd,hn,Ps=O(()=>{fn(),pn(),Zd="Training backend could not be resolved. Make sure you're using the correct configuration & WebAssembly files.",hn=class Wy{constructor(o,s,a){this.handler=o,this.hasOptimizerModel=s,this.hasEvalModel=a}get trainingInputNames(){return this.handler.inputNames}get trainingOutputNames(){return this.handler.outputNames}get evalInputNames(){if(this.hasEvalModel)return this.handler.evalInputNames;throw new Error("This training session has no evalModel loaded.")}get evalOutputNames(){if(this.hasEvalModel)return this.handler.evalOutputNames;throw new Error("This training session has no evalModel loaded.")}static async create(o,s){let a=o.evalModel||"",$=o.optimizerModel||"",c=s||{},[nt,at]=await ln(c);if(nt.createTrainingSessionHandler){let lt=await nt.createTrainingSessionHandler(o.checkpointState,o.trainModel,a,$,at);return new Wy(lt,!!o.optimizerModel,!!o.evalModel)}else throw new Error(Zd)}typeNarrowingForRunStep(o,s,a,$,c){let nt={},at={};if(typeof a!="object"||a===null||a instanceof yt||Array.isArray(a))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let lt=!0;if(typeof $=="object"){if($===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if($ instanceof yt)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray($)){if($.length===0)throw new TypeError("'fetches' cannot be an empty array.");lt=!1;for(let et of $){if(typeof et!="string")throw new TypeError("'fetches' must be a string array or an object.");if(s.indexOf(et)===-1)throw new RangeError(`'fetches' contains invalid output name: ${et}.`);nt[et]=null}if(typeof c=="object"&&c!==null)at=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else{let et=!1,it=Object.getOwnPropertyNames($);for(let st of s)if(it.indexOf(st)!==-1){let ct=$[st];(ct===null||ct instanceof yt)&&(et=!0,lt=!1,nt[st]=ct)}if(et){if(typeof c=="object"&&c!==null)at=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else at=$}}else if(typeof $<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let et of o)if(typeof a[et]>"u")throw new Error(`input '${et}' is missing in 'feeds'.`);if(lt)for(let et of s)nt[et]=null;return[nt,at]}convertHandlerReturnTypeToMapOfTensors(o){let s={};for(let a in o)if(Object.hasOwnProperty.call(o,a)){let $=o[a];$ instanceof yt?s[a]=$:s[a]=new yt($.type,$.data,$.dims)}return s}async lazyResetGrad(){await this.handler.lazyResetGrad()}async runTrainStep(o,s,a){let[$,c]=this.typeNarrowingForRunStep(this.trainingInputNames,this.trainingOutputNames,o,s,a),nt=await this.handler.runTrainStep(o,$,c);return this.convertHandlerReturnTypeToMapOfTensors(nt)}async runOptimizerStep(o){if(this.hasOptimizerModel)await this.handler.runOptimizerStep(o||{});else throw new Error("This TrainingSession has no OptimizerModel loaded.")}async runEvalStep(o,s,a){if(this.hasEvalModel){let[$,c]=this.typeNarrowingForRunStep(this.evalInputNames,this.evalOutputNames,o,s,a),nt=await this.handler.runEvalStep(o,$,c);return this.convertHandlerReturnTypeToMapOfTensors(nt)}else throw new Error("This TrainingSession has no EvalModel loaded.")}async getParametersSize(o=!0){return this.handler.getParametersSize(o)}async loadParametersBuffer(o,s=!0){let a=await this.getParametersSize(s);if(o.length!==4*a)throw new Error("Size of the buffer passed into loadParametersBuffer must match the number of parameters in the model. Please use getParametersSize method to check.");return this.handler.loadParametersBuffer(o,s)}async getContiguousParameters(o=!0){return this.handler.getContiguousParameters(o)}async release(){return this.handler.dispose()}}}),Qd,Es=O(()=>{Ps(),Qd=hn}),Mo={};Or(Mo,{InferenceSession:()=>Yd,TRACE:()=>Ts,TRACE_FUNC_BEGIN:()=>Fe,TRACE_FUNC_END:()=>Ce,Tensor:()=>yt,TrainingSession:()=>Qd,env:()=>z,registerBackend:()=>nr});var Yt=O(()=>{ts(),os(),Is(),pn(),_s(),Os(),Go(),Ss(),As(),Es()});function _e(e,o,s,a){if(o===void 0)return eh(e);if(s===void 0)mn(e,o);else if(typeof s=="number"&&a===void 0)mn(e,o);else if(typeof s=="string"&&a===void 0)mn(e,s,1,o);else if(typeof s=="string"&&typeof a=="number")mn(e,s,a,o);else throw new TypeError("input is valid")}function eh(e){return{verbose:_e.verbose.bind(null,e),info:_e.info.bind(null,e),warning:_e.warning.bind(null,e),error:_e.error.bind(null,e),fatal:_e.fatal.bind(null,e)}}function mn(e,o,s,a){let $=Ar[a||""]||Ar[""];Ls[e]<Ls[$.minimalSeverity]||($.logDateTime&&(o=`${new Date().toISOString()}|${o}`),$.logSourceLocation,th[$.provider].log(e,o,a))}var Uo,Vo,Ls,th,$s,Ar,tt,gn,yn,xn,bn,Ut=O(()=>{Uo=class{log(e,o,s){}},Vo=class{log(e,o,s){console.log(`${this.color(e)} ${s?"\x1B[35m"+s+"\x1B[0m ":""}${o}`)}color(e){switch(e){case"verbose":return"\x1B[34;40mv\x1B[0m";case"info":return"\x1B[32mi\x1B[0m";case"warning":return"\x1B[30;43mw\x1B[0m";case"error":return"\x1B[31;40me\x1B[0m";case"fatal":return"\x1B[101mf\x1B[0m";default:throw new Error(`unsupported severity: ${e}`)}}},Ls={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},th={none:new Uo,console:new Vo},$s={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1},Ar={"":$s},(e=>{function o(et,it){e("verbose",et,it)}e.verbose=o;function s(et,it){e("info",et,it)}e.info=s;function a(et,it){e("warning",et,it)}e.warning=a;function $(et,it){e("error",et,it)}e.error=$;function c(et,it){e("fatal",et,it)}e.fatal=c;function nt(et){Ar={},at("",et||{})}e.reset=nt;function at(et,it){if(et==="*")nt(it);else{let st=Ar[et]||$s;Ar[et]={provider:it.provider||st.provider,minimalSeverity:it.minimalSeverity||st.minimalSeverity,logDateTime:it.logDateTime===void 0?st.logDateTime:it.logDateTime,logSourceLocation:it.logSourceLocation===void 0?st.logSourceLocation:it.logSourceLocation}}}e.set=at;function lt(et){let it={};et.logLevel&&(it.minimalSeverity=et.logLevel),at("",it)}e.setWithEnv=lt})(_e||={}),tt=_e,gn=class{constructor(e,o,s,a,$,c){this.category=e,this.name=o,this.startTime=s,this.endCallback=a,this.timer=$,this.ctx=c}async end(){return this.endCallback(this)}async checkTimer(){if(this.ctx===void 0||this.timer===void 0)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}},yn=class{constructor(e,o,s,a){this.category=e,this.name=o,this.startTime=s,this.endTime=a}},xn=class{constructor(e,o,s){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=e===void 0?1e4:e,this._flushBatchSize=o===void 0?10:o,this._flushIntervalInMilliseconds=s===void 0?5e3:s}static create(e){return e===void 0?new this:new this(e.maxNumberEvents,e.flushBatchSize,e.flushIntervalInMilliseconds)}start(){this._started=!0,this._timingEvents=[],this._flushTime=bn(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(e,o,s,a){let $=this._started?this.begin(e,o,a):void 0,c=!1,nt=s();if(nt&&typeof nt.then=="function")return c=!0,new Promise((at,lt)=>{nt.then(async et=>{$&&await $.end(),at(et)},async et=>{$&&await $.end(),lt(et)})});if(!c&&$){let at=$.end();if(at&&typeof at.then=="function")return new Promise((lt,et)=>{at.then(()=>{lt(nt)},it=>{et(it)})})}return nt}begin(e,o,s){if(!this._started)throw new Error("profiler is not started yet");if(s===void 0){let a=bn();return this.flush(a),new gn(e,o,a,$=>this.endSync($))}else{let a=s.beginTimer();return new gn(e,o,0,async $=>this.end($),a,s)}}async end(e){let o=await e.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new yn(e.category,e.name,e.startTime,o)),this.flush(o))}endSync(e){let o=bn();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new yn(e.category,e.name,e.startTime,o)),this.flush(o))}logOneEvent(e){tt.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(let o=this._flushPointer;this._flushPointer<o+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=bn()}}get started(){return this._started}},bn=typeof performance<"u"&&performance.now?()=>performance.now():Date.now});function ks(e,o,s){for(let a of s){let $=a[0],c=a[1],nt=a[2],at=a[3],lt=a[4];if(e.opType===$){for(let et of o)if((et.domain===c||et.domain==="ai.onnx"&&c==="")&&rh(et.version,nt))return{opImpl:at,opInit:lt}}}throw new TypeError(`cannot resolve operator '${e.opType}' with opsets: ${o.map(a=>`${a.domain||"ai.onnx"} v${a.version}`).join(", ")}`)}function rh(e,o){if(o.endsWith("+")){let s=Number.parseInt(o.substring(0,o.length-1),10);return!isNaN(s)&&s<=e}else if(o.split("-").length===2){let s=o.split("-"),a=Number.parseInt(s[0],10),$=Number.parseInt(s[1],10);return!isNaN(a)&&!isNaN($)&&a<=e&&e<=$}else return Number.parseInt(o,10)===e}var Bs=O(()=>{}),Fs=mt(e=>{e.__esModule=!0;var o=function(){function s(a){if(!a)throw new TypeError("Invalid argument; `value` has no value.");this.value=s.EMPTY,a&&s.isGuid(a)&&(this.value=a)}return s.isGuid=function(a){var $=a.toString();return a&&(a instanceof s||s.validator.test($))},s.create=function(){return new s([s.gen(2),s.gen(1),s.gen(1),s.gen(1),s.gen(3)].join("-"))},s.createEmpty=function(){return new s("emptyguid")},s.parse=function(a){return new s(a)},s.raw=function(){return[s.gen(2),s.gen(1),s.gen(1),s.gen(1),s.gen(3)].join("-")},s.gen=function(a){for(var $="",c=0;c<a;c++)$+=((1+Math.random())*65536|0).toString(16).substring(1);return $},s.prototype.equals=function(a){return s.isGuid(a)&&this.value===a.toString()},s.prototype.isEmpty=function(){return this.value===s.EMPTY},s.prototype.toString=function(){return this.value},s.prototype.toJSON=function(){return{value:this.value}},s.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),s.EMPTY="00000000-0000-0000-0000-000000000000",s}();e.Guid=o});function rt(e,o,s){this.low=e|0,this.high=o|0,this.unsigned=!!s}function Et(e){return(e&&e.__isLong__)===!0}function Cs(e){var o=Math.clz32(e&-e);return e?31-o:o}function Ne(e,o){var s,a,$;return o?(e>>>=0,($=0<=e&&e<256)&&(a=Rs[e],a)?a:(s=J(e,0,!0),$&&(Rs[e]=s),s)):(e|=0,($=-128<=e&&e<128)&&(a=Ns[e],a)?a:(s=J(e,e<0?-1:0,!1),$&&(Ns[e]=s),s))}function zt(e,o){if(isNaN(e))return o?ye:Zt;if(o){if(e<0)return ye;if(e>=Vs)return Hs}else{if(e<=-Ms)return Ct;if(e+1>=Ms)return Ws}return e<0?zt(-e,o).neg():J(e%ir|0,e/ir|0,o)}function J(e,o,s){return new rt(e,o,s)}function Ho(e,o,s){if(e.length===0)throw Error("empty string");if(typeof o=="number"?(s=o,o=!1):o=!!o,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return o?ye:Zt;if(s=s||10,s<2||36<s)throw RangeError("radix");var a;if((a=e.indexOf("-"))>0)throw Error("interior hyphen");if(a===0)return Ho(e.substring(1),o,s).neg();for(var $=zt(Tn(s,8)),c=Zt,nt=0;nt<e.length;nt+=8){var at=Math.min(8,e.length-nt),lt=parseInt(e.substring(nt,nt+at),s);if(at<8){var et=zt(Tn(s,at));c=c.mul(et).add(zt(lt))}else c=c.mul($),c=c.add(zt(lt))}return c.unsigned=o,c}function Qt(e,o){return typeof e=="number"?zt(e,o):typeof e=="string"?Ho(e,o):J(e.low,e.high,typeof o=="boolean"?o:e.unsigned)}var Vt,Ns,Rs,Tn,Gs,oh,ir,Vs,Ms,Us,Zt,ye,or,zs,Wo,Ws,Hs,Ct,D,xe,qo=O(()=>{Vt=null;try{Vt=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{}rt.prototype.__isLong__,Object.defineProperty(rt.prototype,"__isLong__",{value:!0}),rt.isLong=Et,Ns={},Rs={},rt.fromInt=Ne,rt.fromNumber=zt,rt.fromBits=J,Tn=Math.pow,rt.fromString=Ho,rt.fromValue=Qt,Gs=65536,oh=1<<24,ir=Gs*Gs,Vs=ir*ir,Ms=Vs/2,Us=Ne(oh),Zt=Ne(0),rt.ZERO=Zt,ye=Ne(0,!0),rt.UZERO=ye,or=Ne(1),rt.ONE=or,zs=Ne(1,!0),rt.UONE=zs,Wo=Ne(-1),rt.NEG_ONE=Wo,Ws=J(-1,2147483647,!1),rt.MAX_VALUE=Ws,Hs=J(-1,-1,!0),rt.MAX_UNSIGNED_VALUE=Hs,Ct=J(0,-2147483648,!1),rt.MIN_VALUE=Ct,D=rt.prototype,D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*ir+(this.low>>>0):this.high*ir+(this.low>>>0)},D.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ct)){var o=zt(e),s=this.div(o),a=s.mul(o).sub(this);return s.toString(e)+a.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var $=zt(Tn(e,6),this.unsigned),c=this,nt="";;){var at=c.div($),lt=c.sub(at.mul($)).toInt()>>>0,et=lt.toString(e);if(c=at,c.isZero())return et+nt;for(;et.length<6;)et="0"+et;nt=""+et+nt}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ct)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,o=31;o>0&&!(e&1<<o);o--);return this.high!=0?o+33:o+1},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)===1},D.isEven=function(){return(this.low&1)===0},D.equals=function(e){return Et(e)||(e=Qt(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(Et(e)||(e=Qt(e)),this.eq(e))return 0;var o=this.isNegative(),s=e.isNegative();return o&&!s?-1:!o&&s?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},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(Ct)?Ct:this.not().add(or)},D.neg=D.negate,D.add=function(e){Et(e)||(e=Qt(e));var o=this.high>>>16,s=this.high&65535,a=this.low>>>16,$=this.low&65535,c=e.high>>>16,nt=e.high&65535,at=e.low>>>16,lt=e.low&65535,et=0,it=0,st=0,ct=0;return ct+=$+lt,st+=ct>>>16,ct&=65535,st+=a+at,it+=st>>>16,st&=65535,it+=s+nt,et+=it>>>16,it&=65535,et+=o+c,et&=65535,J(st<<16|ct,et<<16|it,this.unsigned)},D.subtract=function(e){return Et(e)||(e=Qt(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return this;if(Et(e)||(e=Qt(e)),Vt){var o=Vt.mul(this.low,this.high,e.low,e.high);return J(o,Vt.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?ye:Zt;if(this.eq(Ct))return e.isOdd()?Ct:Zt;if(e.eq(Ct))return this.isOdd()?Ct:Zt;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(Us)&&e.lt(Us))return zt(this.toNumber()*e.toNumber(),this.unsigned);var s=this.high>>>16,a=this.high&65535,$=this.low>>>16,c=this.low&65535,nt=e.high>>>16,at=e.high&65535,lt=e.low>>>16,et=e.low&65535,it=0,st=0,ct=0,ft=0;return ft+=c*et,ct+=ft>>>16,ft&=65535,ct+=$*et,st+=ct>>>16,ct&=65535,ct+=c*lt,st+=ct>>>16,ct&=65535,st+=a*et,it+=st>>>16,st&=65535,st+=$*lt,it+=st>>>16,st&=65535,st+=c*at,it+=st>>>16,st&=65535,it+=s*et+a*lt+$*at+c*nt,it&=65535,J(ct<<16|ft,it<<16|st,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(Et(e)||(e=Qt(e)),e.isZero())throw Error("division by zero");if(Vt){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var o=(this.unsigned?Vt.div_u:Vt.div_s)(this.low,this.high,e.low,e.high);return J(o,Vt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?ye:Zt;var s,a,$;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return ye;if(e.gt(this.shru(1)))return zs;$=ye}else{if(this.eq(Ct)){if(e.eq(or)||e.eq(Wo))return Ct;if(e.eq(Ct))return or;var c=this.shr(1);return s=c.div(e).shl(1),s.eq(Zt)?e.isNegative()?or:Wo:(a=this.sub(e.mul(s)),$=s.add(a.div(e)),$)}else if(e.eq(Ct))return this.unsigned?ye:Zt;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();$=Zt}for(a=this;a.gte(e);){s=Math.max(1,Math.floor(a.toNumber()/e.toNumber()));for(var nt=Math.ceil(Math.log(s)/Math.LN2),at=nt<=48?1:Tn(2,nt-48),lt=zt(s),et=lt.mul(e);et.isNegative()||et.gt(a);)s-=at,lt=zt(s,this.unsigned),et=lt.mul(e);lt.isZero()&&(lt=or),$=$.add(lt),a=a.sub(et)}return $},D.div=D.divide,D.modulo=function(e){if(Et(e)||(e=Qt(e)),Vt){var o=(this.unsigned?Vt.rem_u:Vt.rem_s)(this.low,this.high,e.low,e.high);return J(o,Vt.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return J(~this.low,~this.high,this.unsigned)},D.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},D.clz=D.countLeadingZeros,D.countTrailingZeros=function(){return this.low?Cs(this.low):Cs(this.high)+32},D.ctz=D.countTrailingZeros,D.and=function(e){return Et(e)||(e=Qt(e)),J(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return Et(e)||(e=Qt(e)),J(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return Et(e)||(e=Qt(e)),J(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return Et(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?J(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):J(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return Et(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?J(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):J(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){return Et(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?J(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?J(this.high,0,this.unsigned):J(this.high>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.rotateLeft=function(e){var o;return Et(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?J(this.high,this.low,this.unsigned):e<32?(o=32-e,J(this.low<<e|this.high>>>o,this.high<<e|this.low>>>o,this.unsigned)):(e-=32,o=32-e,J(this.high<<e|this.low>>>o,this.low<<e|this.high>>>o,this.unsigned))},D.rotl=D.rotateLeft,D.rotateRight=function(e){var o;return Et(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?J(this.high,this.low,this.unsigned):e<32?(o=32-e,J(this.high<<o|this.low>>>e,this.low<<o|this.high>>>e,this.unsigned)):(e-=32,o=32-e,J(this.low<<o|this.high>>>e,this.high<<o|this.low>>>e,this.unsigned))},D.rotr=D.rotateRight,D.toSigned=function(){return this.unsigned?J(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:J(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,o=this.low;return[o&255,o>>>8&255,o>>>16&255,o>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,o=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,o>>>24,o>>>16&255,o>>>8&255,o&255]},rt.fromBytes=function(e,o,s){return s?rt.fromBytesLE(e,o):rt.fromBytesBE(e,o)},rt.fromBytesLE=function(e,o){return new rt(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,o)},rt.fromBytesBE=function(e,o){return new rt(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],o)},xe=rt}),w,wn=O(()=>{w={},w.Offset,w.Table,w.SIZEOF_SHORT=2,w.SIZEOF_INT=4,w.FILE_IDENTIFIER_LENGTH=4,w.SIZE_PREFIX_LENGTH=4,w.Encoding={UTF8_BYTES:1,UTF16_STRING:2},w.int32=new Int32Array(2),w.float32=new Float32Array(w.int32.buffer),w.float64=new Float64Array(w.int32.buffer),w.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,w.Long=function(e,o){this.low=e|0,this.high=o|0},w.Long.create=function(e,o){return e==0&&o==0?w.Long.ZERO:new w.Long(e,o)},w.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296},w.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high},w.Long.ZERO=new w.Long(0,0),w.Builder=function(e){if(e)var o=e;else var o=1024;this.bb=w.ByteBuffer.allocate(o),this.space=o,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},w.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},w.Builder.prototype.forceDefaults=function(e){this.force_defaults=e},w.Builder.prototype.dataBuffer=function(){return this.bb},w.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},w.Builder.prototype.prep=function(e,o){e>this.minalign&&(this.minalign=e);for(var s=~(this.bb.capacity()-this.space+o)+1&e-1;this.space<s+e+o;){var a=this.bb.capacity();this.bb=w.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-a}this.pad(s)},w.Builder.prototype.pad=function(e){for(var o=0;o<e;o++)this.bb.writeInt8(--this.space,0)},w.Builder.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)},w.Builder.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)},w.Builder.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)},w.Builder.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)},w.Builder.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)},w.Builder.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)},w.Builder.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)},w.Builder.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)},w.Builder.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)},w.Builder.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)},w.Builder.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)},w.Builder.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)},w.Builder.prototype.addFieldInt8=function(e,o,s){(this.force_defaults||o!=s)&&(this.addInt8(o),this.slot(e))},w.Builder.prototype.addFieldInt16=function(e,o,s){(this.force_defaults||o!=s)&&(this.addInt16(o),this.slot(e))},w.Builder.prototype.addFieldInt32=function(e,o,s){(this.force_defaults||o!=s)&&(this.addInt32(o),this.slot(e))},w.Builder.prototype.addFieldInt64=function(e,o,s){(this.force_defaults||!o.equals(s))&&(this.addInt64(o),this.slot(e))},w.Builder.prototype.addFieldFloat32=function(e,o,s){(this.force_defaults||o!=s)&&(this.addFloat32(o),this.slot(e))},w.Builder.prototype.addFieldFloat64=function(e,o,s){(this.force_defaults||o!=s)&&(this.addFloat64(o),this.slot(e))},w.Builder.prototype.addFieldOffset=function(e,o,s){(this.force_defaults||o!=s)&&(this.addOffset(o),this.slot(e))},w.Builder.prototype.addFieldStruct=function(e,o,s){o!=s&&(this.nested(o),this.slot(e))},w.Builder.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},w.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},w.Builder.prototype.slot=function(e){this.vtable[e]=this.offset()},w.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},w.Builder.growByteBuffer=function(e){var o=e.capacity();if(o&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var s=o<<1,a=w.ByteBuffer.allocate(s);return a.setPosition(s-o),a.bytes().set(e.bytes(),s-o),a},w.Builder.prototype.addOffset=function(e){this.prep(w.SIZEOF_INT,0),this.writeInt32(this.offset()-e+w.SIZEOF_INT)},w.Builder.prototype.startObject=function(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(var o=0;o<e;o++)this.vtable[o]=0;this.isNested=!0,this.object_start=this.offset()},w.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),o=this.vtable_in_use-1;o>=0&&this.vtable[o]==0;o--);for(var s=o+1;o>=0;o--)this.addInt16(this.vtable[o]!=0?e-this.vtable[o]:0);var a=2;this.addInt16(e-this.object_start);var $=(s+a)*w.SIZEOF_SHORT;this.addInt16($);var c=0,nt=this.space;e:for(o=0;o<this.vtables.length;o++){var at=this.bb.capacity()-this.vtables[o];if($==this.bb.readInt16(at)){for(var lt=w.SIZEOF_SHORT;lt<$;lt+=w.SIZEOF_SHORT)if(this.bb.readInt16(nt+lt)!=this.bb.readInt16(at+lt))continue e;c=this.vtables[o];break}}return c?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,c-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e},w.Builder.prototype.finish=function(e,o,s){var a=s?w.SIZE_PREFIX_LENGTH:0;if(o){var $=o;if(this.prep(this.minalign,w.SIZEOF_INT+w.FILE_IDENTIFIER_LENGTH+a),$.length!=w.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+w.FILE_IDENTIFIER_LENGTH);for(var c=w.FILE_IDENTIFIER_LENGTH-1;c>=0;c--)this.writeInt8($.charCodeAt(c))}this.prep(this.minalign,w.SIZEOF_INT+a),this.addOffset(e),a&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},w.Builder.prototype.finishSizePrefixed=function(e,o){this.finish(e,o,!0)},w.Builder.prototype.requiredField=function(e,o){var s=this.bb.capacity()-e,a=s-this.bb.readInt32(s),$=this.bb.readInt16(a+o)!=0;if(!$)throw new Error("FlatBuffers: field "+o+" must be set")},w.Builder.prototype.startVector=function(e,o,s){this.notNested(),this.vector_num_elems=o,this.prep(w.SIZEOF_INT,e*o),this.prep(s,e*o)},w.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},w.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var o=e;else for(var o=[],s=0;s<e.length;){var a,$=e.charCodeAt(s++);if($<55296||$>=56320)a=$;else{var c=e.charCodeAt(s++);a=($<<10)+c+-56613888}a<128?o.push(a):(a<2048?o.push(a>>6&31|192):(a<65536?o.push(a>>12&15|224):o.push(a>>18&7|240,a>>12&63|128),o.push(a>>6&63|128)),o.push(a&63|128))}this.addInt8(0),this.startVector(1,o.length,1),this.bb.setPosition(this.space-=o.length);for(var s=0,nt=this.space,at=this.bb.bytes();s<o.length;s++)at[nt++]=o[s];return this.endVector()},w.Builder.prototype.createLong=function(e,o){return w.Long.create(e,o)},w.ByteBuffer=function(e){this.bytes_=e,this.position_=0},w.ByteBuffer.allocate=function(e){return new w.ByteBuffer(new Uint8Array(e))},w.ByteBuffer.prototype.clear=function(){this.position_=0},w.ByteBuffer.prototype.bytes=function(){return this.bytes_},w.ByteBuffer.prototype.position=function(){return this.position_},w.ByteBuffer.prototype.setPosition=function(e){this.position_=e},w.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},w.ByteBuffer.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24},w.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]},w.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},w.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},w.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},w.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0},w.ByteBuffer.prototype.readInt64=function(e){return new w.Long(this.readInt32(e),this.readInt32(e+4))},w.ByteBuffer.prototype.readUint64=function(e){return new w.Long(this.readUint32(e),this.readUint32(e+4))},w.ByteBuffer.prototype.readFloat32=function(e){return w.int32[0]=this.readInt32(e),w.float32[0]},w.ByteBuffer.prototype.readFloat64=function(e){return w.int32[w.isLittleEndian?0:1]=this.readInt32(e),w.int32[w.isLittleEndian?1:0]=this.readInt32(e+4),w.float64[0]},w.ByteBuffer.prototype.writeInt8=function(e,o){this.bytes_[e]=o},w.ByteBuffer.prototype.writeUint8=function(e,o){this.bytes_[e]=o},w.ByteBuffer.prototype.writeInt16=function(e,o){this.bytes_[e]=o,this.bytes_[e+1]=o>>8},w.ByteBuffer.prototype.writeUint16=function(e,o){this.bytes_[e]=o,this.bytes_[e+1]=o>>8},w.ByteBuffer.prototype.writeInt32=function(e,o){this.bytes_[e]=o,this.bytes_[e+1]=o>>8,this.bytes_[e+2]=o>>16,this.bytes_[e+3]=o>>24},w.ByteBuffer.prototype.writeUint32=function(e,o){this.bytes_[e]=o,this.bytes_[e+1]=o>>8,this.bytes_[e+2]=o>>16,this.bytes_[e+3]=o>>24},w.ByteBuffer.prototype.writeInt64=function(e,o){this.writeInt32(e,o.low),this.writeInt32(e+4,o.high)},w.ByteBuffer.prototype.writeUint64=function(e,o){this.writeUint32(e,o.low),this.writeUint32(e+4,o.high)},w.ByteBuffer.prototype.writeFloat32=function(e,o){w.float32[0]=o,this.writeInt32(e,w.int32[0])},w.ByteBuffer.prototype.writeFloat64=function(e,o){w.float64[0]=o,this.writeInt32(e,w.int32[w.isLittleEndian?0:1]),this.writeInt32(e+4,w.int32[w.isLittleEndian?1:0])},w.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+w.SIZEOF_INT+w.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",o=0;o<w.FILE_IDENTIFIER_LENGTH;o++)e+=String.fromCharCode(this.readInt8(this.position_+w.SIZEOF_INT+o));return e},w.ByteBuffer.prototype.__offset=function(e,o){var s=e-this.readInt32(e);return o<this.readInt16(s)?this.readInt16(s+o):0},w.ByteBuffer.prototype.__union=function(e,o){return e.bb_pos=o+this.readInt32(o),e.bb=this,e},w.ByteBuffer.prototype.__string=function(e,o){e+=this.readInt32(e);var s=this.readInt32(e),a="",$=0;if(e+=w.SIZEOF_INT,o===w.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+s);for(;$<s;){var c,nt=this.readUint8(e+$++);if(nt<192)c=nt;else{var at=this.readUint8(e+$++);if(nt<224)c=(nt&31)<<6|at&63;else{var lt=this.readUint8(e+$++);if(nt<240)c=(nt&15)<<12|(at&63)<<6|lt&63;else{var et=this.readUint8(e+$++);c=(nt&7)<<18|(at&63)<<12|(lt&63)<<6|et&63}}}c<65536?a+=String.fromCharCode(c):(c-=65536,a+=String.fromCharCode((c>>10)+55296,(c&1023)+56320))}return a},w.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)},w.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+w.SIZEOF_INT},w.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},w.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=w.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+w.FILE_IDENTIFIER_LENGTH);for(var o=0;o<w.FILE_IDENTIFIER_LENGTH;o++)if(e.charCodeAt(o)!=this.readInt8(this.position_+w.SIZEOF_INT+o))return!1;return!0},w.ByteBuffer.prototype.createLong=function(e,o){return w.Long.create(e,o)}}),F,Pr=O(()=>{wn(),(e=>{(o=>{(s=>{(a=>(a[a.UNDEFINED=0]="UNDEFINED",a[a.FLOAT=1]="FLOAT",a[a.INT=2]="INT",a[a.STRING=3]="STRING",a[a.TENSOR=4]="TENSOR",a[a.GRAPH=5]="GRAPH",a[a.FLOATS=6]="FLOATS",a[a.INTS=7]="INTS",a[a.STRINGS=8]="STRINGS",a[a.TENSORS=9]="TENSORS",a[a.GRAPHS=10]="GRAPHS",a[a.SPARSE_TENSOR=11]="SPARSE_TENSOR",a[a.SPARSE_TENSORS=12]="SPARSE_TENSORS"))(s.AttributeType||={})})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{(a=>(a[a.UNKNOWN=0]="UNKNOWN",a[a.VALUE=1]="VALUE",a[a.PARAM=2]="PARAM"))(s.DimensionValueType||={})})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{(a=>(a[a.UNDEFINED=0]="UNDEFINED",a[a.FLOAT=1]="FLOAT",a[a.UINT8=2]="UINT8",a[a.INT8=3]="INT8",a[a.UINT16=4]="UINT16",a[a.INT16=5]="INT16",a[a.INT32=6]="INT32",a[a.INT64=7]="INT64",a[a.STRING=8]="STRING",a[a.BOOL=9]="BOOL",a[a.FLOAT16=10]="FLOAT16",a[a.DOUBLE=11]="DOUBLE",a[a.UINT32=12]="UINT32",a[a.UINT64=13]="UINT64",a[a.COMPLEX64=14]="COMPLEX64",a[a.COMPLEX128=15]="COMPLEX128",a[a.BFLOAT16=16]="BFLOAT16",a[a.FLOAT8E4M3FN=17]="FLOAT8E4M3FN",a[a.FLOAT8E4M3FNUZ=18]="FLOAT8E4M3FNUZ",a[a.FLOAT8E5M2=19]="FLOAT8E5M2",a[a.FLOAT8E5M2FNUZ=20]="FLOAT8E5M2FNUZ"))(s.TensorDataType||={})})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{(a=>(a[a.Primitive=0]="Primitive",a[a.Fused=1]="Fused"))(s.NodeType||={})})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{(a=>(a[a.NONE=0]="NONE",a[a.tensor_type=1]="tensor_type",a[a.sequence_type=2]="sequence_type",a[a.map_type=3]="map_type"))(s.TypeInfoValue||={})})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsShape(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsShape(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}dim(c,nt){let at=this.bb.__offset(this.bb_pos,4);return at?(nt||new e.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}dimLength(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__vector_len(this.bb_pos+c):0}static startShape(c){c.startObject(1)}static addDim(c,nt){c.addFieldOffset(0,nt,0)}static createDimVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startDimVector(c,nt){c.startVector(4,nt,4)}static endShape(c){return c.endObject()}static createShape(c,nt){return a.startShape(c),a.addDim(c,nt),a.endShape(c)}}s.Shape=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsDimension(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsDimension(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}value(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?(c||new e.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}denotation(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?this.bb.__string(this.bb_pos+nt,c):null}static startDimension(c){c.startObject(2)}static addValue(c,nt){c.addFieldOffset(0,nt,0)}static addDenotation(c,nt){c.addFieldOffset(1,nt,0)}static endDimension(c){return c.endObject()}static createDimension(c,nt,at){return a.startDimension(c),a.addValue(c,nt),a.addDenotation(c,at),a.endDimension(c)}}s.Dimension=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsDimensionValue(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsDimensionValue(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}dimType(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.readInt8(this.bb_pos+c):0}dimValue(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.readInt64(this.bb_pos+c):this.bb.createLong(0,0)}dimParam(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?this.bb.__string(this.bb_pos+nt,c):null}static startDimensionValue(c){c.startObject(3)}static addDimType(c,nt){c.addFieldInt8(0,nt,0)}static addDimValue(c,nt){c.addFieldInt64(1,nt,c.createLong(0,0))}static addDimParam(c,nt){c.addFieldOffset(2,nt,0)}static endDimensionValue(c){return c.endObject()}static createDimensionValue(c,nt,at,lt){return a.startDimensionValue(c),a.addDimType(c,nt),a.addDimValue(c,at),a.addDimParam(c,lt),a.endDimensionValue(c)}}s.DimensionValue=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsTensorTypeAndShape(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsTensorTypeAndShape(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}elemType(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.readInt32(this.bb_pos+c):0}shape(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?(c||new e.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}static startTensorTypeAndShape(c){c.startObject(2)}static addElemType(c,nt){c.addFieldInt32(0,nt,0)}static addShape(c,nt){c.addFieldOffset(1,nt,0)}static endTensorTypeAndShape(c){return c.endObject()}static createTensorTypeAndShape(c,nt,at){return a.startTensorTypeAndShape(c),a.addElemType(c,nt),a.addShape(c,at),a.endTensorTypeAndShape(c)}}s.TensorTypeAndShape=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsMapType(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsMapType(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}keyType(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.readInt32(this.bb_pos+c):0}valueType(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?(c||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}static startMapType(c){c.startObject(2)}static addKeyType(c,nt){c.addFieldInt32(0,nt,0)}static addValueType(c,nt){c.addFieldOffset(1,nt,0)}static endMapType(c){return c.endObject()}static createMapType(c,nt,at){return a.startMapType(c),a.addKeyType(c,nt),a.addValueType(c,at),a.endMapType(c)}}s.MapType=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsSequenceType(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsSequenceType(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}elemType(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?(c||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}static startSequenceType(c){c.startObject(1)}static addElemType(c,nt){c.addFieldOffset(0,nt,0)}static endSequenceType(c){return c.endObject()}static createSequenceType(c,nt){return a.startSequenceType(c),a.addElemType(c,nt),a.endSequenceType(c)}}s.SequenceType=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,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(c,nt,at,lt){return c.prep(4,12),c.writeInt32(lt),c.writeInt32(at),c.writeInt32(nt),c.offset()}}s.EdgeEnd=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsNodeEdge(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsNodeEdge(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}nodeIndex(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.readUint32(this.bb_pos+c):0}inputEdges(c,nt){let at=this.bb.__offset(this.bb_pos,6);return at?(nt||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+at)+c*12,this.bb):null}inputEdgesLength(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__vector_len(this.bb_pos+c):0}outputEdges(c,nt){let at=this.bb.__offset(this.bb_pos,8);return at?(nt||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+at)+c*12,this.bb):null}outputEdgesLength(){let c=this.bb.__offset(this.bb_pos,8);return c?this.bb.__vector_len(this.bb_pos+c):0}static startNodeEdge(c){c.startObject(3)}static addNodeIndex(c,nt){c.addFieldInt32(0,nt,0)}static addInputEdges(c,nt){c.addFieldOffset(1,nt,0)}static startInputEdgesVector(c,nt){c.startVector(12,nt,4)}static addOutputEdges(c,nt){c.addFieldOffset(2,nt,0)}static startOutputEdgesVector(c,nt){c.startVector(12,nt,4)}static endNodeEdge(c){return c.endObject()}static createNodeEdge(c,nt,at,lt){return a.startNodeEdge(c),a.addNodeIndex(c,nt),a.addInputEdges(c,at),a.addOutputEdges(c,lt),a.endNodeEdge(c)}}s.NodeEdge=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsNode(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsNode(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}name(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}docString(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?this.bb.__string(this.bb_pos+nt,c):null}domain(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?this.bb.__string(this.bb_pos+nt,c):null}sinceVersion(){let c=this.bb.__offset(this.bb_pos,10);return c?this.bb.readInt32(this.bb_pos+c):0}index(){let c=this.bb.__offset(this.bb_pos,12);return c?this.bb.readUint32(this.bb_pos+c):0}opType(c){let nt=this.bb.__offset(this.bb_pos,14);return nt?this.bb.__string(this.bb_pos+nt,c):null}type(){let c=this.bb.__offset(this.bb_pos,16);return c?this.bb.readInt32(this.bb_pos+c):0}executionProviderType(c){let nt=this.bb.__offset(this.bb_pos,18);return nt?this.bb.__string(this.bb_pos+nt,c):null}inputs(c,nt){let at=this.bb.__offset(this.bb_pos,20);return at?this.bb.__string(this.bb.__vector(this.bb_pos+at)+c*4,nt):null}inputsLength(){let c=this.bb.__offset(this.bb_pos,20);return c?this.bb.__vector_len(this.bb_pos+c):0}outputs(c,nt){let at=this.bb.__offset(this.bb_pos,22);return at?this.bb.__string(this.bb.__vector(this.bb_pos+at)+c*4,nt):null}outputsLength(){let c=this.bb.__offset(this.bb_pos,22);return c?this.bb.__vector_len(this.bb_pos+c):0}attributes(c,nt){let at=this.bb.__offset(this.bb_pos,24);return at?(nt||new e.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}attributesLength(){let c=this.bb.__offset(this.bb_pos,24);return c?this.bb.__vector_len(this.bb_pos+c):0}inputArgCounts(c){let nt=this.bb.__offset(this.bb_pos,26);return nt?this.bb.readInt32(this.bb.__vector(this.bb_pos+nt)+c*4):0}inputArgCountsLength(){let c=this.bb.__offset(this.bb_pos,26);return c?this.bb.__vector_len(this.bb_pos+c):0}inputArgCountsArray(){let c=this.bb.__offset(this.bb_pos,26);return c?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+c),this.bb.__vector_len(this.bb_pos+c)):null}implicitInputs(c,nt){let at=this.bb.__offset(this.bb_pos,28);return at?this.bb.__string(this.bb.__vector(this.bb_pos+at)+c*4,nt):null}implicitInputsLength(){let c=this.bb.__offset(this.bb_pos,28);return c?this.bb.__vector_len(this.bb_pos+c):0}static startNode(c){c.startObject(13)}static addName(c,nt){c.addFieldOffset(0,nt,0)}static addDocString(c,nt){c.addFieldOffset(1,nt,0)}static addDomain(c,nt){c.addFieldOffset(2,nt,0)}static addSinceVersion(c,nt){c.addFieldInt32(3,nt,0)}static addIndex(c,nt){c.addFieldInt32(4,nt,0)}static addOpType(c,nt){c.addFieldOffset(5,nt,0)}static addType(c,nt){c.addFieldInt32(6,nt,0)}static addExecutionProviderType(c,nt){c.addFieldOffset(7,nt,0)}static addInputs(c,nt){c.addFieldOffset(8,nt,0)}static createInputsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startInputsVector(c,nt){c.startVector(4,nt,4)}static addOutputs(c,nt){c.addFieldOffset(9,nt,0)}static createOutputsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startOutputsVector(c,nt){c.startVector(4,nt,4)}static addAttributes(c,nt){c.addFieldOffset(10,nt,0)}static createAttributesVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startAttributesVector(c,nt){c.startVector(4,nt,4)}static addInputArgCounts(c,nt){c.addFieldOffset(11,nt,0)}static createInputArgCountsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addInt32(nt[at]);return c.endVector()}static startInputArgCountsVector(c,nt){c.startVector(4,nt,4)}static addImplicitInputs(c,nt){c.addFieldOffset(12,nt,0)}static createImplicitInputsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startImplicitInputsVector(c,nt){c.startVector(4,nt,4)}static endNode(c){return c.endObject()}static createNode(c,nt,at,lt,et,it,st,ct,ft,pt,gt,wt,vt,_t){return a.startNode(c),a.addName(c,nt),a.addDocString(c,at),a.addDomain(c,lt),a.addSinceVersion(c,et),a.addIndex(c,it),a.addOpType(c,st),a.addType(c,ct),a.addExecutionProviderType(c,ft),a.addInputs(c,pt),a.addOutputs(c,gt),a.addAttributes(c,wt),a.addInputArgCounts(c,vt),a.addImplicitInputs(c,_t),a.endNode(c)}}s.Node=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsValueInfo(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsValueInfo(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}name(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}docString(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?this.bb.__string(this.bb_pos+nt,c):null}type(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?(c||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}static startValueInfo(c){c.startObject(3)}static addName(c,nt){c.addFieldOffset(0,nt,0)}static addDocString(c,nt){c.addFieldOffset(1,nt,0)}static addType(c,nt){c.addFieldOffset(2,nt,0)}static endValueInfo(c){return c.endObject()}static createValueInfo(c,nt,at,lt){return a.startValueInfo(c),a.addName(c,nt),a.addDocString(c,at),a.addType(c,lt),a.endValueInfo(c)}}s.ValueInfo=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsTypeInfo(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsTypeInfo(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}denotation(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}valueType(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.readUint8(this.bb_pos+c):0}value(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?this.bb.__union(c,this.bb_pos+nt):null}static startTypeInfo(c){c.startObject(3)}static addDenotation(c,nt){c.addFieldOffset(0,nt,0)}static addValueType(c,nt){c.addFieldInt8(1,nt,0)}static addValue(c,nt){c.addFieldOffset(2,nt,0)}static endTypeInfo(c){return c.endObject()}static createTypeInfo(c,nt,at,lt){return a.startTypeInfo(c),a.addDenotation(c,nt),a.addValueType(c,at),a.addValue(c,lt),a.endTypeInfo(c)}}s.TypeInfo=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsOperatorSetId(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsOperatorSetId(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}domain(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}version(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.readInt64(this.bb_pos+c):this.bb.createLong(0,0)}static startOperatorSetId(c){c.startObject(2)}static addDomain(c,nt){c.addFieldOffset(0,nt,0)}static addVersion(c,nt){c.addFieldInt64(1,nt,c.createLong(0,0))}static endOperatorSetId(c){return c.endObject()}static createOperatorSetId(c,nt,at){return a.startOperatorSetId(c),a.addDomain(c,nt),a.addVersion(c,at),a.endOperatorSetId(c)}}s.OperatorSetId=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsTensor(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsTensor(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}name(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}docString(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?this.bb.__string(this.bb_pos+nt,c):null}dims(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?this.bb.readInt64(this.bb.__vector(this.bb_pos+nt)+c*8):this.bb.createLong(0,0)}dimsLength(){let c=this.bb.__offset(this.bb_pos,8);return c?this.bb.__vector_len(this.bb_pos+c):0}dataType(){let c=this.bb.__offset(this.bb_pos,10);return c?this.bb.readInt32(this.bb_pos+c):0}rawData(c){let nt=this.bb.__offset(this.bb_pos,12);return nt?this.bb.readUint8(this.bb.__vector(this.bb_pos+nt)+c):0}rawDataLength(){let c=this.bb.__offset(this.bb_pos,12);return c?this.bb.__vector_len(this.bb_pos+c):0}rawDataArray(){let c=this.bb.__offset(this.bb_pos,12);return c?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+c),this.bb.__vector_len(this.bb_pos+c)):null}stringData(c,nt){let at=this.bb.__offset(this.bb_pos,14);return at?this.bb.__string(this.bb.__vector(this.bb_pos+at)+c*4,nt):null}stringDataLength(){let c=this.bb.__offset(this.bb_pos,14);return c?this.bb.__vector_len(this.bb_pos+c):0}static startTensor(c){c.startObject(6)}static addName(c,nt){c.addFieldOffset(0,nt,0)}static addDocString(c,nt){c.addFieldOffset(1,nt,0)}static addDims(c,nt){c.addFieldOffset(2,nt,0)}static createDimsVector(c,nt){c.startVector(8,nt.length,8);for(let at=nt.length-1;at>=0;at--)c.addInt64(nt[at]);return c.endVector()}static startDimsVector(c,nt){c.startVector(8,nt,8)}static addDataType(c,nt){c.addFieldInt32(3,nt,0)}static addRawData(c,nt){c.addFieldOffset(4,nt,0)}static createRawDataVector(c,nt){c.startVector(1,nt.length,1);for(let at=nt.length-1;at>=0;at--)c.addInt8(nt[at]);return c.endVector()}static startRawDataVector(c,nt){c.startVector(1,nt,1)}static addStringData(c,nt){c.addFieldOffset(5,nt,0)}static createStringDataVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startStringDataVector(c,nt){c.startVector(4,nt,4)}static endTensor(c){return c.endObject()}static createTensor(c,nt,at,lt,et,it,st){return a.startTensor(c),a.addName(c,nt),a.addDocString(c,at),a.addDims(c,lt),a.addDataType(c,et),a.addRawData(c,it),a.addStringData(c,st),a.endTensor(c)}}s.Tensor=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsSparseTensor(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsSparseTensor(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}values(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?(c||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}indices(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?(c||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}dims(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?this.bb.readInt64(this.bb.__vector(this.bb_pos+nt)+c*8):this.bb.createLong(0,0)}dimsLength(){let c=this.bb.__offset(this.bb_pos,8);return c?this.bb.__vector_len(this.bb_pos+c):0}static startSparseTensor(c){c.startObject(3)}static addValues(c,nt){c.addFieldOffset(0,nt,0)}static addIndices(c,nt){c.addFieldOffset(1,nt,0)}static addDims(c,nt){c.addFieldOffset(2,nt,0)}static createDimsVector(c,nt){c.startVector(8,nt.length,8);for(let at=nt.length-1;at>=0;at--)c.addInt64(nt[at]);return c.endVector()}static startDimsVector(c,nt){c.startVector(8,nt,8)}static endSparseTensor(c){return c.endObject()}static createSparseTensor(c,nt,at,lt){return a.startSparseTensor(c),a.addValues(c,nt),a.addIndices(c,at),a.addDims(c,lt),a.endSparseTensor(c)}}s.SparseTensor=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsAttribute(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsAttribute(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}name(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}docString(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?this.bb.__string(this.bb_pos+nt,c):null}type(){let c=this.bb.__offset(this.bb_pos,8);return c?this.bb.readInt32(this.bb_pos+c):0}f(){let c=this.bb.__offset(this.bb_pos,10);return c?this.bb.readFloat32(this.bb_pos+c):0}i(){let c=this.bb.__offset(this.bb_pos,12);return c?this.bb.readInt64(this.bb_pos+c):this.bb.createLong(0,0)}s(c){let nt=this.bb.__offset(this.bb_pos,14);return nt?this.bb.__string(this.bb_pos+nt,c):null}t(c){let nt=this.bb.__offset(this.bb_pos,16);return nt?(c||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}g(c){let nt=this.bb.__offset(this.bb_pos,18);return nt?(c||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}floats(c){let nt=this.bb.__offset(this.bb_pos,20);return nt?this.bb.readFloat32(this.bb.__vector(this.bb_pos+nt)+c*4):0}floatsLength(){let c=this.bb.__offset(this.bb_pos,20);return c?this.bb.__vector_len(this.bb_pos+c):0}floatsArray(){let c=this.bb.__offset(this.bb_pos,20);return c?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+c),this.bb.__vector_len(this.bb_pos+c)):null}ints(c){let nt=this.bb.__offset(this.bb_pos,22);return nt?this.bb.readInt64(this.bb.__vector(this.bb_pos+nt)+c*8):this.bb.createLong(0,0)}intsLength(){let c=this.bb.__offset(this.bb_pos,22);return c?this.bb.__vector_len(this.bb_pos+c):0}strings(c,nt){let at=this.bb.__offset(this.bb_pos,24);return at?this.bb.__string(this.bb.__vector(this.bb_pos+at)+c*4,nt):null}stringsLength(){let c=this.bb.__offset(this.bb_pos,24);return c?this.bb.__vector_len(this.bb_pos+c):0}tensors(c,nt){let at=this.bb.__offset(this.bb_pos,26);return at?(nt||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}tensorsLength(){let c=this.bb.__offset(this.bb_pos,26);return c?this.bb.__vector_len(this.bb_pos+c):0}graphs(c,nt){let at=this.bb.__offset(this.bb_pos,28);return at?(nt||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}graphsLength(){let c=this.bb.__offset(this.bb_pos,28);return c?this.bb.__vector_len(this.bb_pos+c):0}static startAttribute(c){c.startObject(13)}static addName(c,nt){c.addFieldOffset(0,nt,0)}static addDocString(c,nt){c.addFieldOffset(1,nt,0)}static addType(c,nt){c.addFieldInt32(2,nt,0)}static addF(c,nt){c.addFieldFloat32(3,nt,0)}static addI(c,nt){c.addFieldInt64(4,nt,c.createLong(0,0))}static addS(c,nt){c.addFieldOffset(5,nt,0)}static addT(c,nt){c.addFieldOffset(6,nt,0)}static addG(c,nt){c.addFieldOffset(7,nt,0)}static addFloats(c,nt){c.addFieldOffset(8,nt,0)}static createFloatsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addFloat32(nt[at]);return c.endVector()}static startFloatsVector(c,nt){c.startVector(4,nt,4)}static addInts(c,nt){c.addFieldOffset(9,nt,0)}static createIntsVector(c,nt){c.startVector(8,nt.length,8);for(let at=nt.length-1;at>=0;at--)c.addInt64(nt[at]);return c.endVector()}static startIntsVector(c,nt){c.startVector(8,nt,8)}static addStrings(c,nt){c.addFieldOffset(10,nt,0)}static createStringsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startStringsVector(c,nt){c.startVector(4,nt,4)}static addTensors(c,nt){c.addFieldOffset(11,nt,0)}static createTensorsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startTensorsVector(c,nt){c.startVector(4,nt,4)}static addGraphs(c,nt){c.addFieldOffset(12,nt,0)}static createGraphsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startGraphsVector(c,nt){c.startVector(4,nt,4)}static endAttribute(c){return c.endObject()}static createAttribute(c,nt,at,lt,et,it,st,ct,ft,pt,gt,wt,vt,_t){return a.startAttribute(c),a.addName(c,nt),a.addDocString(c,at),a.addType(c,lt),a.addF(c,et),a.addI(c,it),a.addS(c,st),a.addT(c,ct),a.addG(c,ft),a.addFloats(c,pt),a.addInts(c,gt),a.addStrings(c,wt),a.addTensors(c,vt),a.addGraphs(c,_t),a.endAttribute(c)}}s.Attribute=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsGraph(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsGraph(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}initializers(c,nt){let at=this.bb.__offset(this.bb_pos,4);return at?(nt||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}initializersLength(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__vector_len(this.bb_pos+c):0}nodeArgs(c,nt){let at=this.bb.__offset(this.bb_pos,6);return at?(nt||new e.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}nodeArgsLength(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__vector_len(this.bb_pos+c):0}nodes(c,nt){let at=this.bb.__offset(this.bb_pos,8);return at?(nt||new e.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}nodesLength(){let c=this.bb.__offset(this.bb_pos,8);return c?this.bb.__vector_len(this.bb_pos+c):0}maxNodeIndex(){let c=this.bb.__offset(this.bb_pos,10);return c?this.bb.readUint32(this.bb_pos+c):0}nodeEdges(c,nt){let at=this.bb.__offset(this.bb_pos,12);return at?(nt||new e.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}nodeEdgesLength(){let c=this.bb.__offset(this.bb_pos,12);return c?this.bb.__vector_len(this.bb_pos+c):0}inputs(c,nt){let at=this.bb.__offset(this.bb_pos,14);return at?this.bb.__string(this.bb.__vector(this.bb_pos+at)+c*4,nt):null}inputsLength(){let c=this.bb.__offset(this.bb_pos,14);return c?this.bb.__vector_len(this.bb_pos+c):0}outputs(c,nt){let at=this.bb.__offset(this.bb_pos,16);return at?this.bb.__string(this.bb.__vector(this.bb_pos+at)+c*4,nt):null}outputsLength(){let c=this.bb.__offset(this.bb_pos,16);return c?this.bb.__vector_len(this.bb_pos+c):0}sparseInitializers(c,nt){let at=this.bb.__offset(this.bb_pos,18);return at?(nt||new e.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}sparseInitializersLength(){let c=this.bb.__offset(this.bb_pos,18);return c?this.bb.__vector_len(this.bb_pos+c):0}static startGraph(c){c.startObject(8)}static addInitializers(c,nt){c.addFieldOffset(0,nt,0)}static createInitializersVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startInitializersVector(c,nt){c.startVector(4,nt,4)}static addNodeArgs(c,nt){c.addFieldOffset(1,nt,0)}static createNodeArgsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startNodeArgsVector(c,nt){c.startVector(4,nt,4)}static addNodes(c,nt){c.addFieldOffset(2,nt,0)}static createNodesVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startNodesVector(c,nt){c.startVector(4,nt,4)}static addMaxNodeIndex(c,nt){c.addFieldInt32(3,nt,0)}static addNodeEdges(c,nt){c.addFieldOffset(4,nt,0)}static createNodeEdgesVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startNodeEdgesVector(c,nt){c.startVector(4,nt,4)}static addInputs(c,nt){c.addFieldOffset(5,nt,0)}static createInputsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startInputsVector(c,nt){c.startVector(4,nt,4)}static addOutputs(c,nt){c.addFieldOffset(6,nt,0)}static createOutputsVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startOutputsVector(c,nt){c.startVector(4,nt,4)}static addSparseInitializers(c,nt){c.addFieldOffset(7,nt,0)}static createSparseInitializersVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startSparseInitializersVector(c,nt){c.startVector(4,nt,4)}static endGraph(c){return c.endObject()}static createGraph(c,nt,at,lt,et,it,st,ct,ft){return a.startGraph(c),a.addInitializers(c,nt),a.addNodeArgs(c,at),a.addNodes(c,lt),a.addMaxNodeIndex(c,et),a.addNodeEdges(c,it),a.addInputs(c,st),a.addOutputs(c,ct),a.addSparseInitializers(c,ft),a.endGraph(c)}}s.Graph=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsModel(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsModel(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}irVersion(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.readInt64(this.bb_pos+c):this.bb.createLong(0,0)}opsetImport(c,nt){let at=this.bb.__offset(this.bb_pos,6);return at?(nt||new e.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}opsetImportLength(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__vector_len(this.bb_pos+c):0}producerName(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?this.bb.__string(this.bb_pos+nt,c):null}producerVersion(c){let nt=this.bb.__offset(this.bb_pos,10);return nt?this.bb.__string(this.bb_pos+nt,c):null}domain(c){let nt=this.bb.__offset(this.bb_pos,12);return nt?this.bb.__string(this.bb_pos+nt,c):null}modelVersion(){let c=this.bb.__offset(this.bb_pos,14);return c?this.bb.readInt64(this.bb_pos+c):this.bb.createLong(0,0)}docString(c){let nt=this.bb.__offset(this.bb_pos,16);return nt?this.bb.__string(this.bb_pos+nt,c):null}graph(c){let nt=this.bb.__offset(this.bb_pos,18);return nt?(c||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}graphDocString(c){let nt=this.bb.__offset(this.bb_pos,20);return nt?this.bb.__string(this.bb_pos+nt,c):null}static startModel(c){c.startObject(9)}static addIrVersion(c,nt){c.addFieldInt64(0,nt,c.createLong(0,0))}static addOpsetImport(c,nt){c.addFieldOffset(1,nt,0)}static createOpsetImportVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startOpsetImportVector(c,nt){c.startVector(4,nt,4)}static addProducerName(c,nt){c.addFieldOffset(2,nt,0)}static addProducerVersion(c,nt){c.addFieldOffset(3,nt,0)}static addDomain(c,nt){c.addFieldOffset(4,nt,0)}static addModelVersion(c,nt){c.addFieldInt64(5,nt,c.createLong(0,0))}static addDocString(c,nt){c.addFieldOffset(6,nt,0)}static addGraph(c,nt){c.addFieldOffset(7,nt,0)}static addGraphDocString(c,nt){c.addFieldOffset(8,nt,0)}static endModel(c){return c.endObject()}static createModel(c,nt,at,lt,et,it,st,ct,ft,pt){return a.startModel(c),a.addIrVersion(c,nt),a.addOpsetImport(c,at),a.addProducerName(c,lt),a.addProducerVersion(c,et),a.addDomain(c,it),a.addModelVersion(c,st),a.addDocString(c,ct),a.addGraph(c,ft),a.addGraphDocString(c,pt),a.endModel(c)}}s.Model=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsKernelCreateInfos(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsKernelCreateInfos(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}nodeIndices(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.readUint32(this.bb.__vector(this.bb_pos+nt)+c*4):0}nodeIndicesLength(){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__vector_len(this.bb_pos+c):0}nodeIndicesArray(){let c=this.bb.__offset(this.bb_pos,4);return c?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+c),this.bb.__vector_len(this.bb_pos+c)):null}kernelDefHashes(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?this.bb.readUint64(this.bb.__vector(this.bb_pos+nt)+c*8):this.bb.createLong(0,0)}kernelDefHashesLength(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__vector_len(this.bb_pos+c):0}static startKernelCreateInfos(c){c.startObject(2)}static addNodeIndices(c,nt){c.addFieldOffset(0,nt,0)}static createNodeIndicesVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addInt32(nt[at]);return c.endVector()}static startNodeIndicesVector(c,nt){c.startVector(4,nt,4)}static addKernelDefHashes(c,nt){c.addFieldOffset(1,nt,0)}static createKernelDefHashesVector(c,nt){c.startVector(8,nt.length,8);for(let at=nt.length-1;at>=0;at--)c.addInt64(nt[at]);return c.endVector()}static startKernelDefHashesVector(c,nt){c.startVector(8,nt,8)}static endKernelCreateInfos(c){return c.endObject()}static createKernelCreateInfos(c,nt,at){return a.startKernelCreateInfos(c),a.addNodeIndices(c,nt),a.addKernelDefHashes(c,at),a.endKernelCreateInfos(c)}}s.KernelCreateInfos=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsSubGraphSessionState(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsSubGraphSessionState(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}graphId(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}sessionState(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?(c||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}static startSubGraphSessionState(c){c.startObject(2)}static addGraphId(c,nt){c.addFieldOffset(0,nt,0)}static addSessionState(c,nt){c.addFieldOffset(1,nt,0)}static endSubGraphSessionState(c){let nt=c.endObject();return c.requiredField(nt,4),nt}static createSubGraphSessionState(c,nt,at){return a.startSubGraphSessionState(c),a.addGraphId(c,nt),a.addSessionState(c,at),a.endSubGraphSessionState(c)}}s.SubGraphSessionState=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsSessionState(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsSessionState(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}kernels(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?(c||new e.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}subGraphSessionStates(c,nt){let at=this.bb.__offset(this.bb_pos,6);return at?(nt||new e.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+at)+c*4),this.bb):null}subGraphSessionStatesLength(){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__vector_len(this.bb_pos+c):0}static startSessionState(c){c.startObject(2)}static addKernels(c,nt){c.addFieldOffset(0,nt,0)}static addSubGraphSessionStates(c,nt){c.addFieldOffset(1,nt,0)}static createSubGraphSessionStatesVector(c,nt){c.startVector(4,nt.length,4);for(let at=nt.length-1;at>=0;at--)c.addOffset(nt[at]);return c.endVector()}static startSubGraphSessionStatesVector(c,nt){c.startVector(4,nt,4)}static endSessionState(c){return c.endObject()}static createSessionState(c,nt,at){return a.startSessionState(c),a.addKernels(c,nt),a.addSubGraphSessionStates(c,at),a.endSessionState(c)}}s.SessionState=a})(o.fbs||={})})(e.experimental||={})})(F||={}),(e=>{(o=>{(s=>{class a{constructor(){this.bb=null,this.bb_pos=0}__init(c,nt){return this.bb_pos=c,this.bb=nt,this}static getRootAsInferenceSession(c,nt){return(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static getSizePrefixedRootAsInferenceSession(c,nt){return c.setPosition(c.position()+w.SIZE_PREFIX_LENGTH),(nt||new a).__init(c.readInt32(c.position())+c.position(),c)}static bufferHasIdentifier(c){return c.__has_identifier("ORTM")}ortVersion(c){let nt=this.bb.__offset(this.bb_pos,4);return nt?this.bb.__string(this.bb_pos+nt,c):null}model(c){let nt=this.bb.__offset(this.bb_pos,6);return nt?(c||new e.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}sessionState(c){let nt=this.bb.__offset(this.bb_pos,8);return nt?(c||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+nt),this.bb):null}static startInferenceSession(c){c.startObject(3)}static addOrtVersion(c,nt){c.addFieldOffset(0,nt,0)}static addModel(c,nt){c.addFieldOffset(1,nt,0)}static addSessionState(c,nt){c.addFieldOffset(2,nt,0)}static endInferenceSession(c){return c.endObject()}static finishInferenceSessionBuffer(c,nt){c.finish(nt,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(c,nt){c.finish(nt,"ORTM",!0)}static createInferenceSession(c,nt,at,lt){return a.startInferenceSession(c),a.addOrtVersion(c,nt),a.addModel(c,at),a.addSessionState(c,lt),a.endInferenceSession(c)}}s.InferenceSession=a})(o.fbs||={})})(e.experimental||={})})(F||={})}),js=mt((e,o)=>{o.exports=s;function s(a,$){for(var c=new Array(arguments.length-1),nt=0,at=2,lt=!0;at<arguments.length;)c[nt++]=arguments[at++];return new Promise(function(et,it){c[nt]=function(st){if(lt)if(lt=!1,st)it(st);else{for(var ct=new Array(arguments.length-1),ft=0;ft<ct.length;)ct[ft++]=arguments[ft];et.apply(null,ct)}};try{a.apply($||null,c)}catch(st){lt&&(lt=!1,it(st))}})}}),Ys=mt(e=>{var o=e;o.length=function(nt){var at=nt.length;if(!at)return 0;for(var lt=0;--at%4>1&&nt.charAt(at)==="=";)++lt;return Math.ceil(nt.length*3)/4-lt};var s=new Array(64),a=new Array(123);for($=0;$<64;)a[s[$]=$<26?$+65:$<52?$+71:$<62?$-4:$-59|43]=$++;var $;o.encode=function(nt,at,lt){for(var et=null,it=[],st=0,ct=0,ft;at<lt;){var pt=nt[at++];switch(ct){case 0:it[st++]=s[pt>>2],ft=(pt&3)<<4,ct=1;break;case 1:it[st++]=s[ft|pt>>4],ft=(pt&15)<<2,ct=2;break;case 2:it[st++]=s[ft|pt>>6],it[st++]=s[pt&63],ct=0;break}st>8191&&((et||(et=[])).push(String.fromCharCode.apply(String,it)),st=0)}return ct&&(it[st++]=s[ft],it[st++]=61,ct===1&&(it[st++]=61)),et?(st&&et.push(String.fromCharCode.apply(String,it.slice(0,st))),et.join("")):String.fromCharCode.apply(String,it.slice(0,st))};var c="invalid encoding";o.decode=function(nt,at,lt){for(var et=lt,it=0,st,ct=0;ct<nt.length;){var ft=nt.charCodeAt(ct++);if(ft===61&&it>1)break;if((ft=a[ft])===void 0)throw Error(c);switch(it){case 0:st=ft,it=1;break;case 1:at[lt++]=st<<2|(ft&48)>>4,st=ft,it=2;break;case 2:at[lt++]=(st&15)<<4|(ft&60)>>2,st=ft,it=3;break;case 3:at[lt++]=(st&3)<<6|ft,it=0;break}}if(it===1)throw Error(c);return lt-et},o.test=function(nt){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(nt)}}),Qs=mt((e,o)=>{o.exports=s;function s(){this._listeners={}}s.prototype.on=function(a,$,c){return(this._listeners[a]||(this._listeners[a]=[])).push({fn:$,ctx:c||this}),this},s.prototype.off=function(a,$){if(a===void 0)this._listeners={};else if($===void 0)this._listeners[a]=[];else for(var c=this._listeners[a],nt=0;nt<c.length;)c[nt].fn===$?c.splice(nt,1):++nt;return this},s.prototype.emit=function(a){var $=this._listeners[a];if($){for(var c=[],nt=1;nt<arguments.length;)c.push(arguments[nt++]);for(nt=0;nt<$.length;)$[nt].fn.apply($[nt++].ctx,c)}return this}}),au=mt((e,o)=>{o.exports=s(s);function s(at){return typeof Float32Array<"u"?function(){var lt=new Float32Array([-0]),et=new Uint8Array(lt.buffer),it=et[3]===128;function st(gt,wt,vt){lt[0]=gt,wt[vt]=et[0],wt[vt+1]=et[1],wt[vt+2]=et[2],wt[vt+3]=et[3]}function ct(gt,wt,vt){lt[0]=gt,wt[vt]=et[3],wt[vt+1]=et[2],wt[vt+2]=et[1],wt[vt+3]=et[0]}at.writeFloatLE=it?st:ct,at.writeFloatBE=it?ct:st;function ft(gt,wt){return et[0]=gt[wt],et[1]=gt[wt+1],et[2]=gt[wt+2],et[3]=gt[wt+3],lt[0]}function pt(gt,wt){return et[3]=gt[wt],et[2]=gt[wt+1],et[1]=gt[wt+2],et[0]=gt[wt+3],lt[0]}at.readFloatLE=it?ft:pt,at.readFloatBE=it?pt:ft}():function(){function lt(it,st,ct,ft){var pt=st<0?1:0;if(pt&&(st=-st),st===0)it(1/st>0?0:2147483648,ct,ft);else if(isNaN(st))it(2143289344,ct,ft);else if(st>34028234663852886e22)it((pt<<31|2139095040)>>>0,ct,ft);else if(st<11754943508222875e-54)it((pt<<31|Math.round(st/1401298464324817e-60))>>>0,ct,ft);else{var gt=Math.floor(Math.log(st)/Math.LN2),wt=Math.round(st*Math.pow(2,-gt)*8388608)&8388607;it((pt<<31|gt+127<<23|wt)>>>0,ct,ft)}}at.writeFloatLE=lt.bind(null,a),at.writeFloatBE=lt.bind(null,$);function et(it,st,ct){var ft=it(st,ct),pt=(ft>>31)*2+1,gt=ft>>>23&255,wt=ft&8388607;return gt===255?wt?NaN:pt*(1/0):gt===0?pt*1401298464324817e-60*wt:pt*Math.pow(2,gt-150)*(wt+8388608)}at.readFloatLE=et.bind(null,c),at.readFloatBE=et.bind(null,nt)}(),typeof Float64Array<"u"?function(){var lt=new Float64Array([-0]),et=new Uint8Array(lt.buffer),it=et[7]===128;function st(gt,wt,vt){lt[0]=gt,wt[vt]=et[0],wt[vt+1]=et[1],wt[vt+2]=et[2],wt[vt+3]=et[3],wt[vt+4]=et[4],wt[vt+5]=et[5],wt[vt+6]=et[6],wt[vt+7]=et[7]}function ct(gt,wt,vt){lt[0]=gt,wt[vt]=et[7],wt[vt+1]=et[6],wt[vt+2]=et[5],wt[vt+3]=et[4],wt[vt+4]=et[3],wt[vt+5]=et[2],wt[vt+6]=et[1],wt[vt+7]=et[0]}at.writeDoubleLE=it?st:ct,at.writeDoubleBE=it?ct:st;function ft(gt,wt){return et[0]=gt[wt],et[1]=gt[wt+1],et[2]=gt[wt+2],et[3]=gt[wt+3],et[4]=gt[wt+4],et[5]=gt[wt+5],et[6]=gt[wt+6],et[7]=gt[wt+7],lt[0]}function pt(gt,wt){return et[7]=gt[wt],et[6]=gt[wt+1],et[5]=gt[wt+2],et[4]=gt[wt+3],et[3]=gt[wt+4],et[2]=gt[wt+5],et[1]=gt[wt+6],et[0]=gt[wt+7],lt[0]}at.readDoubleLE=it?ft:pt,at.readDoubleBE=it?pt:ft}():function(){function lt(it,st,ct,ft,pt,gt){var wt=ft<0?1:0;if(wt&&(ft=-ft),ft===0)it(0,pt,gt+st),it(1/ft>0?0:2147483648,pt,gt+ct);else if(isNaN(ft))it(0,pt,gt+st),it(2146959360,pt,gt+ct);else if(ft>17976931348623157e292)it(0,pt,gt+st),it((wt<<31|2146435072)>>>0,pt,gt+ct);else{var vt;if(ft<22250738585072014e-324)vt=ft/5e-324,it(vt>>>0,pt,gt+st),it((wt<<31|vt/4294967296)>>>0,pt,gt+ct);else{var _t=Math.floor(Math.log(ft)/Math.LN2);_t===1024&&(_t=1023),vt=ft*Math.pow(2,-_t),it(vt*4503599627370496>>>0,pt,gt+st),it((wt<<31|_t+1023<<20|vt*1048576&1048575)>>>0,pt,gt+ct)}}}at.writeDoubleLE=lt.bind(null,a,0,4),at.writeDoubleBE=lt.bind(null,$,4,0);function et(it,st,ct,ft,pt){var gt=it(ft,pt+st),wt=it(ft,pt+ct),vt=(wt>>31)*2+1,_t=wt>>>20&2047,$t=4294967296*(wt&1048575)+gt;return _t===2047?$t?NaN:vt*(1/0):_t===0?vt*5e-324*$t:vt*Math.pow(2,_t-1075)*($t+4503599627370496)}at.readDoubleLE=et.bind(null,c,0,4),at.readDoubleBE=et.bind(null,nt,4,0)}(),at}function a(at,lt,et){lt[et]=at&255,lt[et+1]=at>>>8&255,lt[et+2]=at>>>16&255,lt[et+3]=at>>>24}function $(at,lt,et){lt[et]=at>>>24,lt[et+1]=at>>>16&255,lt[et+2]=at>>>8&255,lt[et+3]=at&255}function c(at,lt){return(at[lt]|at[lt+1]<<8|at[lt+2]<<16|at[lt+3]<<24)>>>0}function nt(at,lt){return(at[lt]<<24|at[lt+1]<<16|at[lt+2]<<8|at[lt+3])>>>0}}),su=mt((exports,module)=>{module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}}),lu=mt(e=>{var o=e;o.length=function(s){for(var a=0,$=0,c=0;c<s.length;++c)$=s.charCodeAt(c),$<128?a+=1:$<2048?a+=2:($&64512)===55296&&(s.charCodeAt(c+1)&64512)===56320?(++c,a+=4):a+=3;return a},o.read=function(s,a,$){var c=$-a;if(c<1)return"";for(var nt=null,at=[],lt=0,et;a<$;)et=s[a++],et<128?at[lt++]=et:et>191&&et<224?at[lt++]=(et&31)<<6|s[a++]&63:et>239&&et<365?(et=((et&7)<<18|(s[a++]&63)<<12|(s[a++]&63)<<6|s[a++]&63)-65536,at[lt++]=55296+(et>>10),at[lt++]=56320+(et&1023)):at[lt++]=(et&15)<<12|(s[a++]&63)<<6|s[a++]&63,lt>8191&&((nt||(nt=[])).push(String.fromCharCode.apply(String,at)),lt=0);return nt?(lt&&nt.push(String.fromCharCode.apply(String,at.slice(0,lt))),nt.join("")):String.fromCharCode.apply(String,at.slice(0,lt))},o.write=function(s,a,$){for(var c=$,nt,at,lt=0;lt<s.length;++lt)nt=s.charCodeAt(lt),nt<128?a[$++]=nt:nt<2048?(a[$++]=nt>>6|192,a[$++]=nt&63|128):(nt&64512)===55296&&((at=s.charCodeAt(lt+1))&64512)===56320?(nt=65536+((nt&1023)<<10)+(at&1023),++lt,a[$++]=nt>>18|240,a[$++]=nt>>12&63|128,a[$++]=nt>>6&63|128,a[$++]=nt&63|128):(a[$++]=nt>>12|224,a[$++]=nt>>6&63|128,a[$++]=nt&63|128);return $-c}}),cu=mt((e,o)=>{o.exports=s;function s(a,$,c){var nt=c||8192,at=nt>>>1,lt=null,et=nt;return function(it){if(it<1||it>at)return a(it);et+it>nt&&(lt=a(nt),et=0);var st=$.call(lt,et,et+=it);return et&7&&(et=(et|7)+1),st}}}),du=mt((e,o)=>{o.exports=a;var s=Se();function a(at,lt){this.lo=at>>>0,this.hi=lt>>>0}var $=a.zero=new a(0,0);$.toNumber=function(){return 0},$.zzEncode=$.zzDecode=function(){return this},$.length=function(){return 1};var c=a.zeroHash="\0\0\0\0\0\0\0\0";a.fromNumber=function(at){if(at===0)return $;var lt=at<0;lt&&(at=-at);var et=at>>>0,it=(at-et)/4294967296>>>0;return lt&&(it=~it>>>0,et=~et>>>0,++et>4294967295&&(et=0,++it>4294967295&&(it=0))),new a(et,it)},a.from=function(at){if(typeof at=="number")return a.fromNumber(at);if(s.isString(at))if(s.Long)at=s.Long.fromString(at);else return a.fromNumber(parseInt(at,10));return at.low||at.high?new a(at.low>>>0,at.high>>>0):$},a.prototype.toNumber=function(at){if(!at&&this.hi>>>31){var lt=~this.lo+1>>>0,et=~this.hi>>>0;return lt||(et=et+1>>>0),-(lt+et*4294967296)}return this.lo+this.hi*4294967296},a.prototype.toLong=function(at){return s.Long?new s.Long(this.lo|0,this.hi|0,!!at):{low:this.lo|0,high:this.hi|0,unsigned:!!at}};var nt=String.prototype.charCodeAt;a.fromHash=function(at){return at===c?$:new a((nt.call(at,0)|nt.call(at,1)<<8|nt.call(at,2)<<16|nt.call(at,3)<<24)>>>0,(nt.call(at,4)|nt.call(at,5)<<8|nt.call(at,6)<<16|nt.call(at,7)<<24)>>>0)},a.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},a.prototype.zzEncode=function(){var at=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^at)>>>0,this.lo=(this.lo<<1^at)>>>0,this},a.prototype.zzDecode=function(){var at=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^at)>>>0,this.hi=(this.hi>>>1^at)>>>0,this},a.prototype.length=function(){var at=this.lo,lt=(this.lo>>>28|this.hi<<4)>>>0,et=this.hi>>>24;return et===0?lt===0?at<16384?at<128?1:2:at<2097152?3:4:lt<16384?lt<128?5:6:lt<2097152?7:8:et<128?9:10}}),Se=mt(e=>{var o=e;o.asPromise=js(),o.base64=Ys(),o.EventEmitter=Qs(),o.float=au(),o.inquire=su(),o.utf8=lu(),o.pool=cu(),o.LongBits=du(),o.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),o.global=o.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||e,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function($){return typeof $=="number"&&isFinite($)&&Math.floor($)===$},o.isString=function($){return typeof $=="string"||$ instanceof String},o.isObject=function($){return $&&typeof $=="object"},o.isset=o.isSet=function($,c){var nt=$[c];return nt!=null&&$.hasOwnProperty(c)?typeof nt!="object"||(Array.isArray(nt)?nt.length:Object.keys(nt).length)>0:!1},o.Buffer=function(){try{var $=o.inquire("buffer").Buffer;return $.prototype.utf8Write?$:null}catch{return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function($){return typeof $=="number"?o.Buffer?o._Buffer_allocUnsafe($):new o.Array($):o.Buffer?o._Buffer_from($):typeof Uint8Array>"u"?$:new Uint8Array($)},o.Array=typeof Uint8Array<"u"?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function($){return $?o.LongBits.from($).toHash():o.LongBits.zeroHash},o.longFromHash=function($,c){var nt=o.LongBits.fromHash($);return o.Long?o.Long.fromBits(nt.lo,nt.hi,c):nt.toNumber(!!c)};function s($,c,nt){for(var at=Object.keys(c),lt=0;lt<at.length;++lt)($[at[lt]]===void 0||!nt)&&($[at[lt]]=c[at[lt]]);return $}o.merge=s,o.lcFirst=function($){return $.charAt(0).toLowerCase()+$.substring(1)};function a($){function c(nt,at){if(!(this instanceof c))return new c(nt,at);Object.defineProperty(this,"message",{get:function(){return nt}}),Error.captureStackTrace?Error.captureStackTrace(this,c):Object.defineProperty(this,"stack",{value:new Error().stack||""}),at&&s(this,at)}return c.prototype=Object.create(Error.prototype,{constructor:{value:c,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return $},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),c}o.newError=a,o.ProtocolError=a("ProtocolError"),o.oneOfGetter=function($){for(var c={},nt=0;nt<$.length;++nt)c[$[nt]]=1;return function(){for(var at=Object.keys(this),lt=at.length-1;lt>-1;--lt)if(c[at[lt]]===1&&this[at[lt]]!==void 0&&this[at[lt]]!==null)return at[lt]}},o.oneOfSetter=function($){return function(c){for(var nt=0;nt<$.length;++nt)$[nt]!==c&&delete this[$[nt]]}},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o._configure=function(){var $=o.Buffer;if(!$){o._Buffer_from=o._Buffer_allocUnsafe=null;return}o._Buffer_from=$.from!==Uint8Array.from&&$.from||function(c,nt){return new $(c,nt)},o._Buffer_allocUnsafe=$.allocUnsafe||function(c){return new $(c)}}}),ei=mt((e,o)=>{o.exports=it;var s=Se(),a,$=s.LongBits,c=s.base64,nt=s.utf8;function at(_t,$t,Pt){this.fn=_t,this.len=$t,this.next=void 0,this.val=Pt}function lt(){}function et(_t){this.head=_t.head,this.tail=_t.tail,this.len=_t.len,this.next=_t.states}function it(){this.len=0,this.head=new at(lt,0,0),this.tail=this.head,this.states=null}var st=function(){return s.Buffer?function(){return(it.create=function(){return new a})()}:function(){return new it}};it.create=st(),it.alloc=function(_t){return new s.Array(_t)},s.Array!==Array&&(it.alloc=s.pool(it.alloc,s.Array.prototype.subarray)),it.prototype._push=function(_t,$t,Pt){return this.tail=this.tail.next=new at(_t,$t,Pt),this.len+=$t,this};function ct(_t,$t,Pt){$t[Pt]=_t&255}function ft(_t,$t,Pt){for(;_t>127;)$t[Pt++]=_t&127|128,_t>>>=7;$t[Pt]=_t}function pt(_t,$t){this.len=_t,this.next=void 0,this.val=$t}pt.prototype=Object.create(at.prototype),pt.prototype.fn=ft,it.prototype.uint32=function(_t){return this.len+=(this.tail=this.tail.next=new pt((_t=_t>>>0)<128?1:_t<16384?2:_t<2097152?3:_t<268435456?4:5,_t)).len,this},it.prototype.int32=function(_t){return _t<0?this._push(gt,10,$.fromNumber(_t)):this.uint32(_t)},it.prototype.sint32=function(_t){return this.uint32((_t<<1^_t>>31)>>>0)};function gt(_t,$t,Pt){for(;_t.hi;)$t[Pt++]=_t.lo&127|128,_t.lo=(_t.lo>>>7|_t.hi<<25)>>>0,_t.hi>>>=7;for(;_t.lo>127;)$t[Pt++]=_t.lo&127|128,_t.lo=_t.lo>>>7;$t[Pt++]=_t.lo}it.prototype.uint64=function(_t){var $t=$.from(_t);return this._push(gt,$t.length(),$t)},it.prototype.int64=it.prototype.uint64,it.prototype.sint64=function(_t){var $t=$.from(_t).zzEncode();return this._push(gt,$t.length(),$t)},it.prototype.bool=function(_t){return this._push(ct,1,_t?1:0)};function wt(_t,$t,Pt){$t[Pt]=_t&255,$t[Pt+1]=_t>>>8&255,$t[Pt+2]=_t>>>16&255,$t[Pt+3]=_t>>>24}it.prototype.fixed32=function(_t){return this._push(wt,4,_t>>>0)},it.prototype.sfixed32=it.prototype.fixed32,it.prototype.fixed64=function(_t){var $t=$.from(_t);return this._push(wt,4,$t.lo)._push(wt,4,$t.hi)},it.prototype.sfixed64=it.prototype.fixed64,it.prototype.float=function(_t){return this._push(s.float.writeFloatLE,4,_t)},it.prototype.double=function(_t){return this._push(s.float.writeDoubleLE,8,_t)};var vt=s.Array.prototype.set?function(_t,$t,Pt){$t.set(_t,Pt)}:function(_t,$t,Pt){for(var Nt=0;Nt<_t.length;++Nt)$t[Pt+Nt]=_t[Nt]};it.prototype.bytes=function(_t){var $t=_t.length>>>0;if(!$t)return this._push(ct,1,0);if(s.isString(_t)){var Pt=it.alloc($t=c.length(_t));c.decode(_t,Pt,0),_t=Pt}return this.uint32($t)._push(vt,$t,_t)},it.prototype.string=function(_t){var $t=nt.length(_t);return $t?this.uint32($t)._push(nt.write,$t,_t):this._push(ct,1,0)},it.prototype.fork=function(){return this.states=new et(this),this.head=this.tail=new at(lt,0,0),this.len=0,this},it.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 at(lt,0,0),this.len=0),this},it.prototype.ldelim=function(){var _t=this.head,$t=this.tail,Pt=this.len;return this.reset().uint32(Pt),Pt&&(this.tail.next=_t.next,this.tail=$t,this.len+=Pt),this},it.prototype.finish=function(){for(var _t=this.head.next,$t=this.constructor.alloc(this.len),Pt=0;_t;)_t.fn(_t.val,$t,Pt),Pt+=_t.len,_t=_t.next;return $t},it._configure=function(_t){a=_t,it.create=st(),a._configure()}}),vu=mt((e,o)=>{o.exports=$;var s=ei();($.prototype=Object.create(s.prototype)).constructor=$;var a=Se();function $(){s.call(this)}$._configure=function(){$.alloc=a._Buffer_allocUnsafe,$.writeBytesBuffer=a.Buffer&&a.Buffer.prototype instanceof Uint8Array&&a.Buffer.prototype.set.name==="set"?function(nt,at,lt){at.set(nt,lt)}:function(nt,at,lt){if(nt.copy)nt.copy(at,lt,0,nt.length);else for(var et=0;et<nt.length;)at[lt++]=nt[et++]}},$.prototype.bytes=function(nt){a.isString(nt)&&(nt=a._Buffer_from(nt,"base64"));var at=nt.length>>>0;return this.uint32(at),at&&this._push($.writeBytesBuffer,at,nt),this};function c(nt,at,lt){nt.length<40?a.utf8.write(nt,at,lt):at.utf8Write?at.utf8Write(nt,lt):at.write(nt,lt)}$.prototype.string=function(nt){var at=a.Buffer.byteLength(nt);return this.uint32(at),at&&this._push(c,at,nt),this},$._configure()}),oi=mt((e,o)=>{o.exports=at;var s=Se(),a,$=s.LongBits,c=s.utf8;function nt(ft,pt){return RangeError("index out of range: "+ft.pos+" + "+(pt||1)+" > "+ft.len)}function at(ft){this.buf=ft,this.pos=0,this.len=ft.length}var lt=typeof Uint8Array<"u"?function(ft){if(ft instanceof Uint8Array||Array.isArray(ft))return new at(ft);throw Error("illegal buffer")}:function(ft){if(Array.isArray(ft))return new at(ft);throw Error("illegal buffer")},et=function(){return s.Buffer?function(ft){return(at.create=function(pt){return s.Buffer.isBuffer(pt)?new a(pt):lt(pt)})(ft)}:lt};at.create=et(),at.prototype._slice=s.Array.prototype.subarray||s.Array.prototype.slice,at.prototype.uint32=function(){var ft=4294967295;return function(){if(ft=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(ft=(ft|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(ft=(ft|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(ft=(ft|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(ft=(ft|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return ft;if((this.pos+=5)>this.len)throw this.pos=this.len,nt(this,10);return ft}}(),at.prototype.int32=function(){return this.uint32()|0},at.prototype.sint32=function(){var ft=this.uint32();return ft>>>1^-(ft&1)|0};function it(){var ft=new $(0,0),pt=0;if(this.len-this.pos>4){for(;pt<4;++pt)if(ft.lo=(ft.lo|(this.buf[this.pos]&127)<<pt*7)>>>0,this.buf[this.pos++]<128)return ft;if(ft.lo=(ft.lo|(this.buf[this.pos]&127)<<28)>>>0,ft.hi=(ft.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return ft;pt=0}else{for(;pt<3;++pt){if(this.pos>=this.len)throw nt(this);if(ft.lo=(ft.lo|(this.buf[this.pos]&127)<<pt*7)>>>0,this.buf[this.pos++]<128)return ft}return ft.lo=(ft.lo|(this.buf[this.pos++]&127)<<pt*7)>>>0,ft}if(this.len-this.pos>4){for(;pt<5;++pt)if(ft.hi=(ft.hi|(this.buf[this.pos]&127)<<pt*7+3)>>>0,this.buf[this.pos++]<128)return ft}else for(;pt<5;++pt){if(this.pos>=this.len)throw nt(this);if(ft.hi=(ft.hi|(this.buf[this.pos]&127)<<pt*7+3)>>>0,this.buf[this.pos++]<128)return ft}throw Error("invalid varint encoding")}at.prototype.bool=function(){return this.uint32()!==0};function st(ft,pt){return(ft[pt-4]|ft[pt-3]<<8|ft[pt-2]<<16|ft[pt-1]<<24)>>>0}at.prototype.fixed32=function(){if(this.pos+4>this.len)throw nt(this,4);return st(this.buf,this.pos+=4)},at.prototype.sfixed32=function(){if(this.pos+4>this.len)throw nt(this,4);return st(this.buf,this.pos+=4)|0};function ct(){if(this.pos+8>this.len)throw nt(this,8);return new $(st(this.buf,this.pos+=4),st(this.buf,this.pos+=4))}at.prototype.float=function(){if(this.pos+4>this.len)throw nt(this,4);var ft=s.float.readFloatLE(this.buf,this.pos);return this.pos+=4,ft},at.prototype.double=function(){if(this.pos+8>this.len)throw nt(this,4);var ft=s.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,ft},at.prototype.bytes=function(){var ft=this.uint32(),pt=this.pos,gt=this.pos+ft;if(gt>this.len)throw nt(this,ft);if(this.pos+=ft,Array.isArray(this.buf))return this.buf.slice(pt,gt);if(pt===gt){var wt=s.Buffer;return wt?wt.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,pt,gt)},at.prototype.string=function(){var ft=this.bytes();return c.read(ft,0,ft.length)},at.prototype.skip=function(ft){if(typeof ft=="number"){if(this.pos+ft>this.len)throw nt(this,ft);this.pos+=ft}else do if(this.pos>=this.len)throw nt(this);while(this.buf[this.pos++]&128);return this},at.prototype.skipType=function(ft){switch(ft){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(ft=this.uint32()&7)!==4;)this.skipType(ft);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+ft+" at offset "+this.pos)}return this},at._configure=function(ft){a=ft,at.create=et(),a._configure();var pt=s.Long?"toLong":"toNumber";s.merge(at.prototype,{int64:function(){return it.call(this)[pt](!1)},uint64:function(){return it.call(this)[pt](!0)},sint64:function(){return it.call(this).zzDecode()[pt](!1)},fixed64:function(){return ct.call(this)[pt](!0)},sfixed64:function(){return ct.call(this)[pt](!1)}})}}),Lu=mt((e,o)=>{o.exports=$;var s=oi();($.prototype=Object.create(s.prototype)).constructor=$;var a=Se();function $(c){s.call(this,c)}$._configure=function(){a.Buffer&&($.prototype._slice=a.Buffer.prototype.slice)},$.prototype.string=function(){var c=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+c,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+c,this.len))},$._configure()}),ku=mt((e,o)=>{o.exports=a;var s=Se();(a.prototype=Object.create(s.EventEmitter.prototype)).constructor=a;function a($,c,nt){if(typeof $!="function")throw TypeError("rpcImpl must be a function");s.EventEmitter.call(this),this.rpcImpl=$,this.requestDelimited=!!c,this.responseDelimited=!!nt}a.prototype.rpcCall=function $(c,nt,at,lt,et){if(!lt)throw TypeError("request must be specified");var it=this;if(!et)return s.asPromise($,it,c,nt,at,lt);if(!it.rpcImpl){setTimeout(function(){et(Error("already ended"))},0);return}try{return it.rpcImpl(c,nt[it.requestDelimited?"encodeDelimited":"encode"](lt).finish(),function(st,ct){if(st)return it.emit("error",st,c),et(st);if(ct===null){it.end(!0);return}if(!(ct instanceof at))try{ct=at[it.responseDelimited?"decodeDelimited":"decode"](ct)}catch(ft){return it.emit("error",ft,c),et(ft)}return it.emit("data",ct,c),et(null,ct)})}catch(st){it.emit("error",st,c),setTimeout(function(){et(st)},0);return}},a.prototype.end=function($){return this.rpcImpl&&($||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}}),Fu=mt(e=>{var o=e;o.Service=ku()}),Nu=mt((e,o)=>{o.exports={}}),Mu=mt(e=>{var o=e;o.build="minimal",o.Writer=ei(),o.BufferWriter=vu(),o.Reader=oi(),o.BufferReader=Lu(),o.util=Se(),o.rpc=Fu(),o.roots=Nu(),o.configure=s;function s(){o.util._configure(),o.Writer._configure(o.BufferWriter),o.Reader._configure(o.BufferReader)}s()}),Vu=mt((e,o)=>{o.exports=Mu()}),sr=mt((e,o)=>{var s=Vu(),a=s.Reader,$=s.Writer,c=s.util,nt=s.roots.default||(s.roots.default={});nt.onnx=function(){var at={};return at.Version=function(){var lt={},et=Object.create(lt);return et[lt[0]="_START_VERSION"]=0,et[lt[1]="IR_VERSION_2017_10_10"]=1,et[lt[2]="IR_VERSION_2017_10_30"]=2,et[lt[3]="IR_VERSION_2017_11_3"]=3,et[lt[4]="IR_VERSION_2019_1_22"]=4,et[lt[5]="IR_VERSION_2019_3_18"]=5,et[lt[6]="IR_VERSION_2019_9_19"]=6,et[lt[7]="IR_VERSION_2020_5_8"]=7,et[lt[8]="IR_VERSION_2021_7_30"]=8,et[lt[9]="IR_VERSION"]=9,et}(),at.AttributeProto=function(){function lt(et){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],this.sparseTensors=[],this.typeProtos=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.name="",lt.prototype.refAttrName="",lt.prototype.docString="",lt.prototype.type=0,lt.prototype.f=0,lt.prototype.i=c.Long?c.Long.fromBits(0,0,!1):0,lt.prototype.s=c.newBuffer([]),lt.prototype.t=null,lt.prototype.g=null,lt.prototype.sparseTensor=null,lt.prototype.tp=null,lt.prototype.floats=c.emptyArray,lt.prototype.ints=c.emptyArray,lt.prototype.strings=c.emptyArray,lt.prototype.tensors=c.emptyArray,lt.prototype.graphs=c.emptyArray,lt.prototype.sparseTensors=c.emptyArray,lt.prototype.typeProtos=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.name!=null&&Object.hasOwnProperty.call(et,"name")&&it.uint32(10).string(et.name),et.f!=null&&Object.hasOwnProperty.call(et,"f")&&it.uint32(21).float(et.f),et.i!=null&&Object.hasOwnProperty.call(et,"i")&&it.uint32(24).int64(et.i),et.s!=null&&Object.hasOwnProperty.call(et,"s")&&it.uint32(34).bytes(et.s),et.t!=null&&Object.hasOwnProperty.call(et,"t")&&nt.onnx.TensorProto.encode(et.t,it.uint32(42).fork()).ldelim(),et.g!=null&&Object.hasOwnProperty.call(et,"g")&&nt.onnx.GraphProto.encode(et.g,it.uint32(50).fork()).ldelim(),et.floats!=null&&et.floats.length){it.uint32(58).fork();for(var st=0;st<et.floats.length;++st)it.float(et.floats[st]);it.ldelim()}if(et.ints!=null&&et.ints.length){it.uint32(66).fork();for(var st=0;st<et.ints.length;++st)it.int64(et.ints[st]);it.ldelim()}if(et.strings!=null&&et.strings.length)for(var st=0;st<et.strings.length;++st)it.uint32(74).bytes(et.strings[st]);if(et.tensors!=null&&et.tensors.length)for(var st=0;st<et.tensors.length;++st)nt.onnx.TensorProto.encode(et.tensors[st],it.uint32(82).fork()).ldelim();if(et.graphs!=null&&et.graphs.length)for(var st=0;st<et.graphs.length;++st)nt.onnx.GraphProto.encode(et.graphs[st],it.uint32(90).fork()).ldelim();if(et.docString!=null&&Object.hasOwnProperty.call(et,"docString")&&it.uint32(106).string(et.docString),et.tp!=null&&Object.hasOwnProperty.call(et,"tp")&&nt.onnx.TypeProto.encode(et.tp,it.uint32(114).fork()).ldelim(),et.typeProtos!=null&&et.typeProtos.length)for(var st=0;st<et.typeProtos.length;++st)nt.onnx.TypeProto.encode(et.typeProtos[st],it.uint32(122).fork()).ldelim();if(et.type!=null&&Object.hasOwnProperty.call(et,"type")&&it.uint32(160).int32(et.type),et.refAttrName!=null&&Object.hasOwnProperty.call(et,"refAttrName")&&it.uint32(170).string(et.refAttrName),et.sparseTensor!=null&&Object.hasOwnProperty.call(et,"sparseTensor")&&nt.onnx.SparseTensorProto.encode(et.sparseTensor,it.uint32(178).fork()).ldelim(),et.sparseTensors!=null&&et.sparseTensors.length)for(var st=0;st<et.sparseTensors.length;++st)nt.onnx.SparseTensorProto.encode(et.sparseTensors[st],it.uint32(186).fork()).ldelim();return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.AttributeProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.name=et.string();break}case 21:{ct.refAttrName=et.string();break}case 13:{ct.docString=et.string();break}case 20:{ct.type=et.int32();break}case 2:{ct.f=et.float();break}case 3:{ct.i=et.int64();break}case 4:{ct.s=et.bytes();break}case 5:{ct.t=nt.onnx.TensorProto.decode(et,et.uint32());break}case 6:{ct.g=nt.onnx.GraphProto.decode(et,et.uint32());break}case 22:{ct.sparseTensor=nt.onnx.SparseTensorProto.decode(et,et.uint32());break}case 14:{ct.tp=nt.onnx.TypeProto.decode(et,et.uint32());break}case 7:{if(ct.floats&&ct.floats.length||(ct.floats=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.floats.push(et.float());else ct.floats.push(et.float());break}case 8:{if(ct.ints&&ct.ints.length||(ct.ints=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.ints.push(et.int64());else ct.ints.push(et.int64());break}case 9:{ct.strings&&ct.strings.length||(ct.strings=[]),ct.strings.push(et.bytes());break}case 10:{ct.tensors&&ct.tensors.length||(ct.tensors=[]),ct.tensors.push(nt.onnx.TensorProto.decode(et,et.uint32()));break}case 11:{ct.graphs&&ct.graphs.length||(ct.graphs=[]),ct.graphs.push(nt.onnx.GraphProto.decode(et,et.uint32()));break}case 23:{ct.sparseTensors&&ct.sparseTensors.length||(ct.sparseTensors=[]),ct.sparseTensors.push(nt.onnx.SparseTensorProto.decode(et,et.uint32()));break}case 15:{ct.typeProtos&&ct.typeProtos.length||(ct.typeProtos=[]),ct.typeProtos.push(nt.onnx.TypeProto.decode(et,et.uint32()));break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.name!=null&&et.hasOwnProperty("name")&&!c.isString(et.name))return"name: string expected";if(et.refAttrName!=null&&et.hasOwnProperty("refAttrName")&&!c.isString(et.refAttrName))return"refAttrName: string expected";if(et.docString!=null&&et.hasOwnProperty("docString")&&!c.isString(et.docString))return"docString: string expected";if(et.type!=null&&et.hasOwnProperty("type"))switch(et.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 11:case 13:case 6:case 7:case 8:case 9:case 10:case 12:case 14:break}if(et.f!=null&&et.hasOwnProperty("f")&&typeof et.f!="number")return"f: number expected";if(et.i!=null&&et.hasOwnProperty("i")&&!c.isInteger(et.i)&&!(et.i&&c.isInteger(et.i.low)&&c.isInteger(et.i.high)))return"i: integer|Long expected";if(et.s!=null&&et.hasOwnProperty("s")&&!(et.s&&typeof et.s.length=="number"||c.isString(et.s)))return"s: buffer expected";if(et.t!=null&&et.hasOwnProperty("t")){var it=nt.onnx.TensorProto.verify(et.t);if(it)return"t."+it}if(et.g!=null&&et.hasOwnProperty("g")){var it=nt.onnx.GraphProto.verify(et.g);if(it)return"g."+it}if(et.sparseTensor!=null&&et.hasOwnProperty("sparseTensor")){var it=nt.onnx.SparseTensorProto.verify(et.sparseTensor);if(it)return"sparseTensor."+it}if(et.tp!=null&&et.hasOwnProperty("tp")){var it=nt.onnx.TypeProto.verify(et.tp);if(it)return"tp."+it}if(et.floats!=null&&et.hasOwnProperty("floats")){if(!Array.isArray(et.floats))return"floats: array expected";for(var st=0;st<et.floats.length;++st)if(typeof et.floats[st]!="number")return"floats: number[] expected"}if(et.ints!=null&&et.hasOwnProperty("ints")){if(!Array.isArray(et.ints))return"ints: array expected";for(var st=0;st<et.ints.length;++st)if(!c.isInteger(et.ints[st])&&!(et.ints[st]&&c.isInteger(et.ints[st].low)&&c.isInteger(et.ints[st].high)))return"ints: integer|Long[] expected"}if(et.strings!=null&&et.hasOwnProperty("strings")){if(!Array.isArray(et.strings))return"strings: array expected";for(var st=0;st<et.strings.length;++st)if(!(et.strings[st]&&typeof et.strings[st].length=="number"||c.isString(et.strings[st])))return"strings: buffer[] expected"}if(et.tensors!=null&&et.hasOwnProperty("tensors")){if(!Array.isArray(et.tensors))return"tensors: array expected";for(var st=0;st<et.tensors.length;++st){var it=nt.onnx.TensorProto.verify(et.tensors[st]);if(it)return"tensors."+it}}if(et.graphs!=null&&et.hasOwnProperty("graphs")){if(!Array.isArray(et.graphs))return"graphs: array expected";for(var st=0;st<et.graphs.length;++st){var it=nt.onnx.GraphProto.verify(et.graphs[st]);if(it)return"graphs."+it}}if(et.sparseTensors!=null&&et.hasOwnProperty("sparseTensors")){if(!Array.isArray(et.sparseTensors))return"sparseTensors: array expected";for(var st=0;st<et.sparseTensors.length;++st){var it=nt.onnx.SparseTensorProto.verify(et.sparseTensors[st]);if(it)return"sparseTensors."+it}}if(et.typeProtos!=null&&et.hasOwnProperty("typeProtos")){if(!Array.isArray(et.typeProtos))return"typeProtos: array expected";for(var st=0;st<et.typeProtos.length;++st){var it=nt.onnx.TypeProto.verify(et.typeProtos[st]);if(it)return"typeProtos."+it}}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.AttributeProto)return et;var it=new nt.onnx.AttributeProto;switch(et.name!=null&&(it.name=String(et.name)),et.refAttrName!=null&&(it.refAttrName=String(et.refAttrName)),et.docString!=null&&(it.docString=String(et.docString)),et.type){default:if(typeof et.type=="number"){it.type=et.type;break}break;case"UNDEFINED":case 0:it.type=0;break;case"FLOAT":case 1:it.type=1;break;case"INT":case 2:it.type=2;break;case"STRING":case 3:it.type=3;break;case"TENSOR":case 4:it.type=4;break;case"GRAPH":case 5:it.type=5;break;case"SPARSE_TENSOR":case 11:it.type=11;break;case"TYPE_PROTO":case 13:it.type=13;break;case"FLOATS":case 6:it.type=6;break;case"INTS":case 7:it.type=7;break;case"STRINGS":case 8:it.type=8;break;case"TENSORS":case 9:it.type=9;break;case"GRAPHS":case 10:it.type=10;break;case"SPARSE_TENSORS":case 12:it.type=12;break;case"TYPE_PROTOS":case 14:it.type=14;break}if(et.f!=null&&(it.f=Number(et.f)),et.i!=null&&(c.Long?(it.i=c.Long.fromValue(et.i)).unsigned=!1:typeof et.i=="string"?it.i=parseInt(et.i,10):typeof et.i=="number"?it.i=et.i:typeof et.i=="object"&&(it.i=new c.LongBits(et.i.low>>>0,et.i.high>>>0).toNumber())),et.s!=null&&(typeof et.s=="string"?c.base64.decode(et.s,it.s=c.newBuffer(c.base64.length(et.s)),0):et.s.length>=0&&(it.s=et.s)),et.t!=null){if(typeof et.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");it.t=nt.onnx.TensorProto.fromObject(et.t)}if(et.g!=null){if(typeof et.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");it.g=nt.onnx.GraphProto.fromObject(et.g)}if(et.sparseTensor!=null){if(typeof et.sparseTensor!="object")throw TypeError(".onnx.AttributeProto.sparseTensor: object expected");it.sparseTensor=nt.onnx.SparseTensorProto.fromObject(et.sparseTensor)}if(et.tp!=null){if(typeof et.tp!="object")throw TypeError(".onnx.AttributeProto.tp: object expected");it.tp=nt.onnx.TypeProto.fromObject(et.tp)}if(et.floats){if(!Array.isArray(et.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");it.floats=[];for(var st=0;st<et.floats.length;++st)it.floats[st]=Number(et.floats[st])}if(et.ints){if(!Array.isArray(et.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");it.ints=[];for(var st=0;st<et.ints.length;++st)c.Long?(it.ints[st]=c.Long.fromValue(et.ints[st])).unsigned=!1:typeof et.ints[st]=="string"?it.ints[st]=parseInt(et.ints[st],10):typeof et.ints[st]=="number"?it.ints[st]=et.ints[st]:typeof et.ints[st]=="object"&&(it.ints[st]=new c.LongBits(et.ints[st].low>>>0,et.ints[st].high>>>0).toNumber())}if(et.strings){if(!Array.isArray(et.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");it.strings=[];for(var st=0;st<et.strings.length;++st)typeof et.strings[st]=="string"?c.base64.decode(et.strings[st],it.strings[st]=c.newBuffer(c.base64.length(et.strings[st])),0):et.strings[st].length>=0&&(it.strings[st]=et.strings[st])}if(et.tensors){if(!Array.isArray(et.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");it.tensors=[];for(var st=0;st<et.tensors.length;++st){if(typeof et.tensors[st]!="object")throw TypeError(".onnx.AttributeProto.tensors: object expected");it.tensors[st]=nt.onnx.TensorProto.fromObject(et.tensors[st])}}if(et.graphs){if(!Array.isArray(et.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");it.graphs=[];for(var st=0;st<et.graphs.length;++st){if(typeof et.graphs[st]!="object")throw TypeError(".onnx.AttributeProto.graphs: object expected");it.graphs[st]=nt.onnx.GraphProto.fromObject(et.graphs[st])}}if(et.sparseTensors){if(!Array.isArray(et.sparseTensors))throw TypeError(".onnx.AttributeProto.sparseTensors: array expected");it.sparseTensors=[];for(var st=0;st<et.sparseTensors.length;++st){if(typeof et.sparseTensors[st]!="object")throw TypeError(".onnx.AttributeProto.sparseTensors: object expected");it.sparseTensors[st]=nt.onnx.SparseTensorProto.fromObject(et.sparseTensors[st])}}if(et.typeProtos){if(!Array.isArray(et.typeProtos))throw TypeError(".onnx.AttributeProto.typeProtos: array expected");it.typeProtos=[];for(var st=0;st<et.typeProtos.length;++st){if(typeof et.typeProtos[st]!="object")throw TypeError(".onnx.AttributeProto.typeProtos: object expected");it.typeProtos[st]=nt.onnx.TypeProto.fromObject(et.typeProtos[st])}}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.floats=[],st.ints=[],st.strings=[],st.tensors=[],st.graphs=[],st.typeProtos=[],st.sparseTensors=[]),it.defaults){if(st.name="",st.f=0,c.Long){var ct=new c.Long(0,0,!1);st.i=it.longs===String?ct.toString():it.longs===Number?ct.toNumber():ct}else st.i=it.longs===String?"0":0;it.bytes===String?st.s="":(st.s=[],it.bytes!==Array&&(st.s=c.newBuffer(st.s))),st.t=null,st.g=null,st.docString="",st.tp=null,st.type=it.enums===String?"UNDEFINED":0,st.refAttrName="",st.sparseTensor=null}if(et.name!=null&&et.hasOwnProperty("name")&&(st.name=et.name),et.f!=null&&et.hasOwnProperty("f")&&(st.f=it.json&&!isFinite(et.f)?String(et.f):et.f),et.i!=null&&et.hasOwnProperty("i")&&(typeof et.i=="number"?st.i=it.longs===String?String(et.i):et.i:st.i=it.longs===String?c.Long.prototype.toString.call(et.i):it.longs===Number?new c.LongBits(et.i.low>>>0,et.i.high>>>0).toNumber():et.i),et.s!=null&&et.hasOwnProperty("s")&&(st.s=it.bytes===String?c.base64.encode(et.s,0,et.s.length):it.bytes===Array?Array.prototype.slice.call(et.s):et.s),et.t!=null&&et.hasOwnProperty("t")&&(st.t=nt.onnx.TensorProto.toObject(et.t,it)),et.g!=null&&et.hasOwnProperty("g")&&(st.g=nt.onnx.GraphProto.toObject(et.g,it)),et.floats&&et.floats.length){st.floats=[];for(var ft=0;ft<et.floats.length;++ft)st.floats[ft]=it.json&&!isFinite(et.floats[ft])?String(et.floats[ft]):et.floats[ft]}if(et.ints&&et.ints.length){st.ints=[];for(var ft=0;ft<et.ints.length;++ft)typeof et.ints[ft]=="number"?st.ints[ft]=it.longs===String?String(et.ints[ft]):et.ints[ft]:st.ints[ft]=it.longs===String?c.Long.prototype.toString.call(et.ints[ft]):it.longs===Number?new c.LongBits(et.ints[ft].low>>>0,et.ints[ft].high>>>0).toNumber():et.ints[ft]}if(et.strings&&et.strings.length){st.strings=[];for(var ft=0;ft<et.strings.length;++ft)st.strings[ft]=it.bytes===String?c.base64.encode(et.strings[ft],0,et.strings[ft].length):it.bytes===Array?Array.prototype.slice.call(et.strings[ft]):et.strings[ft]}if(et.tensors&&et.tensors.length){st.tensors=[];for(var ft=0;ft<et.tensors.length;++ft)st.tensors[ft]=nt.onnx.TensorProto.toObject(et.tensors[ft],it)}if(et.graphs&&et.graphs.length){st.graphs=[];for(var ft=0;ft<et.graphs.length;++ft)st.graphs[ft]=nt.onnx.GraphProto.toObject(et.graphs[ft],it)}if(et.docString!=null&&et.hasOwnProperty("docString")&&(st.docString=et.docString),et.tp!=null&&et.hasOwnProperty("tp")&&(st.tp=nt.onnx.TypeProto.toObject(et.tp,it)),et.typeProtos&&et.typeProtos.length){st.typeProtos=[];for(var ft=0;ft<et.typeProtos.length;++ft)st.typeProtos[ft]=nt.onnx.TypeProto.toObject(et.typeProtos[ft],it)}if(et.type!=null&&et.hasOwnProperty("type")&&(st.type=it.enums===String?nt.onnx.AttributeProto.AttributeType[et.type]===void 0?et.type:nt.onnx.AttributeProto.AttributeType[et.type]:et.type),et.refAttrName!=null&&et.hasOwnProperty("refAttrName")&&(st.refAttrName=et.refAttrName),et.sparseTensor!=null&&et.hasOwnProperty("sparseTensor")&&(st.sparseTensor=nt.onnx.SparseTensorProto.toObject(et.sparseTensor,it)),et.sparseTensors&&et.sparseTensors.length){st.sparseTensors=[];for(var ft=0;ft<et.sparseTensors.length;++ft)st.sparseTensors[ft]=nt.onnx.SparseTensorProto.toObject(et.sparseTensors[ft],it)}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.AttributeProto"},lt.AttributeType=function(){var et={},it=Object.create(et);return it[et[0]="UNDEFINED"]=0,it[et[1]="FLOAT"]=1,it[et[2]="INT"]=2,it[et[3]="STRING"]=3,it[et[4]="TENSOR"]=4,it[et[5]="GRAPH"]=5,it[et[11]="SPARSE_TENSOR"]=11,it[et[13]="TYPE_PROTO"]=13,it[et[6]="FLOATS"]=6,it[et[7]="INTS"]=7,it[et[8]="STRINGS"]=8,it[et[9]="TENSORS"]=9,it[et[10]="GRAPHS"]=10,it[et[12]="SPARSE_TENSORS"]=12,it[et[14]="TYPE_PROTOS"]=14,it}(),lt}(),at.ValueInfoProto=function(){function lt(et){if(et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.name="",lt.prototype.type=null,lt.prototype.docString="",lt.create=function(et){return new lt(et)},lt.encode=function(et,it){return it||(it=$.create()),et.name!=null&&Object.hasOwnProperty.call(et,"name")&&it.uint32(10).string(et.name),et.type!=null&&Object.hasOwnProperty.call(et,"type")&&nt.onnx.TypeProto.encode(et.type,it.uint32(18).fork()).ldelim(),et.docString!=null&&Object.hasOwnProperty.call(et,"docString")&&it.uint32(26).string(et.docString),it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.ValueInfoProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.name=et.string();break}case 2:{ct.type=nt.onnx.TypeProto.decode(et,et.uint32());break}case 3:{ct.docString=et.string();break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.name!=null&&et.hasOwnProperty("name")&&!c.isString(et.name))return"name: string expected";if(et.type!=null&&et.hasOwnProperty("type")){var it=nt.onnx.TypeProto.verify(et.type);if(it)return"type."+it}return et.docString!=null&&et.hasOwnProperty("docString")&&!c.isString(et.docString)?"docString: string expected":null},lt.fromObject=function(et){if(et instanceof nt.onnx.ValueInfoProto)return et;var it=new nt.onnx.ValueInfoProto;if(et.name!=null&&(it.name=String(et.name)),et.type!=null){if(typeof et.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");it.type=nt.onnx.TypeProto.fromObject(et.type)}return et.docString!=null&&(it.docString=String(et.docString)),it},lt.toObject=function(et,it){it||(it={});var st={};return it.defaults&&(st.name="",st.type=null,st.docString=""),et.name!=null&&et.hasOwnProperty("name")&&(st.name=et.name),et.type!=null&&et.hasOwnProperty("type")&&(st.type=nt.onnx.TypeProto.toObject(et.type,it)),et.docString!=null&&et.hasOwnProperty("docString")&&(st.docString=et.docString),st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.ValueInfoProto"},lt}(),at.NodeProto=function(){function lt(et){if(this.input=[],this.output=[],this.attribute=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.input=c.emptyArray,lt.prototype.output=c.emptyArray,lt.prototype.name="",lt.prototype.opType="",lt.prototype.domain="",lt.prototype.attribute=c.emptyArray,lt.prototype.docString="",lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.input!=null&&et.input.length)for(var st=0;st<et.input.length;++st)it.uint32(10).string(et.input[st]);if(et.output!=null&&et.output.length)for(var st=0;st<et.output.length;++st)it.uint32(18).string(et.output[st]);if(et.name!=null&&Object.hasOwnProperty.call(et,"name")&&it.uint32(26).string(et.name),et.opType!=null&&Object.hasOwnProperty.call(et,"opType")&&it.uint32(34).string(et.opType),et.attribute!=null&&et.attribute.length)for(var st=0;st<et.attribute.length;++st)nt.onnx.AttributeProto.encode(et.attribute[st],it.uint32(42).fork()).ldelim();return et.docString!=null&&Object.hasOwnProperty.call(et,"docString")&&it.uint32(50).string(et.docString),et.domain!=null&&Object.hasOwnProperty.call(et,"domain")&&it.uint32(58).string(et.domain),it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.NodeProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.input&&ct.input.length||(ct.input=[]),ct.input.push(et.string());break}case 2:{ct.output&&ct.output.length||(ct.output=[]),ct.output.push(et.string());break}case 3:{ct.name=et.string();break}case 4:{ct.opType=et.string();break}case 7:{ct.domain=et.string();break}case 5:{ct.attribute&&ct.attribute.length||(ct.attribute=[]),ct.attribute.push(nt.onnx.AttributeProto.decode(et,et.uint32()));break}case 6:{ct.docString=et.string();break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.input!=null&&et.hasOwnProperty("input")){if(!Array.isArray(et.input))return"input: array expected";for(var it=0;it<et.input.length;++it)if(!c.isString(et.input[it]))return"input: string[] expected"}if(et.output!=null&&et.hasOwnProperty("output")){if(!Array.isArray(et.output))return"output: array expected";for(var it=0;it<et.output.length;++it)if(!c.isString(et.output[it]))return"output: string[] expected"}if(et.name!=null&&et.hasOwnProperty("name")&&!c.isString(et.name))return"name: string expected";if(et.opType!=null&&et.hasOwnProperty("opType")&&!c.isString(et.opType))return"opType: string expected";if(et.domain!=null&&et.hasOwnProperty("domain")&&!c.isString(et.domain))return"domain: string expected";if(et.attribute!=null&&et.hasOwnProperty("attribute")){if(!Array.isArray(et.attribute))return"attribute: array expected";for(var it=0;it<et.attribute.length;++it){var st=nt.onnx.AttributeProto.verify(et.attribute[it]);if(st)return"attribute."+st}}return et.docString!=null&&et.hasOwnProperty("docString")&&!c.isString(et.docString)?"docString: string expected":null},lt.fromObject=function(et){if(et instanceof nt.onnx.NodeProto)return et;var it=new nt.onnx.NodeProto;if(et.input){if(!Array.isArray(et.input))throw TypeError(".onnx.NodeProto.input: array expected");it.input=[];for(var st=0;st<et.input.length;++st)it.input[st]=String(et.input[st])}if(et.output){if(!Array.isArray(et.output))throw TypeError(".onnx.NodeProto.output: array expected");it.output=[];for(var st=0;st<et.output.length;++st)it.output[st]=String(et.output[st])}if(et.name!=null&&(it.name=String(et.name)),et.opType!=null&&(it.opType=String(et.opType)),et.domain!=null&&(it.domain=String(et.domain)),et.attribute){if(!Array.isArray(et.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");it.attribute=[];for(var st=0;st<et.attribute.length;++st){if(typeof et.attribute[st]!="object")throw TypeError(".onnx.NodeProto.attribute: object expected");it.attribute[st]=nt.onnx.AttributeProto.fromObject(et.attribute[st])}}return et.docString!=null&&(it.docString=String(et.docString)),it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.input=[],st.output=[],st.attribute=[]),it.defaults&&(st.name="",st.opType="",st.docString="",st.domain=""),et.input&&et.input.length){st.input=[];for(var ct=0;ct<et.input.length;++ct)st.input[ct]=et.input[ct]}if(et.output&&et.output.length){st.output=[];for(var ct=0;ct<et.output.length;++ct)st.output[ct]=et.output[ct]}if(et.name!=null&&et.hasOwnProperty("name")&&(st.name=et.name),et.opType!=null&&et.hasOwnProperty("opType")&&(st.opType=et.opType),et.attribute&&et.attribute.length){st.attribute=[];for(var ct=0;ct<et.attribute.length;++ct)st.attribute[ct]=nt.onnx.AttributeProto.toObject(et.attribute[ct],it)}return et.docString!=null&&et.hasOwnProperty("docString")&&(st.docString=et.docString),et.domain!=null&&et.hasOwnProperty("domain")&&(st.domain=et.domain),st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.NodeProto"},lt}(),at.TrainingInfoProto=function(){function lt(et){if(this.initializationBinding=[],this.updateBinding=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.initialization=null,lt.prototype.algorithm=null,lt.prototype.initializationBinding=c.emptyArray,lt.prototype.updateBinding=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.initialization!=null&&Object.hasOwnProperty.call(et,"initialization")&&nt.onnx.GraphProto.encode(et.initialization,it.uint32(10).fork()).ldelim(),et.algorithm!=null&&Object.hasOwnProperty.call(et,"algorithm")&&nt.onnx.GraphProto.encode(et.algorithm,it.uint32(18).fork()).ldelim(),et.initializationBinding!=null&&et.initializationBinding.length)for(var st=0;st<et.initializationBinding.length;++st)nt.onnx.StringStringEntryProto.encode(et.initializationBinding[st],it.uint32(26).fork()).ldelim();if(et.updateBinding!=null&&et.updateBinding.length)for(var st=0;st<et.updateBinding.length;++st)nt.onnx.StringStringEntryProto.encode(et.updateBinding[st],it.uint32(34).fork()).ldelim();return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.TrainingInfoProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.initialization=nt.onnx.GraphProto.decode(et,et.uint32());break}case 2:{ct.algorithm=nt.onnx.GraphProto.decode(et,et.uint32());break}case 3:{ct.initializationBinding&&ct.initializationBinding.length||(ct.initializationBinding=[]),ct.initializationBinding.push(nt.onnx.StringStringEntryProto.decode(et,et.uint32()));break}case 4:{ct.updateBinding&&ct.updateBinding.length||(ct.updateBinding=[]),ct.updateBinding.push(nt.onnx.StringStringEntryProto.decode(et,et.uint32()));break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.initialization!=null&&et.hasOwnProperty("initialization")){var it=nt.onnx.GraphProto.verify(et.initialization);if(it)return"initialization."+it}if(et.algorithm!=null&&et.hasOwnProperty("algorithm")){var it=nt.onnx.GraphProto.verify(et.algorithm);if(it)return"algorithm."+it}if(et.initializationBinding!=null&&et.hasOwnProperty("initializationBinding")){if(!Array.isArray(et.initializationBinding))return"initializationBinding: array expected";for(var st=0;st<et.initializationBinding.length;++st){var it=nt.onnx.StringStringEntryProto.verify(et.initializationBinding[st]);if(it)return"initializationBinding."+it}}if(et.updateBinding!=null&&et.hasOwnProperty("updateBinding")){if(!Array.isArray(et.updateBinding))return"updateBinding: array expected";for(var st=0;st<et.updateBinding.length;++st){var it=nt.onnx.StringStringEntryProto.verify(et.updateBinding[st]);if(it)return"updateBinding."+it}}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.TrainingInfoProto)return et;var it=new nt.onnx.TrainingInfoProto;if(et.initialization!=null){if(typeof et.initialization!="object")throw TypeError(".onnx.TrainingInfoProto.initialization: object expected");it.initialization=nt.onnx.GraphProto.fromObject(et.initialization)}if(et.algorithm!=null){if(typeof et.algorithm!="object")throw TypeError(".onnx.TrainingInfoProto.algorithm: object expected");it.algorithm=nt.onnx.GraphProto.fromObject(et.algorithm)}if(et.initializationBinding){if(!Array.isArray(et.initializationBinding))throw TypeError(".onnx.TrainingInfoProto.initializationBinding: array expected");it.initializationBinding=[];for(var st=0;st<et.initializationBinding.length;++st){if(typeof et.initializationBinding[st]!="object")throw TypeError(".onnx.TrainingInfoProto.initializationBinding: object expected");it.initializationBinding[st]=nt.onnx.StringStringEntryProto.fromObject(et.initializationBinding[st])}}if(et.updateBinding){if(!Array.isArray(et.updateBinding))throw TypeError(".onnx.TrainingInfoProto.updateBinding: array expected");it.updateBinding=[];for(var st=0;st<et.updateBinding.length;++st){if(typeof et.updateBinding[st]!="object")throw TypeError(".onnx.TrainingInfoProto.updateBinding: object expected");it.updateBinding[st]=nt.onnx.StringStringEntryProto.fromObject(et.updateBinding[st])}}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.initializationBinding=[],st.updateBinding=[]),it.defaults&&(st.initialization=null,st.algorithm=null),et.initialization!=null&&et.hasOwnProperty("initialization")&&(st.initialization=nt.onnx.GraphProto.toObject(et.initialization,it)),et.algorithm!=null&&et.hasOwnProperty("algorithm")&&(st.algorithm=nt.onnx.GraphProto.toObject(et.algorithm,it)),et.initializationBinding&&et.initializationBinding.length){st.initializationBinding=[];for(var ct=0;ct<et.initializationBinding.length;++ct)st.initializationBinding[ct]=nt.onnx.StringStringEntryProto.toObject(et.initializationBinding[ct],it)}if(et.updateBinding&&et.updateBinding.length){st.updateBinding=[];for(var ct=0;ct<et.updateBinding.length;++ct)st.updateBinding[ct]=nt.onnx.StringStringEntryProto.toObject(et.updateBinding[ct],it)}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.TrainingInfoProto"},lt}(),at.ModelProto=function(){function lt(et){if(this.opsetImport=[],this.metadataProps=[],this.trainingInfo=[],this.functions=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.irVersion=c.Long?c.Long.fromBits(0,0,!1):0,lt.prototype.opsetImport=c.emptyArray,lt.prototype.producerName="",lt.prototype.producerVersion="",lt.prototype.domain="",lt.prototype.modelVersion=c.Long?c.Long.fromBits(0,0,!1):0,lt.prototype.docString="",lt.prototype.graph=null,lt.prototype.metadataProps=c.emptyArray,lt.prototype.trainingInfo=c.emptyArray,lt.prototype.functions=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.irVersion!=null&&Object.hasOwnProperty.call(et,"irVersion")&&it.uint32(8).int64(et.irVersion),et.producerName!=null&&Object.hasOwnProperty.call(et,"producerName")&&it.uint32(18).string(et.producerName),et.producerVersion!=null&&Object.hasOwnProperty.call(et,"producerVersion")&&it.uint32(26).string(et.producerVersion),et.domain!=null&&Object.hasOwnProperty.call(et,"domain")&&it.uint32(34).string(et.domain),et.modelVersion!=null&&Object.hasOwnProperty.call(et,"modelVersion")&&it.uint32(40).int64(et.modelVersion),et.docString!=null&&Object.hasOwnProperty.call(et,"docString")&&it.uint32(50).string(et.docString),et.graph!=null&&Object.hasOwnProperty.call(et,"graph")&&nt.onnx.GraphProto.encode(et.graph,it.uint32(58).fork()).ldelim(),et.opsetImport!=null&&et.opsetImport.length)for(var st=0;st<et.opsetImport.length;++st)nt.onnx.OperatorSetIdProto.encode(et.opsetImport[st],it.uint32(66).fork()).ldelim();if(et.metadataProps!=null&&et.metadataProps.length)for(var st=0;st<et.metadataProps.length;++st)nt.onnx.StringStringEntryProto.encode(et.metadataProps[st],it.uint32(114).fork()).ldelim();if(et.trainingInfo!=null&&et.trainingInfo.length)for(var st=0;st<et.trainingInfo.length;++st)nt.onnx.TrainingInfoProto.encode(et.trainingInfo[st],it.uint32(162).fork()).ldelim();if(et.functions!=null&&et.functions.length)for(var st=0;st<et.functions.length;++st)nt.onnx.FunctionProto.encode(et.functions[st],it.uint32(202).fork()).ldelim();return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.ModelProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.irVersion=et.int64();break}case 8:{ct.opsetImport&&ct.opsetImport.length||(ct.opsetImport=[]),ct.opsetImport.push(nt.onnx.OperatorSetIdProto.decode(et,et.uint32()));break}case 2:{ct.producerName=et.string();break}case 3:{ct.producerVersion=et.string();break}case 4:{ct.domain=et.string();break}case 5:{ct.modelVersion=et.int64();break}case 6:{ct.docString=et.string();break}case 7:{ct.graph=nt.onnx.GraphProto.decode(et,et.uint32());break}case 14:{ct.metadataProps&&ct.metadataProps.length||(ct.metadataProps=[]),ct.metadataProps.push(nt.onnx.StringStringEntryProto.decode(et,et.uint32()));break}case 20:{ct.trainingInfo&&ct.trainingInfo.length||(ct.trainingInfo=[]),ct.trainingInfo.push(nt.onnx.TrainingInfoProto.decode(et,et.uint32()));break}case 25:{ct.functions&&ct.functions.length||(ct.functions=[]),ct.functions.push(nt.onnx.FunctionProto.decode(et,et.uint32()));break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.irVersion!=null&&et.hasOwnProperty("irVersion")&&!c.isInteger(et.irVersion)&&!(et.irVersion&&c.isInteger(et.irVersion.low)&&c.isInteger(et.irVersion.high)))return"irVersion: integer|Long expected";if(et.opsetImport!=null&&et.hasOwnProperty("opsetImport")){if(!Array.isArray(et.opsetImport))return"opsetImport: array expected";for(var it=0;it<et.opsetImport.length;++it){var st=nt.onnx.OperatorSetIdProto.verify(et.opsetImport[it]);if(st)return"opsetImport."+st}}if(et.producerName!=null&&et.hasOwnProperty("producerName")&&!c.isString(et.producerName))return"producerName: string expected";if(et.producerVersion!=null&&et.hasOwnProperty("producerVersion")&&!c.isString(et.producerVersion))return"producerVersion: string expected";if(et.domain!=null&&et.hasOwnProperty("domain")&&!c.isString(et.domain))return"domain: string expected";if(et.modelVersion!=null&&et.hasOwnProperty("modelVersion")&&!c.isInteger(et.modelVersion)&&!(et.modelVersion&&c.isInteger(et.modelVersion.low)&&c.isInteger(et.modelVersion.high)))return"modelVersion: integer|Long expected";if(et.docString!=null&&et.hasOwnProperty("docString")&&!c.isString(et.docString))return"docString: string expected";if(et.graph!=null&&et.hasOwnProperty("graph")){var st=nt.onnx.GraphProto.verify(et.graph);if(st)return"graph."+st}if(et.metadataProps!=null&&et.hasOwnProperty("metadataProps")){if(!Array.isArray(et.metadataProps))return"metadataProps: array expected";for(var it=0;it<et.metadataProps.length;++it){var st=nt.onnx.StringStringEntryProto.verify(et.metadataProps[it]);if(st)return"metadataProps."+st}}if(et.trainingInfo!=null&&et.hasOwnProperty("trainingInfo")){if(!Array.isArray(et.trainingInfo))return"trainingInfo: array expected";for(var it=0;it<et.trainingInfo.length;++it){var st=nt.onnx.TrainingInfoProto.verify(et.trainingInfo[it]);if(st)return"trainingInfo."+st}}if(et.functions!=null&&et.hasOwnProperty("functions")){if(!Array.isArray(et.functions))return"functions: array expected";for(var it=0;it<et.functions.length;++it){var st=nt.onnx.FunctionProto.verify(et.functions[it]);if(st)return"functions."+st}}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.ModelProto)return et;var it=new nt.onnx.ModelProto;if(et.irVersion!=null&&(c.Long?(it.irVersion=c.Long.fromValue(et.irVersion)).unsigned=!1:typeof et.irVersion=="string"?it.irVersion=parseInt(et.irVersion,10):typeof et.irVersion=="number"?it.irVersion=et.irVersion:typeof et.irVersion=="object"&&(it.irVersion=new c.LongBits(et.irVersion.low>>>0,et.irVersion.high>>>0).toNumber())),et.opsetImport){if(!Array.isArray(et.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");it.opsetImport=[];for(var st=0;st<et.opsetImport.length;++st){if(typeof et.opsetImport[st]!="object")throw TypeError(".onnx.ModelProto.opsetImport: object expected");it.opsetImport[st]=nt.onnx.OperatorSetIdProto.fromObject(et.opsetImport[st])}}if(et.producerName!=null&&(it.producerName=String(et.producerName)),et.producerVersion!=null&&(it.producerVersion=String(et.producerVersion)),et.domain!=null&&(it.domain=String(et.domain)),et.modelVersion!=null&&(c.Long?(it.modelVersion=c.Long.fromValue(et.modelVersion)).unsigned=!1:typeof et.modelVersion=="string"?it.modelVersion=parseInt(et.modelVersion,10):typeof et.modelVersion=="number"?it.modelVersion=et.modelVersion:typeof et.modelVersion=="object"&&(it.modelVersion=new c.LongBits(et.modelVersion.low>>>0,et.modelVersion.high>>>0).toNumber())),et.docString!=null&&(it.docString=String(et.docString)),et.graph!=null){if(typeof et.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");it.graph=nt.onnx.GraphProto.fromObject(et.graph)}if(et.metadataProps){if(!Array.isArray(et.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");it.metadataProps=[];for(var st=0;st<et.metadataProps.length;++st){if(typeof et.metadataProps[st]!="object")throw TypeError(".onnx.ModelProto.metadataProps: object expected");it.metadataProps[st]=nt.onnx.StringStringEntryProto.fromObject(et.metadataProps[st])}}if(et.trainingInfo){if(!Array.isArray(et.trainingInfo))throw TypeError(".onnx.ModelProto.trainingInfo: array expected");it.trainingInfo=[];for(var st=0;st<et.trainingInfo.length;++st){if(typeof et.trainingInfo[st]!="object")throw TypeError(".onnx.ModelProto.trainingInfo: object expected");it.trainingInfo[st]=nt.onnx.TrainingInfoProto.fromObject(et.trainingInfo[st])}}if(et.functions){if(!Array.isArray(et.functions))throw TypeError(".onnx.ModelProto.functions: array expected");it.functions=[];for(var st=0;st<et.functions.length;++st){if(typeof et.functions[st]!="object")throw TypeError(".onnx.ModelProto.functions: object expected");it.functions[st]=nt.onnx.FunctionProto.fromObject(et.functions[st])}}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.opsetImport=[],st.metadataProps=[],st.trainingInfo=[],st.functions=[]),it.defaults){if(c.Long){var ct=new c.Long(0,0,!1);st.irVersion=it.longs===String?ct.toString():it.longs===Number?ct.toNumber():ct}else st.irVersion=it.longs===String?"0":0;if(st.producerName="",st.producerVersion="",st.domain="",c.Long){var ct=new c.Long(0,0,!1);st.modelVersion=it.longs===String?ct.toString():it.longs===Number?ct.toNumber():ct}else st.modelVersion=it.longs===String?"0":0;st.docString="",st.graph=null}if(et.irVersion!=null&&et.hasOwnProperty("irVersion")&&(typeof et.irVersion=="number"?st.irVersion=it.longs===String?String(et.irVersion):et.irVersion:st.irVersion=it.longs===String?c.Long.prototype.toString.call(et.irVersion):it.longs===Number?new c.LongBits(et.irVersion.low>>>0,et.irVersion.high>>>0).toNumber():et.irVersion),et.producerName!=null&&et.hasOwnProperty("producerName")&&(st.producerName=et.producerName),et.producerVersion!=null&&et.hasOwnProperty("producerVersion")&&(st.producerVersion=et.producerVersion),et.domain!=null&&et.hasOwnProperty("domain")&&(st.domain=et.domain),et.modelVersion!=null&&et.hasOwnProperty("modelVersion")&&(typeof et.modelVersion=="number"?st.modelVersion=it.longs===String?String(et.modelVersion):et.modelVersion:st.modelVersion=it.longs===String?c.Long.prototype.toString.call(et.modelVersion):it.longs===Number?new c.LongBits(et.modelVersion.low>>>0,et.modelVersion.high>>>0).toNumber():et.modelVersion),et.docString!=null&&et.hasOwnProperty("docString")&&(st.docString=et.docString),et.graph!=null&&et.hasOwnProperty("graph")&&(st.graph=nt.onnx.GraphProto.toObject(et.graph,it)),et.opsetImport&&et.opsetImport.length){st.opsetImport=[];for(var ft=0;ft<et.opsetImport.length;++ft)st.opsetImport[ft]=nt.onnx.OperatorSetIdProto.toObject(et.opsetImport[ft],it)}if(et.metadataProps&&et.metadataProps.length){st.metadataProps=[];for(var ft=0;ft<et.metadataProps.length;++ft)st.metadataProps[ft]=nt.onnx.StringStringEntryProto.toObject(et.metadataProps[ft],it)}if(et.trainingInfo&&et.trainingInfo.length){st.trainingInfo=[];for(var ft=0;ft<et.trainingInfo.length;++ft)st.trainingInfo[ft]=nt.onnx.TrainingInfoProto.toObject(et.trainingInfo[ft],it)}if(et.functions&&et.functions.length){st.functions=[];for(var ft=0;ft<et.functions.length;++ft)st.functions[ft]=nt.onnx.FunctionProto.toObject(et.functions[ft],it)}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.ModelProto"},lt}(),at.StringStringEntryProto=function(){function lt(et){if(et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.key="",lt.prototype.value="",lt.create=function(et){return new lt(et)},lt.encode=function(et,it){return it||(it=$.create()),et.key!=null&&Object.hasOwnProperty.call(et,"key")&&it.uint32(10).string(et.key),et.value!=null&&Object.hasOwnProperty.call(et,"value")&&it.uint32(18).string(et.value),it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.StringStringEntryProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.key=et.string();break}case 2:{ct.value=et.string();break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){return typeof et!="object"||et===null?"object expected":et.key!=null&&et.hasOwnProperty("key")&&!c.isString(et.key)?"key: string expected":et.value!=null&&et.hasOwnProperty("value")&&!c.isString(et.value)?"value: string expected":null},lt.fromObject=function(et){if(et instanceof nt.onnx.StringStringEntryProto)return et;var it=new nt.onnx.StringStringEntryProto;return et.key!=null&&(it.key=String(et.key)),et.value!=null&&(it.value=String(et.value)),it},lt.toObject=function(et,it){it||(it={});var st={};return it.defaults&&(st.key="",st.value=""),et.key!=null&&et.hasOwnProperty("key")&&(st.key=et.key),et.value!=null&&et.hasOwnProperty("value")&&(st.value=et.value),st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.StringStringEntryProto"},lt}(),at.TensorAnnotation=function(){function lt(et){if(this.quantParameterTensorNames=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.tensorName="",lt.prototype.quantParameterTensorNames=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.tensorName!=null&&Object.hasOwnProperty.call(et,"tensorName")&&it.uint32(10).string(et.tensorName),et.quantParameterTensorNames!=null&&et.quantParameterTensorNames.length)for(var st=0;st<et.quantParameterTensorNames.length;++st)nt.onnx.StringStringEntryProto.encode(et.quantParameterTensorNames[st],it.uint32(18).fork()).ldelim();return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.TensorAnnotation;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.tensorName=et.string();break}case 2:{ct.quantParameterTensorNames&&ct.quantParameterTensorNames.length||(ct.quantParameterTensorNames=[]),ct.quantParameterTensorNames.push(nt.onnx.StringStringEntryProto.decode(et,et.uint32()));break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.tensorName!=null&&et.hasOwnProperty("tensorName")&&!c.isString(et.tensorName))return"tensorName: string expected";if(et.quantParameterTensorNames!=null&&et.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(et.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var it=0;it<et.quantParameterTensorNames.length;++it){var st=nt.onnx.StringStringEntryProto.verify(et.quantParameterTensorNames[it]);if(st)return"quantParameterTensorNames."+st}}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.TensorAnnotation)return et;var it=new nt.onnx.TensorAnnotation;if(et.tensorName!=null&&(it.tensorName=String(et.tensorName)),et.quantParameterTensorNames){if(!Array.isArray(et.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");it.quantParameterTensorNames=[];for(var st=0;st<et.quantParameterTensorNames.length;++st){if(typeof et.quantParameterTensorNames[st]!="object")throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");it.quantParameterTensorNames[st]=nt.onnx.StringStringEntryProto.fromObject(et.quantParameterTensorNames[st])}}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.quantParameterTensorNames=[]),it.defaults&&(st.tensorName=""),et.tensorName!=null&&et.hasOwnProperty("tensorName")&&(st.tensorName=et.tensorName),et.quantParameterTensorNames&&et.quantParameterTensorNames.length){st.quantParameterTensorNames=[];for(var ct=0;ct<et.quantParameterTensorNames.length;++ct)st.quantParameterTensorNames[ct]=nt.onnx.StringStringEntryProto.toObject(et.quantParameterTensorNames[ct],it)}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.TensorAnnotation"},lt}(),at.GraphProto=function(){function lt(et){if(this.node=[],this.initializer=[],this.sparseInitializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.node=c.emptyArray,lt.prototype.name="",lt.prototype.initializer=c.emptyArray,lt.prototype.sparseInitializer=c.emptyArray,lt.prototype.docString="",lt.prototype.input=c.emptyArray,lt.prototype.output=c.emptyArray,lt.prototype.valueInfo=c.emptyArray,lt.prototype.quantizationAnnotation=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.node!=null&&et.node.length)for(var st=0;st<et.node.length;++st)nt.onnx.NodeProto.encode(et.node[st],it.uint32(10).fork()).ldelim();if(et.name!=null&&Object.hasOwnProperty.call(et,"name")&&it.uint32(18).string(et.name),et.initializer!=null&&et.initializer.length)for(var st=0;st<et.initializer.length;++st)nt.onnx.TensorProto.encode(et.initializer[st],it.uint32(42).fork()).ldelim();if(et.docString!=null&&Object.hasOwnProperty.call(et,"docString")&&it.uint32(82).string(et.docString),et.input!=null&&et.input.length)for(var st=0;st<et.input.length;++st)nt.onnx.ValueInfoProto.encode(et.input[st],it.uint32(90).fork()).ldelim();if(et.output!=null&&et.output.length)for(var st=0;st<et.output.length;++st)nt.onnx.ValueInfoProto.encode(et.output[st],it.uint32(98).fork()).ldelim();if(et.valueInfo!=null&&et.valueInfo.length)for(var st=0;st<et.valueInfo.length;++st)nt.onnx.ValueInfoProto.encode(et.valueInfo[st],it.uint32(106).fork()).ldelim();if(et.quantizationAnnotation!=null&&et.quantizationAnnotation.length)for(var st=0;st<et.quantizationAnnotation.length;++st)nt.onnx.TensorAnnotation.encode(et.quantizationAnnotation[st],it.uint32(114).fork()).ldelim();if(et.sparseInitializer!=null&&et.sparseInitializer.length)for(var st=0;st<et.sparseInitializer.length;++st)nt.onnx.SparseTensorProto.encode(et.sparseInitializer[st],it.uint32(122).fork()).ldelim();return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.GraphProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.node&&ct.node.length||(ct.node=[]),ct.node.push(nt.onnx.NodeProto.decode(et,et.uint32()));break}case 2:{ct.name=et.string();break}case 5:{ct.initializer&&ct.initializer.length||(ct.initializer=[]),ct.initializer.push(nt.onnx.TensorProto.decode(et,et.uint32()));break}case 15:{ct.sparseInitializer&&ct.sparseInitializer.length||(ct.sparseInitializer=[]),ct.sparseInitializer.push(nt.onnx.SparseTensorProto.decode(et,et.uint32()));break}case 10:{ct.docString=et.string();break}case 11:{ct.input&&ct.input.length||(ct.input=[]),ct.input.push(nt.onnx.ValueInfoProto.decode(et,et.uint32()));break}case 12:{ct.output&&ct.output.length||(ct.output=[]),ct.output.push(nt.onnx.ValueInfoProto.decode(et,et.uint32()));break}case 13:{ct.valueInfo&&ct.valueInfo.length||(ct.valueInfo=[]),ct.valueInfo.push(nt.onnx.ValueInfoProto.decode(et,et.uint32()));break}case 14:{ct.quantizationAnnotation&&ct.quantizationAnnotation.length||(ct.quantizationAnnotation=[]),ct.quantizationAnnotation.push(nt.onnx.TensorAnnotation.decode(et,et.uint32()));break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.node!=null&&et.hasOwnProperty("node")){if(!Array.isArray(et.node))return"node: array expected";for(var it=0;it<et.node.length;++it){var st=nt.onnx.NodeProto.verify(et.node[it]);if(st)return"node."+st}}if(et.name!=null&&et.hasOwnProperty("name")&&!c.isString(et.name))return"name: string expected";if(et.initializer!=null&&et.hasOwnProperty("initializer")){if(!Array.isArray(et.initializer))return"initializer: array expected";for(var it=0;it<et.initializer.length;++it){var st=nt.onnx.TensorProto.verify(et.initializer[it]);if(st)return"initializer."+st}}if(et.sparseInitializer!=null&&et.hasOwnProperty("sparseInitializer")){if(!Array.isArray(et.sparseInitializer))return"sparseInitializer: array expected";for(var it=0;it<et.sparseInitializer.length;++it){var st=nt.onnx.SparseTensorProto.verify(et.sparseInitializer[it]);if(st)return"sparseInitializer."+st}}if(et.docString!=null&&et.hasOwnProperty("docString")&&!c.isString(et.docString))return"docString: string expected";if(et.input!=null&&et.hasOwnProperty("input")){if(!Array.isArray(et.input))return"input: array expected";for(var it=0;it<et.input.length;++it){var st=nt.onnx.ValueInfoProto.verify(et.input[it]);if(st)return"input."+st}}if(et.output!=null&&et.hasOwnProperty("output")){if(!Array.isArray(et.output))return"output: array expected";for(var it=0;it<et.output.length;++it){var st=nt.onnx.ValueInfoProto.verify(et.output[it]);if(st)return"output."+st}}if(et.valueInfo!=null&&et.hasOwnProperty("valueInfo")){if(!Array.isArray(et.valueInfo))return"valueInfo: array expected";for(var it=0;it<et.valueInfo.length;++it){var st=nt.onnx.ValueInfoProto.verify(et.valueInfo[it]);if(st)return"valueInfo."+st}}if(et.quantizationAnnotation!=null&&et.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(et.quantizationAnnotation))return"quantizationAnnotation: array expected";for(var it=0;it<et.quantizationAnnotation.length;++it){var st=nt.onnx.TensorAnnotation.verify(et.quantizationAnnotation[it]);if(st)return"quantizationAnnotation."+st}}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.GraphProto)return et;var it=new nt.onnx.GraphProto;if(et.node){if(!Array.isArray(et.node))throw TypeError(".onnx.GraphProto.node: array expected");it.node=[];for(var st=0;st<et.node.length;++st){if(typeof et.node[st]!="object")throw TypeError(".onnx.GraphProto.node: object expected");it.node[st]=nt.onnx.NodeProto.fromObject(et.node[st])}}if(et.name!=null&&(it.name=String(et.name)),et.initializer){if(!Array.isArray(et.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");it.initializer=[];for(var st=0;st<et.initializer.length;++st){if(typeof et.initializer[st]!="object")throw TypeError(".onnx.GraphProto.initializer: object expected");it.initializer[st]=nt.onnx.TensorProto.fromObject(et.initializer[st])}}if(et.sparseInitializer){if(!Array.isArray(et.sparseInitializer))throw TypeError(".onnx.GraphProto.sparseInitializer: array expected");it.sparseInitializer=[];for(var st=0;st<et.sparseInitializer.length;++st){if(typeof et.sparseInitializer[st]!="object")throw TypeError(".onnx.GraphProto.sparseInitializer: object expected");it.sparseInitializer[st]=nt.onnx.SparseTensorProto.fromObject(et.sparseInitializer[st])}}if(et.docString!=null&&(it.docString=String(et.docString)),et.input){if(!Array.isArray(et.input))throw TypeError(".onnx.GraphProto.input: array expected");it.input=[];for(var st=0;st<et.input.length;++st){if(typeof et.input[st]!="object")throw TypeError(".onnx.GraphProto.input: object expected");it.input[st]=nt.onnx.ValueInfoProto.fromObject(et.input[st])}}if(et.output){if(!Array.isArray(et.output))throw TypeError(".onnx.GraphProto.output: array expected");it.output=[];for(var st=0;st<et.output.length;++st){if(typeof et.output[st]!="object")throw TypeError(".onnx.GraphProto.output: object expected");it.output[st]=nt.onnx.ValueInfoProto.fromObject(et.output[st])}}if(et.valueInfo){if(!Array.isArray(et.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");it.valueInfo=[];for(var st=0;st<et.valueInfo.length;++st){if(typeof et.valueInfo[st]!="object")throw TypeError(".onnx.GraphProto.valueInfo: object expected");it.valueInfo[st]=nt.onnx.ValueInfoProto.fromObject(et.valueInfo[st])}}if(et.quantizationAnnotation){if(!Array.isArray(et.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");it.quantizationAnnotation=[];for(var st=0;st<et.quantizationAnnotation.length;++st){if(typeof et.quantizationAnnotation[st]!="object")throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");it.quantizationAnnotation[st]=nt.onnx.TensorAnnotation.fromObject(et.quantizationAnnotation[st])}}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.node=[],st.initializer=[],st.input=[],st.output=[],st.valueInfo=[],st.quantizationAnnotation=[],st.sparseInitializer=[]),it.defaults&&(st.name="",st.docString=""),et.node&&et.node.length){st.node=[];for(var ct=0;ct<et.node.length;++ct)st.node[ct]=nt.onnx.NodeProto.toObject(et.node[ct],it)}if(et.name!=null&&et.hasOwnProperty("name")&&(st.name=et.name),et.initializer&&et.initializer.length){st.initializer=[];for(var ct=0;ct<et.initializer.length;++ct)st.initializer[ct]=nt.onnx.TensorProto.toObject(et.initializer[ct],it)}if(et.docString!=null&&et.hasOwnProperty("docString")&&(st.docString=et.docString),et.input&&et.input.length){st.input=[];for(var ct=0;ct<et.input.length;++ct)st.input[ct]=nt.onnx.ValueInfoProto.toObject(et.input[ct],it)}if(et.output&&et.output.length){st.output=[];for(var ct=0;ct<et.output.length;++ct)st.output[ct]=nt.onnx.ValueInfoProto.toObject(et.output[ct],it)}if(et.valueInfo&&et.valueInfo.length){st.valueInfo=[];for(var ct=0;ct<et.valueInfo.length;++ct)st.valueInfo[ct]=nt.onnx.ValueInfoProto.toObject(et.valueInfo[ct],it)}if(et.quantizationAnnotation&&et.quantizationAnnotation.length){st.quantizationAnnotation=[];for(var ct=0;ct<et.quantizationAnnotation.length;++ct)st.quantizationAnnotation[ct]=nt.onnx.TensorAnnotation.toObject(et.quantizationAnnotation[ct],it)}if(et.sparseInitializer&&et.sparseInitializer.length){st.sparseInitializer=[];for(var ct=0;ct<et.sparseInitializer.length;++ct)st.sparseInitializer[ct]=nt.onnx.SparseTensorProto.toObject(et.sparseInitializer[ct],it)}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.GraphProto"},lt}(),at.TensorProto=function(){function lt(et){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.dims=c.emptyArray,lt.prototype.dataType=0,lt.prototype.segment=null,lt.prototype.floatData=c.emptyArray,lt.prototype.int32Data=c.emptyArray,lt.prototype.stringData=c.emptyArray,lt.prototype.int64Data=c.emptyArray,lt.prototype.name="",lt.prototype.docString="",lt.prototype.rawData=c.newBuffer([]),lt.prototype.externalData=c.emptyArray,lt.prototype.dataLocation=0,lt.prototype.doubleData=c.emptyArray,lt.prototype.uint64Data=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.dims!=null&&et.dims.length){it.uint32(10).fork();for(var st=0;st<et.dims.length;++st)it.int64(et.dims[st]);it.ldelim()}if(et.dataType!=null&&Object.hasOwnProperty.call(et,"dataType")&&it.uint32(16).int32(et.dataType),et.segment!=null&&Object.hasOwnProperty.call(et,"segment")&&nt.onnx.TensorProto.Segment.encode(et.segment,it.uint32(26).fork()).ldelim(),et.floatData!=null&&et.floatData.length){it.uint32(34).fork();for(var st=0;st<et.floatData.length;++st)it.float(et.floatData[st]);it.ldelim()}if(et.int32Data!=null&&et.int32Data.length){it.uint32(42).fork();for(var st=0;st<et.int32Data.length;++st)it.int32(et.int32Data[st]);it.ldelim()}if(et.stringData!=null&&et.stringData.length)for(var st=0;st<et.stringData.length;++st)it.uint32(50).bytes(et.stringData[st]);if(et.int64Data!=null&&et.int64Data.length){it.uint32(58).fork();for(var st=0;st<et.int64Data.length;++st)it.int64(et.int64Data[st]);it.ldelim()}if(et.name!=null&&Object.hasOwnProperty.call(et,"name")&&it.uint32(66).string(et.name),et.rawData!=null&&Object.hasOwnProperty.call(et,"rawData")&&it.uint32(74).bytes(et.rawData),et.doubleData!=null&&et.doubleData.length){it.uint32(82).fork();for(var st=0;st<et.doubleData.length;++st)it.double(et.doubleData[st]);it.ldelim()}if(et.uint64Data!=null&&et.uint64Data.length){it.uint32(90).fork();for(var st=0;st<et.uint64Data.length;++st)it.uint64(et.uint64Data[st]);it.ldelim()}if(et.docString!=null&&Object.hasOwnProperty.call(et,"docString")&&it.uint32(98).string(et.docString),et.externalData!=null&&et.externalData.length)for(var st=0;st<et.externalData.length;++st)nt.onnx.StringStringEntryProto.encode(et.externalData[st],it.uint32(106).fork()).ldelim();return et.dataLocation!=null&&Object.hasOwnProperty.call(et,"dataLocation")&&it.uint32(112).int32(et.dataLocation),it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.TensorProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{if(ct.dims&&ct.dims.length||(ct.dims=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.dims.push(et.int64());else ct.dims.push(et.int64());break}case 2:{ct.dataType=et.int32();break}case 3:{ct.segment=nt.onnx.TensorProto.Segment.decode(et,et.uint32());break}case 4:{if(ct.floatData&&ct.floatData.length||(ct.floatData=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.floatData.push(et.float());else ct.floatData.push(et.float());break}case 5:{if(ct.int32Data&&ct.int32Data.length||(ct.int32Data=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.int32Data.push(et.int32());else ct.int32Data.push(et.int32());break}case 6:{ct.stringData&&ct.stringData.length||(ct.stringData=[]),ct.stringData.push(et.bytes());break}case 7:{if(ct.int64Data&&ct.int64Data.length||(ct.int64Data=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.int64Data.push(et.int64());else ct.int64Data.push(et.int64());break}case 8:{ct.name=et.string();break}case 12:{ct.docString=et.string();break}case 9:{ct.rawData=et.bytes();break}case 13:{ct.externalData&&ct.externalData.length||(ct.externalData=[]),ct.externalData.push(nt.onnx.StringStringEntryProto.decode(et,et.uint32()));break}case 14:{ct.dataLocation=et.int32();break}case 10:{if(ct.doubleData&&ct.doubleData.length||(ct.doubleData=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.doubleData.push(et.double());else ct.doubleData.push(et.double());break}case 11:{if(ct.uint64Data&&ct.uint64Data.length||(ct.uint64Data=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.uint64Data.push(et.uint64());else ct.uint64Data.push(et.uint64());break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.dims!=null&&et.hasOwnProperty("dims")){if(!Array.isArray(et.dims))return"dims: array expected";for(var it=0;it<et.dims.length;++it)if(!c.isInteger(et.dims[it])&&!(et.dims[it]&&c.isInteger(et.dims[it].low)&&c.isInteger(et.dims[it].high)))return"dims: integer|Long[] expected"}if(et.dataType!=null&&et.hasOwnProperty("dataType")&&!c.isInteger(et.dataType))return"dataType: integer expected";if(et.segment!=null&&et.hasOwnProperty("segment")){var st=nt.onnx.TensorProto.Segment.verify(et.segment);if(st)return"segment."+st}if(et.floatData!=null&&et.hasOwnProperty("floatData")){if(!Array.isArray(et.floatData))return"floatData: array expected";for(var it=0;it<et.floatData.length;++it)if(typeof et.floatData[it]!="number")return"floatData: number[] expected"}if(et.int32Data!=null&&et.hasOwnProperty("int32Data")){if(!Array.isArray(et.int32Data))return"int32Data: array expected";for(var it=0;it<et.int32Data.length;++it)if(!c.isInteger(et.int32Data[it]))return"int32Data: integer[] expected"}if(et.stringData!=null&&et.hasOwnProperty("stringData")){if(!Array.isArray(et.stringData))return"stringData: array expected";for(var it=0;it<et.stringData.length;++it)if(!(et.stringData[it]&&typeof et.stringData[it].length=="number"||c.isString(et.stringData[it])))return"stringData: buffer[] expected"}if(et.int64Data!=null&&et.hasOwnProperty("int64Data")){if(!Array.isArray(et.int64Data))return"int64Data: array expected";for(var it=0;it<et.int64Data.length;++it)if(!c.isInteger(et.int64Data[it])&&!(et.int64Data[it]&&c.isInteger(et.int64Data[it].low)&&c.isInteger(et.int64Data[it].high)))return"int64Data: integer|Long[] expected"}if(et.name!=null&&et.hasOwnProperty("name")&&!c.isString(et.name))return"name: string expected";if(et.docString!=null&&et.hasOwnProperty("docString")&&!c.isString(et.docString))return"docString: string expected";if(et.rawData!=null&&et.hasOwnProperty("rawData")&&!(et.rawData&&typeof et.rawData.length=="number"||c.isString(et.rawData)))return"rawData: buffer expected";if(et.externalData!=null&&et.hasOwnProperty("externalData")){if(!Array.isArray(et.externalData))return"externalData: array expected";for(var it=0;it<et.externalData.length;++it){var st=nt.onnx.StringStringEntryProto.verify(et.externalData[it]);if(st)return"externalData."+st}}if(et.dataLocation!=null&&et.hasOwnProperty("dataLocation"))switch(et.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:break}if(et.doubleData!=null&&et.hasOwnProperty("doubleData")){if(!Array.isArray(et.doubleData))return"doubleData: array expected";for(var it=0;it<et.doubleData.length;++it)if(typeof et.doubleData[it]!="number")return"doubleData: number[] expected"}if(et.uint64Data!=null&&et.hasOwnProperty("uint64Data")){if(!Array.isArray(et.uint64Data))return"uint64Data: array expected";for(var it=0;it<et.uint64Data.length;++it)if(!c.isInteger(et.uint64Data[it])&&!(et.uint64Data[it]&&c.isInteger(et.uint64Data[it].low)&&c.isInteger(et.uint64Data[it].high)))return"uint64Data: integer|Long[] expected"}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.TensorProto)return et;var it=new nt.onnx.TensorProto;if(et.dims){if(!Array.isArray(et.dims))throw TypeError(".onnx.TensorProto.dims: array expected");it.dims=[];for(var st=0;st<et.dims.length;++st)c.Long?(it.dims[st]=c.Long.fromValue(et.dims[st])).unsigned=!1:typeof et.dims[st]=="string"?it.dims[st]=parseInt(et.dims[st],10):typeof et.dims[st]=="number"?it.dims[st]=et.dims[st]:typeof et.dims[st]=="object"&&(it.dims[st]=new c.LongBits(et.dims[st].low>>>0,et.dims[st].high>>>0).toNumber())}if(et.dataType!=null&&(it.dataType=et.dataType|0),et.segment!=null){if(typeof et.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");it.segment=nt.onnx.TensorProto.Segment.fromObject(et.segment)}if(et.floatData){if(!Array.isArray(et.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");it.floatData=[];for(var st=0;st<et.floatData.length;++st)it.floatData[st]=Number(et.floatData[st])}if(et.int32Data){if(!Array.isArray(et.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");it.int32Data=[];for(var st=0;st<et.int32Data.length;++st)it.int32Data[st]=et.int32Data[st]|0}if(et.stringData){if(!Array.isArray(et.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");it.stringData=[];for(var st=0;st<et.stringData.length;++st)typeof et.stringData[st]=="string"?c.base64.decode(et.stringData[st],it.stringData[st]=c.newBuffer(c.base64.length(et.stringData[st])),0):et.stringData[st].length>=0&&(it.stringData[st]=et.stringData[st])}if(et.int64Data){if(!Array.isArray(et.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");it.int64Data=[];for(var st=0;st<et.int64Data.length;++st)c.Long?(it.int64Data[st]=c.Long.fromValue(et.int64Data[st])).unsigned=!1:typeof et.int64Data[st]=="string"?it.int64Data[st]=parseInt(et.int64Data[st],10):typeof et.int64Data[st]=="number"?it.int64Data[st]=et.int64Data[st]:typeof et.int64Data[st]=="object"&&(it.int64Data[st]=new c.LongBits(et.int64Data[st].low>>>0,et.int64Data[st].high>>>0).toNumber())}if(et.name!=null&&(it.name=String(et.name)),et.docString!=null&&(it.docString=String(et.docString)),et.rawData!=null&&(typeof et.rawData=="string"?c.base64.decode(et.rawData,it.rawData=c.newBuffer(c.base64.length(et.rawData)),0):et.rawData.length>=0&&(it.rawData=et.rawData)),et.externalData){if(!Array.isArray(et.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");it.externalData=[];for(var st=0;st<et.externalData.length;++st){if(typeof et.externalData[st]!="object")throw TypeError(".onnx.TensorProto.externalData: object expected");it.externalData[st]=nt.onnx.StringStringEntryProto.fromObject(et.externalData[st])}}switch(et.dataLocation){default:if(typeof et.dataLocation=="number"){it.dataLocation=et.dataLocation;break}break;case"DEFAULT":case 0:it.dataLocation=0;break;case"EXTERNAL":case 1:it.dataLocation=1;break}if(et.doubleData){if(!Array.isArray(et.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");it.doubleData=[];for(var st=0;st<et.doubleData.length;++st)it.doubleData[st]=Number(et.doubleData[st])}if(et.uint64Data){if(!Array.isArray(et.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");it.uint64Data=[];for(var st=0;st<et.uint64Data.length;++st)c.Long?(it.uint64Data[st]=c.Long.fromValue(et.uint64Data[st])).unsigned=!0:typeof et.uint64Data[st]=="string"?it.uint64Data[st]=parseInt(et.uint64Data[st],10):typeof et.uint64Data[st]=="number"?it.uint64Data[st]=et.uint64Data[st]:typeof et.uint64Data[st]=="object"&&(it.uint64Data[st]=new c.LongBits(et.uint64Data[st].low>>>0,et.uint64Data[st].high>>>0).toNumber(!0))}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.dims=[],st.floatData=[],st.int32Data=[],st.stringData=[],st.int64Data=[],st.doubleData=[],st.uint64Data=[],st.externalData=[]),it.defaults&&(st.dataType=0,st.segment=null,st.name="",it.bytes===String?st.rawData="":(st.rawData=[],it.bytes!==Array&&(st.rawData=c.newBuffer(st.rawData))),st.docString="",st.dataLocation=it.enums===String?"DEFAULT":0),et.dims&&et.dims.length){st.dims=[];for(var ct=0;ct<et.dims.length;++ct)typeof et.dims[ct]=="number"?st.dims[ct]=it.longs===String?String(et.dims[ct]):et.dims[ct]:st.dims[ct]=it.longs===String?c.Long.prototype.toString.call(et.dims[ct]):it.longs===Number?new c.LongBits(et.dims[ct].low>>>0,et.dims[ct].high>>>0).toNumber():et.dims[ct]}if(et.dataType!=null&&et.hasOwnProperty("dataType")&&(st.dataType=et.dataType),et.segment!=null&&et.hasOwnProperty("segment")&&(st.segment=nt.onnx.TensorProto.Segment.toObject(et.segment,it)),et.floatData&&et.floatData.length){st.floatData=[];for(var ct=0;ct<et.floatData.length;++ct)st.floatData[ct]=it.json&&!isFinite(et.floatData[ct])?String(et.floatData[ct]):et.floatData[ct]}if(et.int32Data&&et.int32Data.length){st.int32Data=[];for(var ct=0;ct<et.int32Data.length;++ct)st.int32Data[ct]=et.int32Data[ct]}if(et.stringData&&et.stringData.length){st.stringData=[];for(var ct=0;ct<et.stringData.length;++ct)st.stringData[ct]=it.bytes===String?c.base64.encode(et.stringData[ct],0,et.stringData[ct].length):it.bytes===Array?Array.prototype.slice.call(et.stringData[ct]):et.stringData[ct]}if(et.int64Data&&et.int64Data.length){st.int64Data=[];for(var ct=0;ct<et.int64Data.length;++ct)typeof et.int64Data[ct]=="number"?st.int64Data[ct]=it.longs===String?String(et.int64Data[ct]):et.int64Data[ct]:st.int64Data[ct]=it.longs===String?c.Long.prototype.toString.call(et.int64Data[ct]):it.longs===Number?new c.LongBits(et.int64Data[ct].low>>>0,et.int64Data[ct].high>>>0).toNumber():et.int64Data[ct]}if(et.name!=null&&et.hasOwnProperty("name")&&(st.name=et.name),et.rawData!=null&&et.hasOwnProperty("rawData")&&(st.rawData=it.bytes===String?c.base64.encode(et.rawData,0,et.rawData.length):it.bytes===Array?Array.prototype.slice.call(et.rawData):et.rawData),et.doubleData&&et.doubleData.length){st.doubleData=[];for(var ct=0;ct<et.doubleData.length;++ct)st.doubleData[ct]=it.json&&!isFinite(et.doubleData[ct])?String(et.doubleData[ct]):et.doubleData[ct]}if(et.uint64Data&&et.uint64Data.length){st.uint64Data=[];for(var ct=0;ct<et.uint64Data.length;++ct)typeof et.uint64Data[ct]=="number"?st.uint64Data[ct]=it.longs===String?String(et.uint64Data[ct]):et.uint64Data[ct]:st.uint64Data[ct]=it.longs===String?c.Long.prototype.toString.call(et.uint64Data[ct]):it.longs===Number?new c.LongBits(et.uint64Data[ct].low>>>0,et.uint64Data[ct].high>>>0).toNumber(!0):et.uint64Data[ct]}if(et.docString!=null&&et.hasOwnProperty("docString")&&(st.docString=et.docString),et.externalData&&et.externalData.length){st.externalData=[];for(var ct=0;ct<et.externalData.length;++ct)st.externalData[ct]=nt.onnx.StringStringEntryProto.toObject(et.externalData[ct],it)}return et.dataLocation!=null&&et.hasOwnProperty("dataLocation")&&(st.dataLocation=it.enums===String?nt.onnx.TensorProto.DataLocation[et.dataLocation]===void 0?et.dataLocation:nt.onnx.TensorProto.DataLocation[et.dataLocation]:et.dataLocation),st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.TensorProto"},lt.DataType=function(){var et={},it=Object.create(et);return it[et[0]="UNDEFINED"]=0,it[et[1]="FLOAT"]=1,it[et[2]="UINT8"]=2,it[et[3]="INT8"]=3,it[et[4]="UINT16"]=4,it[et[5]="INT16"]=5,it[et[6]="INT32"]=6,it[et[7]="INT64"]=7,it[et[8]="STRING"]=8,it[et[9]="BOOL"]=9,it[et[10]="FLOAT16"]=10,it[et[11]="DOUBLE"]=11,it[et[12]="UINT32"]=12,it[et[13]="UINT64"]=13,it[et[14]="COMPLEX64"]=14,it[et[15]="COMPLEX128"]=15,it[et[16]="BFLOAT16"]=16,it[et[17]="FLOAT8E4M3FN"]=17,it[et[18]="FLOAT8E4M3FNUZ"]=18,it[et[19]="FLOAT8E5M2"]=19,it[et[20]="FLOAT8E5M2FNUZ"]=20,it}(),lt.Segment=function(){function et(it){if(it)for(var st=Object.keys(it),ct=0;ct<st.length;++ct)it[st[ct]]!=null&&(this[st[ct]]=it[st[ct]])}return et.prototype.begin=c.Long?c.Long.fromBits(0,0,!1):0,et.prototype.end=c.Long?c.Long.fromBits(0,0,!1):0,et.create=function(it){return new et(it)},et.encode=function(it,st){return st||(st=$.create()),it.begin!=null&&Object.hasOwnProperty.call(it,"begin")&&st.uint32(8).int64(it.begin),it.end!=null&&Object.hasOwnProperty.call(it,"end")&&st.uint32(16).int64(it.end),st},et.encodeDelimited=function(it,st){return this.encode(it,st).ldelim()},et.decode=function(it,st){it instanceof a||(it=a.create(it));for(var ct=st===void 0?it.len:it.pos+st,ft=new nt.onnx.TensorProto.Segment;it.pos<ct;){var pt=it.uint32();switch(pt>>>3){case 1:{ft.begin=it.int64();break}case 2:{ft.end=it.int64();break}default:it.skipType(pt&7);break}}return ft},et.decodeDelimited=function(it){return it instanceof a||(it=new a(it)),this.decode(it,it.uint32())},et.verify=function(it){return typeof it!="object"||it===null?"object expected":it.begin!=null&&it.hasOwnProperty("begin")&&!c.isInteger(it.begin)&&!(it.begin&&c.isInteger(it.begin.low)&&c.isInteger(it.begin.high))?"begin: integer|Long expected":it.end!=null&&it.hasOwnProperty("end")&&!c.isInteger(it.end)&&!(it.end&&c.isInteger(it.end.low)&&c.isInteger(it.end.high))?"end: integer|Long expected":null},et.fromObject=function(it){if(it instanceof nt.onnx.TensorProto.Segment)return it;var st=new nt.onnx.TensorProto.Segment;return it.begin!=null&&(c.Long?(st.begin=c.Long.fromValue(it.begin)).unsigned=!1:typeof it.begin=="string"?st.begin=parseInt(it.begin,10):typeof it.begin=="number"?st.begin=it.begin:typeof it.begin=="object"&&(st.begin=new c.LongBits(it.begin.low>>>0,it.begin.high>>>0).toNumber())),it.end!=null&&(c.Long?(st.end=c.Long.fromValue(it.end)).unsigned=!1:typeof it.end=="string"?st.end=parseInt(it.end,10):typeof it.end=="number"?st.end=it.end:typeof it.end=="object"&&(st.end=new c.LongBits(it.end.low>>>0,it.end.high>>>0).toNumber())),st},et.toObject=function(it,st){st||(st={});var ct={};if(st.defaults){if(c.Long){var ft=new c.Long(0,0,!1);ct.begin=st.longs===String?ft.toString():st.longs===Number?ft.toNumber():ft}else ct.begin=st.longs===String?"0":0;if(c.Long){var ft=new c.Long(0,0,!1);ct.end=st.longs===String?ft.toString():st.longs===Number?ft.toNumber():ft}else ct.end=st.longs===String?"0":0}return it.begin!=null&&it.hasOwnProperty("begin")&&(typeof it.begin=="number"?ct.begin=st.longs===String?String(it.begin):it.begin:ct.begin=st.longs===String?c.Long.prototype.toString.call(it.begin):st.longs===Number?new c.LongBits(it.begin.low>>>0,it.begin.high>>>0).toNumber():it.begin),it.end!=null&&it.hasOwnProperty("end")&&(typeof it.end=="number"?ct.end=st.longs===String?String(it.end):it.end:ct.end=st.longs===String?c.Long.prototype.toString.call(it.end):st.longs===Number?new c.LongBits(it.end.low>>>0,it.end.high>>>0).toNumber():it.end),ct},et.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},et.getTypeUrl=function(it){return it===void 0&&(it="type.googleapis.com"),it+"/onnx.TensorProto.Segment"},et}(),lt.DataLocation=function(){var et={},it=Object.create(et);return it[et[0]="DEFAULT"]=0,it[et[1]="EXTERNAL"]=1,it}(),lt}(),at.SparseTensorProto=function(){function lt(et){if(this.dims=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.values=null,lt.prototype.indices=null,lt.prototype.dims=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.values!=null&&Object.hasOwnProperty.call(et,"values")&&nt.onnx.TensorProto.encode(et.values,it.uint32(10).fork()).ldelim(),et.indices!=null&&Object.hasOwnProperty.call(et,"indices")&&nt.onnx.TensorProto.encode(et.indices,it.uint32(18).fork()).ldelim(),et.dims!=null&&et.dims.length){it.uint32(26).fork();for(var st=0;st<et.dims.length;++st)it.int64(et.dims[st]);it.ldelim()}return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.SparseTensorProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.values=nt.onnx.TensorProto.decode(et,et.uint32());break}case 2:{ct.indices=nt.onnx.TensorProto.decode(et,et.uint32());break}case 3:{if(ct.dims&&ct.dims.length||(ct.dims=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos<pt;)ct.dims.push(et.int64());else ct.dims.push(et.int64());break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.values!=null&&et.hasOwnProperty("values")){var it=nt.onnx.TensorProto.verify(et.values);if(it)return"values."+it}if(et.indices!=null&&et.hasOwnProperty("indices")){var it=nt.onnx.TensorProto.verify(et.indices);if(it)return"indices."+it}if(et.dims!=null&&et.hasOwnProperty("dims")){if(!Array.isArray(et.dims))return"dims: array expected";for(var st=0;st<et.dims.length;++st)if(!c.isInteger(et.dims[st])&&!(et.dims[st]&&c.isInteger(et.dims[st].low)&&c.isInteger(et.dims[st].high)))return"dims: integer|Long[] expected"}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.SparseTensorProto)return et;var it=new nt.onnx.SparseTensorProto;if(et.values!=null){if(typeof et.values!="object")throw TypeError(".onnx.SparseTensorProto.values: object expected");it.values=nt.onnx.TensorProto.fromObject(et.values)}if(et.indices!=null){if(typeof et.indices!="object")throw TypeError(".onnx.SparseTensorProto.indices: object expected");it.indices=nt.onnx.TensorProto.fromObject(et.indices)}if(et.dims){if(!Array.isArray(et.dims))throw TypeError(".onnx.SparseTensorProto.dims: array expected");it.dims=[];for(var st=0;st<et.dims.length;++st)c.Long?(it.dims[st]=c.Long.fromValue(et.dims[st])).unsigned=!1:typeof et.dims[st]=="string"?it.dims[st]=parseInt(et.dims[st],10):typeof et.dims[st]=="number"?it.dims[st]=et.dims[st]:typeof et.dims[st]=="object"&&(it.dims[st]=new c.LongBits(et.dims[st].low>>>0,et.dims[st].high>>>0).toNumber())}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.dims=[]),it.defaults&&(st.values=null,st.indices=null),et.values!=null&&et.hasOwnProperty("values")&&(st.values=nt.onnx.TensorProto.toObject(et.values,it)),et.indices!=null&&et.hasOwnProperty("indices")&&(st.indices=nt.onnx.TensorProto.toObject(et.indices,it)),et.dims&&et.dims.length){st.dims=[];for(var ct=0;ct<et.dims.length;++ct)typeof et.dims[ct]=="number"?st.dims[ct]=it.longs===String?String(et.dims[ct]):et.dims[ct]:st.dims[ct]=it.longs===String?c.Long.prototype.toString.call(et.dims[ct]):it.longs===Number?new c.LongBits(et.dims[ct].low>>>0,et.dims[ct].high>>>0).toNumber():et.dims[ct]}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.SparseTensorProto"},lt}(),at.TensorShapeProto=function(){function lt(et){if(this.dim=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.dim=c.emptyArray,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.dim!=null&&et.dim.length)for(var st=0;st<et.dim.length;++st)nt.onnx.TensorShapeProto.Dimension.encode(et.dim[st],it.uint32(10).fork()).ldelim();return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.TensorShapeProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.dim&&ct.dim.length||(ct.dim=[]),ct.dim.push(nt.onnx.TensorShapeProto.Dimension.decode(et,et.uint32()));break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.dim!=null&&et.hasOwnProperty("dim")){if(!Array.isArray(et.dim))return"dim: array expected";for(var it=0;it<et.dim.length;++it){var st=nt.onnx.TensorShapeProto.Dimension.verify(et.dim[it]);if(st)return"dim."+st}}return null},lt.fromObject=function(et){if(et instanceof nt.onnx.TensorShapeProto)return et;var it=new nt.onnx.TensorShapeProto;if(et.dim){if(!Array.isArray(et.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");it.dim=[];for(var st=0;st<et.dim.length;++st){if(typeof et.dim[st]!="object")throw TypeError(".onnx.TensorShapeProto.dim: object expected");it.dim[st]=nt.onnx.TensorShapeProto.Dimension.fromObject(et.dim[st])}}return it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.dim=[]),et.dim&&et.dim.length){st.dim=[];for(var ct=0;ct<et.dim.length;++ct)st.dim[ct]=nt.onnx.TensorShapeProto.Dimension.toObject(et.dim[ct],it)}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.TensorShapeProto"},lt.Dimension=function(){function et(st){if(st)for(var ct=Object.keys(st),ft=0;ft<ct.length;++ft)st[ct[ft]]!=null&&(this[ct[ft]]=st[ct[ft]])}et.prototype.dimValue=null,et.prototype.dimParam=null,et.prototype.denotation="";var it;return Object.defineProperty(et.prototype,"value",{get:c.oneOfGetter(it=["dimValue","dimParam"]),set:c.oneOfSetter(it)}),et.create=function(st){return new et(st)},et.encode=function(st,ct){return ct||(ct=$.create()),st.dimValue!=null&&Object.hasOwnProperty.call(st,"dimValue")&&ct.uint32(8).int64(st.dimValue),st.dimParam!=null&&Object.hasOwnProperty.call(st,"dimParam")&&ct.uint32(18).string(st.dimParam),st.denotation!=null&&Object.hasOwnProperty.call(st,"denotation")&&ct.uint32(26).string(st.denotation),ct},et.encodeDelimited=function(st,ct){return this.encode(st,ct).ldelim()},et.decode=function(st,ct){st instanceof a||(st=a.create(st));for(var ft=ct===void 0?st.len:st.pos+ct,pt=new nt.onnx.TensorShapeProto.Dimension;st.pos<ft;){var gt=st.uint32();switch(gt>>>3){case 1:{pt.dimValue=st.int64();break}case 2:{pt.dimParam=st.string();break}case 3:{pt.denotation=st.string();break}default:st.skipType(gt&7);break}}return pt},et.decodeDelimited=function(st){return st instanceof a||(st=new a(st)),this.decode(st,st.uint32())},et.verify=function(st){if(typeof st!="object"||st===null)return"object expected";var ct={};if(st.dimValue!=null&&st.hasOwnProperty("dimValue")&&(ct.value=1,!c.isInteger(st.dimValue)&&!(st.dimValue&&c.isInteger(st.dimValue.low)&&c.isInteger(st.dimValue.high))))return"dimValue: integer|Long expected";if(st.dimParam!=null&&st.hasOwnProperty("dimParam")){if(ct.value===1)return"value: multiple values";if(ct.value=1,!c.isString(st.dimParam))return"dimParam: string expected"}return st.denotation!=null&&st.hasOwnProperty("denotation")&&!c.isString(st.denotation)?"denotation: string expected":null},et.fromObject=function(st){if(st instanceof nt.onnx.TensorShapeProto.Dimension)return st;var ct=new nt.onnx.TensorShapeProto.Dimension;return st.dimValue!=null&&(c.Long?(ct.dimValue=c.Long.fromValue(st.dimValue)).unsigned=!1:typeof st.dimValue=="string"?ct.dimValue=parseInt(st.dimValue,10):typeof st.dimValue=="number"?ct.dimValue=st.dimValue:typeof st.dimValue=="object"&&(ct.dimValue=new c.LongBits(st.dimValue.low>>>0,st.dimValue.high>>>0).toNumber())),st.dimParam!=null&&(ct.dimParam=String(st.dimParam)),st.denotation!=null&&(ct.denotation=String(st.denotation)),ct},et.toObject=function(st,ct){ct||(ct={});var ft={};return ct.defaults&&(ft.denotation=""),st.dimValue!=null&&st.hasOwnProperty("dimValue")&&(typeof st.dimValue=="number"?ft.dimValue=ct.longs===String?String(st.dimValue):st.dimValue:ft.dimValue=ct.longs===String?c.Long.prototype.toString.call(st.dimValue):ct.longs===Number?new c.LongBits(st.dimValue.low>>>0,st.dimValue.high>>>0).toNumber():st.dimValue,ct.oneofs&&(ft.value="dimValue")),st.dimParam!=null&&st.hasOwnProperty("dimParam")&&(ft.dimParam=st.dimParam,ct.oneofs&&(ft.value="dimParam")),st.denotation!=null&&st.hasOwnProperty("denotation")&&(ft.denotation=st.denotation),ft},et.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},et.getTypeUrl=function(st){return st===void 0&&(st="type.googleapis.com"),st+"/onnx.TensorShapeProto.Dimension"},et}(),lt}(),at.TypeProto=function(){function lt(it){if(it)for(var st=Object.keys(it),ct=0;ct<st.length;++ct)it[st[ct]]!=null&&(this[st[ct]]=it[st[ct]])}lt.prototype.tensorType=null,lt.prototype.sequenceType=null,lt.prototype.mapType=null,lt.prototype.optionalType=null,lt.prototype.sparseTensorType=null,lt.prototype.denotation="";var et;return Object.defineProperty(lt.prototype,"value",{get:c.oneOfGetter(et=["tensorType","sequenceType","mapType","optionalType","sparseTensorType"]),set:c.oneOfSetter(et)}),lt.create=function(it){return new lt(it)},lt.encode=function(it,st){return st||(st=$.create()),it.tensorType!=null&&Object.hasOwnProperty.call(it,"tensorType")&&nt.onnx.TypeProto.Tensor.encode(it.tensorType,st.uint32(10).fork()).ldelim(),it.sequenceType!=null&&Object.hasOwnProperty.call(it,"sequenceType")&&nt.onnx.TypeProto.Sequence.encode(it.sequenceType,st.uint32(34).fork()).ldelim(),it.mapType!=null&&Object.hasOwnProperty.call(it,"mapType")&&nt.onnx.TypeProto.Map.encode(it.mapType,st.uint32(42).fork()).ldelim(),it.denotation!=null&&Object.hasOwnProperty.call(it,"denotation")&&st.uint32(50).string(it.denotation),it.sparseTensorType!=null&&Object.hasOwnProperty.call(it,"sparseTensorType")&&nt.onnx.TypeProto.SparseTensor.encode(it.sparseTensorType,st.uint32(66).fork()).ldelim(),it.optionalType!=null&&Object.hasOwnProperty.call(it,"optionalType")&&nt.onnx.TypeProto.Optional.encode(it.optionalType,st.uint32(74).fork()).ldelim(),st},lt.encodeDelimited=function(it,st){return this.encode(it,st).ldelim()},lt.decode=function(it,st){it instanceof a||(it=a.create(it));for(var ct=st===void 0?it.len:it.pos+st,ft=new nt.onnx.TypeProto;it.pos<ct;){var pt=it.uint32();switch(pt>>>3){case 1:{ft.tensorType=nt.onnx.TypeProto.Tensor.decode(it,it.uint32());break}case 4:{ft.sequenceType=nt.onnx.TypeProto.Sequence.decode(it,it.uint32());break}case 5:{ft.mapType=nt.onnx.TypeProto.Map.decode(it,it.uint32());break}case 9:{ft.optionalType=nt.onnx.TypeProto.Optional.decode(it,it.uint32());break}case 8:{ft.sparseTensorType=nt.onnx.TypeProto.SparseTensor.decode(it,it.uint32());break}case 6:{ft.denotation=it.string();break}default:it.skipType(pt&7);break}}return ft},lt.decodeDelimited=function(it){return it instanceof a||(it=new a(it)),this.decode(it,it.uint32())},lt.verify=function(it){if(typeof it!="object"||it===null)return"object expected";var st={};if(it.tensorType!=null&&it.hasOwnProperty("tensorType")){st.value=1;{var ct=nt.onnx.TypeProto.Tensor.verify(it.tensorType);if(ct)return"tensorType."+ct}}if(it.sequenceType!=null&&it.hasOwnProperty("sequenceType")){if(st.value===1)return"value: multiple values";st.value=1;{var ct=nt.onnx.TypeProto.Sequence.verify(it.sequenceType);if(ct)return"sequenceType."+ct}}if(it.mapType!=null&&it.hasOwnProperty("mapType")){if(st.value===1)return"value: multiple values";st.value=1;{var ct=nt.onnx.TypeProto.Map.verify(it.mapType);if(ct)return"mapType."+ct}}if(it.optionalType!=null&&it.hasOwnProperty("optionalType")){if(st.value===1)return"value: multiple values";st.value=1;{var ct=nt.onnx.TypeProto.Optional.verify(it.optionalType);if(ct)return"optionalType."+ct}}if(it.sparseTensorType!=null&&it.hasOwnProperty("sparseTensorType")){if(st.value===1)return"value: multiple values";st.value=1;{var ct=nt.onnx.TypeProto.SparseTensor.verify(it.sparseTensorType);if(ct)return"sparseTensorType."+ct}}return it.denotation!=null&&it.hasOwnProperty("denotation")&&!c.isString(it.denotation)?"denotation: string expected":null},lt.fromObject=function(it){if(it instanceof nt.onnx.TypeProto)return it;var st=new nt.onnx.TypeProto;if(it.tensorType!=null){if(typeof it.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");st.tensorType=nt.onnx.TypeProto.Tensor.fromObject(it.tensorType)}if(it.sequenceType!=null){if(typeof it.sequenceType!="object")throw TypeError(".onnx.TypeProto.sequenceType: object expected");st.sequenceType=nt.onnx.TypeProto.Sequence.fromObject(it.sequenceType)}if(it.mapType!=null){if(typeof it.mapType!="object")throw TypeError(".onnx.TypeProto.mapType: object expected");st.mapType=nt.onnx.TypeProto.Map.fromObject(it.mapType)}if(it.optionalType!=null){if(typeof it.optionalType!="object")throw TypeError(".onnx.TypeProto.optionalType: object expected");st.optionalType=nt.onnx.TypeProto.Optional.fromObject(it.optionalType)}if(it.sparseTensorType!=null){if(typeof it.sparseTensorType!="object")throw TypeError(".onnx.TypeProto.sparseTensorType: object expected");st.sparseTensorType=nt.onnx.TypeProto.SparseTensor.fromObject(it.sparseTensorType)}return it.denotation!=null&&(st.denotation=String(it.denotation)),st},lt.toObject=function(it,st){st||(st={});var ct={};return st.defaults&&(ct.denotation=""),it.tensorType!=null&&it.hasOwnProperty("tensorType")&&(ct.tensorType=nt.onnx.TypeProto.Tensor.toObject(it.tensorType,st),st.oneofs&&(ct.value="tensorType")),it.sequenceType!=null&&it.hasOwnProperty("sequenceType")&&(ct.sequenceType=nt.onnx.TypeProto.Sequence.toObject(it.sequenceType,st),st.oneofs&&(ct.value="sequenceType")),it.mapType!=null&&it.hasOwnProperty("mapType")&&(ct.mapType=nt.onnx.TypeProto.Map.toObject(it.mapType,st),st.oneofs&&(ct.value="mapType")),it.denotation!=null&&it.hasOwnProperty("denotation")&&(ct.denotation=it.denotation),it.sparseTensorType!=null&&it.hasOwnProperty("sparseTensorType")&&(ct.sparseTensorType=nt.onnx.TypeProto.SparseTensor.toObject(it.sparseTensorType,st),st.oneofs&&(ct.value="sparseTensorType")),it.optionalType!=null&&it.hasOwnProperty("optionalType")&&(ct.optionalType=nt.onnx.TypeProto.Optional.toObject(it.optionalType,st),st.oneofs&&(ct.value="optionalType")),ct},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(it){return it===void 0&&(it="type.googleapis.com"),it+"/onnx.TypeProto"},lt.Tensor=function(){function it(st){if(st)for(var ct=Object.keys(st),ft=0;ft<ct.length;++ft)st[ct[ft]]!=null&&(this[ct[ft]]=st[ct[ft]])}return it.prototype.elemType=0,it.prototype.shape=null,it.create=function(st){return new it(st)},it.encode=function(st,ct){return ct||(ct=$.create()),st.elemType!=null&&Object.hasOwnProperty.call(st,"elemType")&&ct.uint32(8).int32(st.elemType),st.shape!=null&&Object.hasOwnProperty.call(st,"shape")&&nt.onnx.TensorShapeProto.encode(st.shape,ct.uint32(18).fork()).ldelim(),ct},it.encodeDelimited=function(st,ct){return this.encode(st,ct).ldelim()},it.decode=function(st,ct){st instanceof a||(st=a.create(st));for(var ft=ct===void 0?st.len:st.pos+ct,pt=new nt.onnx.TypeProto.Tensor;st.pos<ft;){var gt=st.uint32();switch(gt>>>3){case 1:{pt.elemType=st.int32();break}case 2:{pt.shape=nt.onnx.TensorShapeProto.decode(st,st.uint32());break}default:st.skipType(gt&7);break}}return pt},it.decodeDelimited=function(st){return st instanceof a||(st=new a(st)),this.decode(st,st.uint32())},it.verify=function(st){if(typeof st!="object"||st===null)return"object expected";if(st.elemType!=null&&st.hasOwnProperty("elemType")&&!c.isInteger(st.elemType))return"elemType: integer expected";if(st.shape!=null&&st.hasOwnProperty("shape")){var ct=nt.onnx.TensorShapeProto.verify(st.shape);if(ct)return"shape."+ct}return null},it.fromObject=function(st){if(st instanceof nt.onnx.TypeProto.Tensor)return st;var ct=new nt.onnx.TypeProto.Tensor;if(st.elemType!=null&&(ct.elemType=st.elemType|0),st.shape!=null){if(typeof st.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");ct.shape=nt.onnx.TensorShapeProto.fromObject(st.shape)}return ct},it.toObject=function(st,ct){ct||(ct={});var ft={};return ct.defaults&&(ft.elemType=0,ft.shape=null),st.elemType!=null&&st.hasOwnProperty("elemType")&&(ft.elemType=st.elemType),st.shape!=null&&st.hasOwnProperty("shape")&&(ft.shape=nt.onnx.TensorShapeProto.toObject(st.shape,ct)),ft},it.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},it.getTypeUrl=function(st){return st===void 0&&(st="type.googleapis.com"),st+"/onnx.TypeProto.Tensor"},it}(),lt.Sequence=function(){function it(st){if(st)for(var ct=Object.keys(st),ft=0;ft<ct.length;++ft)st[ct[ft]]!=null&&(this[ct[ft]]=st[ct[ft]])}return it.prototype.elemType=null,it.create=function(st){return new it(st)},it.encode=function(st,ct){return ct||(ct=$.create()),st.elemType!=null&&Object.hasOwnProperty.call(st,"elemType")&&nt.onnx.TypeProto.encode(st.elemType,ct.uint32(10).fork()).ldelim(),ct},it.encodeDelimited=function(st,ct){return this.encode(st,ct).ldelim()},it.decode=function(st,ct){st instanceof a||(st=a.create(st));for(var ft=ct===void 0?st.len:st.pos+ct,pt=new nt.onnx.TypeProto.Sequence;st.pos<ft;){var gt=st.uint32();switch(gt>>>3){case 1:{pt.elemType=nt.onnx.TypeProto.decode(st,st.uint32());break}default:st.skipType(gt&7);break}}return pt},it.decodeDelimited=function(st){return st instanceof a||(st=new a(st)),this.decode(st,st.uint32())},it.verify=function(st){if(typeof st!="object"||st===null)return"object expected";if(st.elemType!=null&&st.hasOwnProperty("elemType")){var ct=nt.onnx.TypeProto.verify(st.elemType);if(ct)return"elemType."+ct}return null},it.fromObject=function(st){if(st instanceof nt.onnx.TypeProto.Sequence)return st;var ct=new nt.onnx.TypeProto.Sequence;if(st.elemType!=null){if(typeof st.elemType!="object")throw TypeError(".onnx.TypeProto.Sequence.elemType: object expected");ct.elemType=nt.onnx.TypeProto.fromObject(st.elemType)}return ct},it.toObject=function(st,ct){ct||(ct={});var ft={};return ct.defaults&&(ft.elemType=null),st.elemType!=null&&st.hasOwnProperty("elemType")&&(ft.elemType=nt.onnx.TypeProto.toObject(st.elemType,ct)),ft},it.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},it.getTypeUrl=function(st){return st===void 0&&(st="type.googleapis.com"),st+"/onnx.TypeProto.Sequence"},it}(),lt.Map=function(){function it(st){if(st)for(var ct=Object.keys(st),ft=0;ft<ct.length;++ft)st[ct[ft]]!=null&&(this[ct[ft]]=st[ct[ft]])}return it.prototype.keyType=0,it.prototype.valueType=null,it.create=function(st){return new it(st)},it.encode=function(st,ct){return ct||(ct=$.create()),st.keyType!=null&&Object.hasOwnProperty.call(st,"keyType")&&ct.uint32(8).int32(st.keyType),st.valueType!=null&&Object.hasOwnProperty.call(st,"valueType")&&nt.onnx.TypeProto.encode(st.valueType,ct.uint32(18).fork()).ldelim(),ct},it.encodeDelimited=function(st,ct){return this.encode(st,ct).ldelim()},it.decode=function(st,ct){st instanceof a||(st=a.create(st));for(var ft=ct===void 0?st.len:st.pos+ct,pt=new nt.onnx.TypeProto.Map;st.pos<ft;){var gt=st.uint32();switch(gt>>>3){case 1:{pt.keyType=st.int32();break}case 2:{pt.valueType=nt.onnx.TypeProto.decode(st,st.uint32());break}default:st.skipType(gt&7);break}}return pt},it.decodeDelimited=function(st){return st instanceof a||(st=new a(st)),this.decode(st,st.uint32())},it.verify=function(st){if(typeof st!="object"||st===null)return"object expected";if(st.keyType!=null&&st.hasOwnProperty("keyType")&&!c.isInteger(st.keyType))return"keyType: integer expected";if(st.valueType!=null&&st.hasOwnProperty("valueType")){var ct=nt.onnx.TypeProto.verify(st.valueType);if(ct)return"valueType."+ct}return null},it.fromObject=function(st){if(st instanceof nt.onnx.TypeProto.Map)return st;var ct=new nt.onnx.TypeProto.Map;if(st.keyType!=null&&(ct.keyType=st.keyType|0),st.valueType!=null){if(typeof st.valueType!="object")throw TypeError(".onnx.TypeProto.Map.valueType: object expected");ct.valueType=nt.onnx.TypeProto.fromObject(st.valueType)}return ct},it.toObject=function(st,ct){ct||(ct={});var ft={};return ct.defaults&&(ft.keyType=0,ft.valueType=null),st.keyType!=null&&st.hasOwnProperty("keyType")&&(ft.keyType=st.keyType),st.valueType!=null&&st.hasOwnProperty("valueType")&&(ft.valueType=nt.onnx.TypeProto.toObject(st.valueType,ct)),ft},it.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},it.getTypeUrl=function(st){return st===void 0&&(st="type.googleapis.com"),st+"/onnx.TypeProto.Map"},it}(),lt.Optional=function(){function it(st){if(st)for(var ct=Object.keys(st),ft=0;ft<ct.length;++ft)st[ct[ft]]!=null&&(this[ct[ft]]=st[ct[ft]])}return it.prototype.elemType=null,it.create=function(st){return new it(st)},it.encode=function(st,ct){return ct||(ct=$.create()),st.elemType!=null&&Object.hasOwnProperty.call(st,"elemType")&&nt.onnx.TypeProto.encode(st.elemType,ct.uint32(10).fork()).ldelim(),ct},it.encodeDelimited=function(st,ct){return this.encode(st,ct).ldelim()},it.decode=function(st,ct){st instanceof a||(st=a.create(st));for(var ft=ct===void 0?st.len:st.pos+ct,pt=new nt.onnx.TypeProto.Optional;st.pos<ft;){var gt=st.uint32();switch(gt>>>3){case 1:{pt.elemType=nt.onnx.TypeProto.decode(st,st.uint32());break}default:st.skipType(gt&7);break}}return pt},it.decodeDelimited=function(st){return st instanceof a||(st=new a(st)),this.decode(st,st.uint32())},it.verify=function(st){if(typeof st!="object"||st===null)return"object expected";if(st.elemType!=null&&st.hasOwnProperty("elemType")){var ct=nt.onnx.TypeProto.verify(st.elemType);if(ct)return"elemType."+ct}return null},it.fromObject=function(st){if(st instanceof nt.onnx.TypeProto.Optional)return st;var ct=new nt.onnx.TypeProto.Optional;if(st.elemType!=null){if(typeof st.elemType!="object")throw TypeError(".onnx.TypeProto.Optional.elemType: object expected");ct.elemType=nt.onnx.TypeProto.fromObject(st.elemType)}return ct},it.toObject=function(st,ct){ct||(ct={});var ft={};return ct.defaults&&(ft.elemType=null),st.elemType!=null&&st.hasOwnProperty("elemType")&&(ft.elemType=nt.onnx.TypeProto.toObject(st.elemType,ct)),ft},it.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},it.getTypeUrl=function(st){return st===void 0&&(st="type.googleapis.com"),st+"/onnx.TypeProto.Optional"},it}(),lt.SparseTensor=function(){function it(st){if(st)for(var ct=Object.keys(st),ft=0;ft<ct.length;++ft)st[ct[ft]]!=null&&(this[ct[ft]]=st[ct[ft]])}return it.prototype.elemType=0,it.prototype.shape=null,it.create=function(st){return new it(st)},it.encode=function(st,ct){return ct||(ct=$.create()),st.elemType!=null&&Object.hasOwnProperty.call(st,"elemType")&&ct.uint32(8).int32(st.elemType),st.shape!=null&&Object.hasOwnProperty.call(st,"shape")&&nt.onnx.TensorShapeProto.encode(st.shape,ct.uint32(18).fork()).ldelim(),ct},it.encodeDelimited=function(st,ct){return this.encode(st,ct).ldelim()},it.decode=function(st,ct){st instanceof a||(st=a.create(st));for(var ft=ct===void 0?st.len:st.pos+ct,pt=new nt.onnx.TypeProto.SparseTensor;st.pos<ft;){var gt=st.uint32();switch(gt>>>3){case 1:{pt.elemType=st.int32();break}case 2:{pt.shape=nt.onnx.TensorShapeProto.decode(st,st.uint32());break}default:st.skipType(gt&7);break}}return pt},it.decodeDelimited=function(st){return st instanceof a||(st=new a(st)),this.decode(st,st.uint32())},it.verify=function(st){if(typeof st!="object"||st===null)return"object expected";if(st.elemType!=null&&st.hasOwnProperty("elemType")&&!c.isInteger(st.elemType))return"elemType: integer expected";if(st.shape!=null&&st.hasOwnProperty("shape")){var ct=nt.onnx.TensorShapeProto.verify(st.shape);if(ct)return"shape."+ct}return null},it.fromObject=function(st){if(st instanceof nt.onnx.TypeProto.SparseTensor)return st;var ct=new nt.onnx.TypeProto.SparseTensor;if(st.elemType!=null&&(ct.elemType=st.elemType|0),st.shape!=null){if(typeof st.shape!="object")throw TypeError(".onnx.TypeProto.SparseTensor.shape: object expected");ct.shape=nt.onnx.TensorShapeProto.fromObject(st.shape)}return ct},it.toObject=function(st,ct){ct||(ct={});var ft={};return ct.defaults&&(ft.elemType=0,ft.shape=null),st.elemType!=null&&st.hasOwnProperty("elemType")&&(ft.elemType=st.elemType),st.shape!=null&&st.hasOwnProperty("shape")&&(ft.shape=nt.onnx.TensorShapeProto.toObject(st.shape,ct)),ft},it.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},it.getTypeUrl=function(st){return st===void 0&&(st="type.googleapis.com"),st+"/onnx.TypeProto.SparseTensor"},it}(),lt}(),at.OperatorSetIdProto=function(){function lt(et){if(et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.domain="",lt.prototype.version=c.Long?c.Long.fromBits(0,0,!1):0,lt.create=function(et){return new lt(et)},lt.encode=function(et,it){return it||(it=$.create()),et.domain!=null&&Object.hasOwnProperty.call(et,"domain")&&it.uint32(10).string(et.domain),et.version!=null&&Object.hasOwnProperty.call(et,"version")&&it.uint32(16).int64(et.version),it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.OperatorSetIdProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.domain=et.string();break}case 2:{ct.version=et.int64();break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){return typeof et!="object"||et===null?"object expected":et.domain!=null&&et.hasOwnProperty("domain")&&!c.isString(et.domain)?"domain: string expected":et.version!=null&&et.hasOwnProperty("version")&&!c.isInteger(et.version)&&!(et.version&&c.isInteger(et.version.low)&&c.isInteger(et.version.high))?"version: integer|Long expected":null},lt.fromObject=function(et){if(et instanceof nt.onnx.OperatorSetIdProto)return et;var it=new nt.onnx.OperatorSetIdProto;return et.domain!=null&&(it.domain=String(et.domain)),et.version!=null&&(c.Long?(it.version=c.Long.fromValue(et.version)).unsigned=!1:typeof et.version=="string"?it.version=parseInt(et.version,10):typeof et.version=="number"?it.version=et.version:typeof et.version=="object"&&(it.version=new c.LongBits(et.version.low>>>0,et.version.high>>>0).toNumber())),it},lt.toObject=function(et,it){it||(it={});var st={};if(it.defaults)if(st.domain="",c.Long){var ct=new c.Long(0,0,!1);st.version=it.longs===String?ct.toString():it.longs===Number?ct.toNumber():ct}else st.version=it.longs===String?"0":0;return et.domain!=null&&et.hasOwnProperty("domain")&&(st.domain=et.domain),et.version!=null&&et.hasOwnProperty("version")&&(typeof et.version=="number"?st.version=it.longs===String?String(et.version):et.version:st.version=it.longs===String?c.Long.prototype.toString.call(et.version):it.longs===Number?new c.LongBits(et.version.low>>>0,et.version.high>>>0).toNumber():et.version),st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.OperatorSetIdProto"},lt}(),at.OperatorStatus=function(){var lt={},et=Object.create(lt);return et[lt[0]="EXPERIMENTAL"]=0,et[lt[1]="STABLE"]=1,et}(),at.FunctionProto=function(){function lt(et){if(this.input=[],this.output=[],this.attribute=[],this.attributeProto=[],this.node=[],this.opsetImport=[],et)for(var it=Object.keys(et),st=0;st<it.length;++st)et[it[st]]!=null&&(this[it[st]]=et[it[st]])}return lt.prototype.name="",lt.prototype.input=c.emptyArray,lt.prototype.output=c.emptyArray,lt.prototype.attribute=c.emptyArray,lt.prototype.attributeProto=c.emptyArray,lt.prototype.node=c.emptyArray,lt.prototype.docString="",lt.prototype.opsetImport=c.emptyArray,lt.prototype.domain="",lt.create=function(et){return new lt(et)},lt.encode=function(et,it){if(it||(it=$.create()),et.name!=null&&Object.hasOwnProperty.call(et,"name")&&it.uint32(10).string(et.name),et.input!=null&&et.input.length)for(var st=0;st<et.input.length;++st)it.uint32(34).string(et.input[st]);if(et.output!=null&&et.output.length)for(var st=0;st<et.output.length;++st)it.uint32(42).string(et.output[st]);if(et.attribute!=null&&et.attribute.length)for(var st=0;st<et.attribute.length;++st)it.uint32(50).string(et.attribute[st]);if(et.node!=null&&et.node.length)for(var st=0;st<et.node.length;++st)nt.onnx.NodeProto.encode(et.node[st],it.uint32(58).fork()).ldelim();if(et.docString!=null&&Object.hasOwnProperty.call(et,"docString")&&it.uint32(66).string(et.docString),et.opsetImport!=null&&et.opsetImport.length)for(var st=0;st<et.opsetImport.length;++st)nt.onnx.OperatorSetIdProto.encode(et.opsetImport[st],it.uint32(74).fork()).ldelim();if(et.domain!=null&&Object.hasOwnProperty.call(et,"domain")&&it.uint32(82).string(et.domain),et.attributeProto!=null&&et.attributeProto.length)for(var st=0;st<et.attributeProto.length;++st)nt.onnx.AttributeProto.encode(et.attributeProto[st],it.uint32(90).fork()).ldelim();return it},lt.encodeDelimited=function(et,it){return this.encode(et,it).ldelim()},lt.decode=function(et,it){et instanceof a||(et=a.create(et));for(var st=it===void 0?et.len:et.pos+it,ct=new nt.onnx.FunctionProto;et.pos<st;){var ft=et.uint32();switch(ft>>>3){case 1:{ct.name=et.string();break}case 4:{ct.input&&ct.input.length||(ct.input=[]),ct.input.push(et.string());break}case 5:{ct.output&&ct.output.length||(ct.output=[]),ct.output.push(et.string());break}case 6:{ct.attribute&&ct.attribute.length||(ct.attribute=[]),ct.attribute.push(et.string());break}case 11:{ct.attributeProto&&ct.attributeProto.length||(ct.attributeProto=[]),ct.attributeProto.push(nt.onnx.AttributeProto.decode(et,et.uint32()));break}case 7:{ct.node&&ct.node.length||(ct.node=[]),ct.node.push(nt.onnx.NodeProto.decode(et,et.uint32()));break}case 8:{ct.docString=et.string();break}case 9:{ct.opsetImport&&ct.opsetImport.length||(ct.opsetImport=[]),ct.opsetImport.push(nt.onnx.OperatorSetIdProto.decode(et,et.uint32()));break}case 10:{ct.domain=et.string();break}default:et.skipType(ft&7);break}}return ct},lt.decodeDelimited=function(et){return et instanceof a||(et=new a(et)),this.decode(et,et.uint32())},lt.verify=function(et){if(typeof et!="object"||et===null)return"object expected";if(et.name!=null&&et.hasOwnProperty("name")&&!c.isString(et.name))return"name: string expected";if(et.input!=null&&et.hasOwnProperty("input")){if(!Array.isArray(et.input))return"input: array expected";for(var it=0;it<et.input.length;++it)if(!c.isString(et.input[it]))return"input: string[] expected"}if(et.output!=null&&et.hasOwnProperty("output")){if(!Array.isArray(et.output))return"output: array expected";for(var it=0;it<et.output.length;++it)if(!c.isString(et.output[it]))return"output: string[] expected"}if(et.attribute!=null&&et.hasOwnProperty("attribute")){if(!Array.isArray(et.attribute))return"attribute: array expected";for(var it=0;it<et.attribute.length;++it)if(!c.isString(et.attribute[it]))return"attribute: string[] expected"}if(et.attributeProto!=null&&et.hasOwnProperty("attributeProto")){if(!Array.isArray(et.attributeProto))return"attributeProto: array expected";for(var it=0;it<et.attributeProto.length;++it){var st=nt.onnx.AttributeProto.verify(et.attributeProto[it]);if(st)return"attributeProto."+st}}if(et.node!=null&&et.hasOwnProperty("node")){if(!Array.isArray(et.node))return"node: array expected";for(var it=0;it<et.node.length;++it){var st=nt.onnx.NodeProto.verify(et.node[it]);if(st)return"node."+st}}if(et.docString!=null&&et.hasOwnProperty("docString")&&!c.isString(et.docString))return"docString: string expected";if(et.opsetImport!=null&&et.hasOwnProperty("opsetImport")){if(!Array.isArray(et.opsetImport))return"opsetImport: array expected";for(var it=0;it<et.opsetImport.length;++it){var st=nt.onnx.OperatorSetIdProto.verify(et.opsetImport[it]);if(st)return"opsetImport."+st}}return et.domain!=null&&et.hasOwnProperty("domain")&&!c.isString(et.domain)?"domain: string expected":null},lt.fromObject=function(et){if(et instanceof nt.onnx.FunctionProto)return et;var it=new nt.onnx.FunctionProto;if(et.name!=null&&(it.name=String(et.name)),et.input){if(!Array.isArray(et.input))throw TypeError(".onnx.FunctionProto.input: array expected");it.input=[];for(var st=0;st<et.input.length;++st)it.input[st]=String(et.input[st])}if(et.output){if(!Array.isArray(et.output))throw TypeError(".onnx.FunctionProto.output: array expected");it.output=[];for(var st=0;st<et.output.length;++st)it.output[st]=String(et.output[st])}if(et.attribute){if(!Array.isArray(et.attribute))throw TypeError(".onnx.FunctionProto.attribute: array expected");it.attribute=[];for(var st=0;st<et.attribute.length;++st)it.attribute[st]=String(et.attribute[st])}if(et.attributeProto){if(!Array.isArray(et.attributeProto))throw TypeError(".onnx.FunctionProto.attributeProto: array expected");it.attributeProto=[];for(var st=0;st<et.attributeProto.length;++st){if(typeof et.attributeProto[st]!="object")throw TypeError(".onnx.FunctionProto.attributeProto: object expected");it.attributeProto[st]=nt.onnx.AttributeProto.fromObject(et.attributeProto[st])}}if(et.node){if(!Array.isArray(et.node))throw TypeError(".onnx.FunctionProto.node: array expected");it.node=[];for(var st=0;st<et.node.length;++st){if(typeof et.node[st]!="object")throw TypeError(".onnx.FunctionProto.node: object expected");it.node[st]=nt.onnx.NodeProto.fromObject(et.node[st])}}if(et.docString!=null&&(it.docString=String(et.docString)),et.opsetImport){if(!Array.isArray(et.opsetImport))throw TypeError(".onnx.FunctionProto.opsetImport: array expected");it.opsetImport=[];for(var st=0;st<et.opsetImport.length;++st){if(typeof et.opsetImport[st]!="object")throw TypeError(".onnx.FunctionProto.opsetImport: object expected");it.opsetImport[st]=nt.onnx.OperatorSetIdProto.fromObject(et.opsetImport[st])}}return et.domain!=null&&(it.domain=String(et.domain)),it},lt.toObject=function(et,it){it||(it={});var st={};if((it.arrays||it.defaults)&&(st.input=[],st.output=[],st.attribute=[],st.node=[],st.opsetImport=[],st.attributeProto=[]),it.defaults&&(st.name="",st.docString="",st.domain=""),et.name!=null&&et.hasOwnProperty("name")&&(st.name=et.name),et.input&&et.input.length){st.input=[];for(var ct=0;ct<et.input.length;++ct)st.input[ct]=et.input[ct]}if(et.output&&et.output.length){st.output=[];for(var ct=0;ct<et.output.length;++ct)st.output[ct]=et.output[ct]}if(et.attribute&&et.attribute.length){st.attribute=[];for(var ct=0;ct<et.attribute.length;++ct)st.attribute[ct]=et.attribute[ct]}if(et.node&&et.node.length){st.node=[];for(var ct=0;ct<et.node.length;++ct)st.node[ct]=nt.onnx.NodeProto.toObject(et.node[ct],it)}if(et.docString!=null&&et.hasOwnProperty("docString")&&(st.docString=et.docString),et.opsetImport&&et.opsetImport.length){st.opsetImport=[];for(var ct=0;ct<et.opsetImport.length;++ct)st.opsetImport[ct]=nt.onnx.OperatorSetIdProto.toObject(et.opsetImport[ct],it)}if(et.domain!=null&&et.hasOwnProperty("domain")&&(st.domain=et.domain),et.attributeProto&&et.attributeProto.length){st.attributeProto=[];for(var ct=0;ct<et.attributeProto.length;++ct)st.attributeProto[ct]=nt.onnx.AttributeProto.toObject(et.attributeProto[ct],it)}return st},lt.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},lt.getTypeUrl=function(et){return et===void 0&&(et="type.googleapis.com"),et+"/onnx.FunctionProto"},lt}(),at}(),o.exports=nt});function ur(e,o){if(!e)throw new Error(typeof o=="string"?o:o())}function kr(e){return new TextDecoder().decode(e)}var ot,Me,ai,kt,Sn,At,Rt,B,$r,Ue,Ve,ze,Y=O(()=>{wn(),qo(),ot=rr(sr()),We(),Me=class{static arraysEqual(e,o){if(e.length!==o.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==o[s])return!1;return!0}},ai=class{static preprocessInputShapes(e,o){let s=e.length===1?[1,e[0]]:e,a=o.length===1?[o[0],1]:o;return[s,a]}static postprocessOutputShape(e,o,s){o===1&&e.splice(e.length-2,1),s===1&&e.pop()}static calcMatMulShape(e,o){return e[1]!==o[0]?void 0:[e[0],o[1]]}},kt=class xu{static calcShape(o,s,a=!1){let $=o.length,c=s.length;if($===0)return s;if(c===0)return o;let nt=Math.max(o.length,s.length),at=new Array(nt);if(a){if($<2||c<2)return;let lt=ai.calcMatMulShape([o[$-2],o[$-1]],[s[c-2],s[c-1]]);if(lt===void 0)return;[at[nt-2],at[nt-1]]=lt}for(let lt=a?3:1;lt<=nt;lt++){let et=$-lt<0?1:o[$-lt],it=c-lt<0?1:s[c-lt];if(et!==it&&et>1&&it>1)return;at[nt-lt]=Math.max(et,it)}return at}static index(o,s){let a=new Array(s.length);return xu.fillIndex(o,s,a),a}static fillIndex(o,s,a){let $=o.length-s.length;for(let c=0;c<s.length;c++)a[c]=o[$+c]%s[c]}static calc(o,s,a,$,c){let nt=xu.calcShape(o.dims,s.dims);if(nt){if($&&!B.areEqual(nt,o.dims))return;let at=B.size(nt),lt=$?o:new bt(nt,c||o.type);if(nt.length===0)lt.set([],a(o.get([]),s.get([])));else{let et=new Array(nt.length),it=new Array(o.dims.length),st=new Array(s.dims.length),ct=0,ft=0,pt=!1,gt=!1;o.dims.length===0&&(ct=o.get([]),pt=!0),s.dims.length===0&&(ft=s.get([]),gt=!0);let wt;for(let vt=0;vt<at;vt++){wt=vt;for(let _t=nt.length-1;_t>=0;_t--)et[_t]=wt%nt[_t],wt=Math.floor(wt/nt[_t]);pt||(xu.fillIndex(et,o.dims,it),ct=o.get(it)),gt||(xu.fillIndex(et,s.dims,st),ft=s.get(st)),lt.set(et,a(ct,ft))}}return lt}}static isValidBroadcast(o,s){let a=o.length,$=s.length;if(a>$)return!1;for(let c=1;c<=a;c++)if(o[a-c]!==1&&o[a-c]!==s[$-c])return!1;return!0}static getBroadcastDims(o,s){let a=o.length,$=[];for(let c=0;c<a;c++){let nt=a-1-c,at=o[nt]||1;(s[s.length-1-c]||1)>1&&at===1&&$.unshift(nt)}return $}},Sn=class{static getShapeOfGemmResult(e,o,s,a,$){if(e.length!==2||s.length!==2)throw new Error("shape need to be of size 2");let c,nt,at;o?(c=e[1],nt=e[0]):(c=e[0],nt=e[1]);let lt=-1;if(a?(at=s[0],lt=1):(at=s[1],lt=0),s[lt]!==nt)throw new Error("dimension mismatch");if(c<=0||at<=0||nt<=0)throw new Error("invalid shape specified");if($&&!kt.isValidBroadcast($,[c,at]))throw new Error("gemm: invalid bias shape for broadcast");return[c,at,nt]}},At=class ry{static tensorDataTypeFromProto(o){switch(o){case ot.onnx.TensorProto.DataType.INT8:return"int8";case ot.onnx.TensorProto.DataType.UINT8:return"uint8";case ot.onnx.TensorProto.DataType.BOOL:return"bool";case ot.onnx.TensorProto.DataType.INT16:return"int16";case ot.onnx.TensorProto.DataType.UINT16:return"uint16";case ot.onnx.TensorProto.DataType.INT32:return"int32";case ot.onnx.TensorProto.DataType.UINT32:return"uint32";case ot.onnx.TensorProto.DataType.FLOAT:return"float32";case ot.onnx.TensorProto.DataType.DOUBLE:return"float64";case ot.onnx.TensorProto.DataType.STRING:return"string";case ot.onnx.TensorProto.DataType.INT64:return"int32";case ot.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${ot.onnx.TensorProto.DataType[o]}`)}}static tensorDataTypeStringToEnum(o){switch(o){case"int8":return ot.onnx.TensorProto.DataType.INT8;case"uint8":return ot.onnx.TensorProto.DataType.UINT8;case"bool":return ot.onnx.TensorProto.DataType.BOOL;case"int16":return ot.onnx.TensorProto.DataType.INT16;case"uint16":return ot.onnx.TensorProto.DataType.UINT16;case"int32":return ot.onnx.TensorProto.DataType.INT32;case"uint32":return ot.onnx.TensorProto.DataType.UINT32;case"float32":return ot.onnx.TensorProto.DataType.FLOAT;case"float64":return ot.onnx.TensorProto.DataType.DOUBLE;case"string":return ot.onnx.TensorProto.DataType.STRING;case"int64":return ot.onnx.TensorProto.DataType.INT64;case"uint64":return ot.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${o}`)}}static tensorDimsFromProto(o){return o.map(s=>xe.isLong(s)?s.toNumber():s)}static tensorValueTypeFromProto(o){return{tensorType:ry.tensorDataTypeFromProto(o.elemType),shape:{dims:ry.tensorDimsFromProto(o.shape.dim.map(s=>s.dimValue))}}}static tensorDimsFromORTFormat(o){let s=[];for(let a=0;a<o.dimsLength();a++)s.push(Rt.longToNumber(o.dims(a)));return s}static tensorAttributesFromORTFormat(o){let s=[];for(let a=0;a<o.attributesLength();a++)s.push(o.attributes(a));return s}},Rt=class{static longToNumber(e,o){return xe.isLong(e)?e.toNumber():e instanceof w.Long?xe.fromValue({low:e.low,high:e.high,unsigned:o??!1}).toNumber():e}static isLong(e){return xe.isLong(e)||e instanceof w.Long}},B=class ou{static size(o){return ou.getSizeFromDimensionRange(o,0,o.length)}static sizeFromDimension(o,s){if(s<0||s>o.length)throw new Error(`invalid dimension of ${s} for sizeFromDimension as Tensor has ${o.length} dimensions.`);return ou.getSizeFromDimensionRange(o,s,o.length)}static sizeToDimension(o,s){if(s<0||s>o.length)throw new Error(`invalid dimension of ${s} for sizeToDimension as Tensor has ${o.length} dimensions.`);return ou.getSizeFromDimensionRange(o,0,s)}static getSizeFromDimensionRange(o,s,a){let $=1;for(let c=s;c<a;c++){if(o[c]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");$*=o[c]}return $}static computeStrides(o){let s=o.length;if(s===0)return[];if(s===1)return[1];let a=new Array(s);a[s-1]=1,a[s-2]=o[s-1];for(let $=s-3;$>=0;--$)a[$]=a[$+1]*o[$+1];return a}static transpose(o){return o.slice().reverse()}static indicesToOffset(o,s,a){a===void 0&&(a=o.length);let $=0;for(let c=0;c<a;++c)$+=s[c]*o[c];return $}static offsetToIndices(o,s){let a=s.length;if(a===0)return[];if(a===1)return[o*s[0]];let $=new Array(s.length);for(let c=0;c<$.length-1;++c)$[c]=Math.floor(o/s[c]),o-=$[c]*s[c];return $[$.length-1]=o,$}static normalizeAxis(o,s){if(o<-s&&o>=s)throw new Error("unsupported axis for this operation.");return o<0?o+s:o}static normalizeAxes(o,s){return o.map(a=>this.normalizeAxis(a,s))}static incrementIndex(o,s,a){if(s.length===0||o.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(a===void 0)a=s.length;else if(a<=0||a>s.length)throw new Error("Incorrect axis to increment on");for(let $=a-1;$>=0&&(o[$]++,!(o[$]<s[$]));--$)o[$]=0}static calculateReshapedDims(o,s){if(s.length===0){if(o.length===0||ou.size(o)===1)return[];throw new Error("cannot reshape to a scalar Tensor")}let a=s.length,$=new Array(a),c=-1,nt=1;for(let lt=0;lt<a;lt++){if(s[lt]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(s[lt]===-1){if(c!==-1)throw new Error("at most one dimension in shape hints can be -1");c=lt}else{if(s[lt]===0){if(lt>=o.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");$[lt]=o[lt]}else $[lt]=s[lt];nt*=$[lt]}}let at=ou.size(o);if(c!==-1){if(at%nt!==0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${o}] Output shape: [${s}]`);$[c]=at/nt}else if(nt!==at)throw new Error("reshapedDims and originalDims don't have matching sizes");return $}static sortBasedOnPerm(o,s){return s?s.map(a=>o[a]):o.slice().reverse()}static padShape(o,s){let a=o.length;return o.map(($,c)=>$+s[c]+s[c+a])}static areEqual(o,s){return o.length!==s.length?!1:o.every((a,$)=>a===s[$])}static validateDimsAndCalcSize(o){if(o.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let s=1;for(let a of o){if(!Number.isInteger(a))throw new TypeError(`Invalid shape: ${a} is not an integer`);if(a<0||a>2147483647)throw new TypeError(`Invalid shape: length ${a} is not allowed`);s*=a}return s}static flattenShape(o,s){s<0&&(s+=o.length);let a=o.reduce((c,nt)=>c*nt,1),$=o.slice(s).reduce((c,nt)=>c*nt,1);return[a/$,$]}static squeezeShape(o,s){let a=new Array;s=ou.normalizeAxes(s,o.length);for(let $=0;$<o.length;$++){let c=s.indexOf($)>=0;if(c&&o[$]!==1)throw new Error("squeeze an axis of size different than 1");(s.length===0&&o[$]>1||s.length>0&&!c)&&a.push(o[$])}return a}static unsqueezeShape(o,s){let a=new Array(o.length+s.length);a.fill(0);for(let c=0;c<s.length;c++){let nt=ou.normalizeAxis(s[c],a.length);if(nt>=a.length)throw new Error("'axes' has an out of range axis");if(a[nt]!==0)throw new Error("'axes' has a duplicate axis");a[nt]=1}let $=0;for(let c=0;c<a.length;c++)a[c]===0&&(a[c]=o[$++]);if($!==o.length)throw new Error("the unsqueezed dimension could not be established");return a}},$r=class Hy{static splitShape(o,s,a,$){if(a.length===0){if(!$)throw new Error("need to know number of outputs when the 'split' attribute is not specified");Hy.determineSplit(o[s],$,a)}let c=[],nt=[0];for(let at=0;at<a.length;++at){at!==0&&nt.push(nt[at-1]+a[at-1]);let lt=o.slice();lt[s]=a[at],c.push(lt)}return[c,nt]}static determineSplit(o,s,a){if(o%s!==0)throw new Error("cannot split tensor to equal sized parts");for(let $=0;$<s;++$)a.push(o/s)}},Ue=class $u{static adjustPoolAttributes(o,s,a,$,c,nt){if(!o&&a.length!==s.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(o)for(let at=0;at<s.length-2;at++)at>=a.length?a.push(s[at+2]):a[at]=s[at+2];for(let at=0;at<a.length;at++)if(at<$.length){if($[at]<0)throw new Error("strides should be greater than or equal to 1")}else $.push(1);for(let at=0;at<a.length;at++)if(at<c.length){if(c[at]<0)throw new Error("dilations should be greater than or equal to 1")}else c.push(1);for(let at=0;at<a.length*2;at++)if(at<nt.length){if(nt[at]<0)throw new Error("pad should be greater than or equal to 1")}else nt.push(0);for(let at=0;at<a.length;at++){if(a[at]<=0)throw new Error("kernel shapes need to be greater than 0");if(nt[at]>=a[at]||nt[at+a.length]>=a[at])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(o,s,a,$,c,nt){if(nt){if(c.length!==2*(o.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(s.length!==o.length-2)throw new Error("length of strides should be the length of data dimensions");if($.length!==o.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let at=0;at<o.length-2;at++)$u.adjustPadAndReturnShape(o[at+2],s[at],a[at],$[at],c,at,at+o.length-2,nt)}}static computePoolOutputShape(o,s,a,$,c,nt,at){if(s.length<=0)throw new Error("input shape must be of size greater than 0");let lt=[s[0],s[1]];return $u.computeShapeHelper(o,s,lt,a,$,c,nt,at),lt}static computeConvOutputShape(o,s,a,$,c,nt,at){if(o.length<=0||s.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");let lt=[o[0],s[0]];return $u.computeShapeHelper(!1,o,lt,a,$,c,nt,at),lt}static computeShapeHelper(o,s,a,$,c,nt,at,lt){if(o)for(let et=0;et<s.length-2;et++)a.push(1);else for(let et=0;et<s.length-2;et++)a.push($u.adjustPadAndReturnShape(s[et+2],$[et],c[et],nt[et],at,et,et+s.length-2,lt))}static adjustPadAndReturnShape(o,s,a,$,c,nt,at,lt){let et=a*($-1)+1;if(lt&&lt!=="NOTSET")switch(lt){case"VALID":return c[nt]=0,c[at]=0,Math.floor((o-et)/s+1);case"SAME_LOWER":case"SAME_UPPER":if(a!==1)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{let it=((o+s-1)/s-1)*s+$-o;return c[nt]=Math.floor(lt==="SAME_LOWER"?(it+1)/2:it/2),c[at]=it-c[nt],Math.floor((o+it-$)/s+1)}default:throw new Error("Unsupported AutoPad type")}else return Math.floor((o+c[nt]+c[at]-et)/s+1)}},Ve=-34028234663852886e22,ze=34028234663852886e22});function hh(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}`)}}function Wu(e){switch(e){case H.onnx.TensorProto.DataType.UINT8:case H.onnx.TensorProto.DataType.INT8:case H.onnx.TensorProto.DataType.BOOL:return 1;case H.onnx.TensorProto.DataType.UINT16:case H.onnx.TensorProto.DataType.INT16:return 2;case H.onnx.TensorProto.DataType.FLOAT:case H.onnx.TensorProto.DataType.INT32:case H.onnx.TensorProto.DataType.UINT32:return 4;case H.onnx.TensorProto.DataType.INT64:case H.onnx.TensorProto.DataType.DOUBLE:case H.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${H.onnx.TensorProto.DataType[e]}`)}}function mh(e,o){return new(ju(o))(e)}function ju(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"int64":return BigInt64Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function ui(e,o){if(o===H.onnx.TensorProto.DataType.INT64||o===si.TensorDataType.INT64){if(e.greaterThanOrEqual(2147483648)||e.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else if(o===H.onnx.TensorProto.DataType.UINT32||o===si.TensorDataType.UINT32||o===H.onnx.TensorProto.DataType.UINT64||o===si.TensorDataType.UINT64){if(e.greaterThanOrEqual(4294967296)||e.lessThan(0))throw new TypeError("uint64 is not supported")}else throw new TypeError(`not a LONG type: ${H.onnx.TensorProto.DataType[o]}`);return e.toNumber()}function Hu(e,o,s){switch(o){case H.onnx.TensorProto.DataType.BOOL:case H.onnx.TensorProto.DataType.UINT8:return e.getUint8(s);case H.onnx.TensorProto.DataType.INT8:return e.getInt8(s);case H.onnx.TensorProto.DataType.UINT16:return e.getUint16(s,!0);case H.onnx.TensorProto.DataType.INT16:return e.getInt16(s,!0);case H.onnx.TensorProto.DataType.FLOAT:return e.getFloat32(s,!0);case H.onnx.TensorProto.DataType.INT32:return e.getInt32(s,!0);case H.onnx.TensorProto.DataType.UINT32:return e.getUint32(s,!0);case H.onnx.TensorProto.DataType.INT64:return ui(xe.fromBits(e.getUint32(s,!0),e.getUint32(s+4,!0),!1),o);case H.onnx.TensorProto.DataType.DOUBLE:return e.getFloat64(s,!0);case H.onnx.TensorProto.DataType.UINT64:return ui(xe.fromBits(e.getUint32(s,!0),e.getUint32(s+4,!0),!0),o);default:throw new Error(`cannot read from DataView for type ${H.onnx.TensorProto.DataType[o]}`)}}var qu,H,si,bt,We=O(()=>{qu=rr(Fs()),qo(),Pr(),H=rr(sr()),Y(),si=F.experimental.fbs,bt=class Du{constructor(o,s,a,$,c,nt=qu.Guid.create()){this.dims=o,this.type=s,this.dataProvider=a,this.asyncDataProvider=$,this.cache=c,this.dataId=nt,this.size=B.validateDimsAndCalcSize(o);let at=this.size,lt=a===void 0&&$===void 0&&c===void 0;if(c!==void 0&&c.length!==at)throw new RangeError("Input dims doesn't match data length.");if(s==="string"){if(c!==void 0&&(!Array.isArray(c)||!c.every(et=>typeof et=="string")))throw new TypeError("cache should be a string array");lt&&(this.cache=new Array(at))}else{if(c!==void 0){let et=ju(s);if(!(c instanceof et))throw new TypeError(`cache should be type ${et.name}`)}if(lt){let et=new ArrayBuffer(at*hh(s));this.cache=mh(et,s)}}}get data(){if(this.cache===void 0){let o=this.dataProvider(this.dataId);if(o.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=o}return this.cache}get stringData(){if(this.type!=="string")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(this.type!=="string")return this.data;throw new TypeError("type cannot be non-number (string)")}get(o){return this.data[B.indicesToOffset(o,this.strides)]}set(o,s){this.data[B.indicesToOffset(o,this.strides)]=s}async getData(){return this.cache===void 0&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=B.computeStrides(this.dims)),this._strides}static fromProto(o){if(!o)throw new Error("cannot construct Value from an empty tensor");let s=At.tensorDataTypeFromProto(o.dataType),a=At.tensorDimsFromProto(o.dims),$=new Du(a,s);if(s==="string")o.stringData.forEach((c,nt)=>{$.data[nt]=kr(c)});else if(o.rawData&&typeof o.rawData.byteLength=="number"&&o.rawData.byteLength>0){let c=$.data,nt=new DataView(o.rawData.buffer,o.rawData.byteOffset,o.rawData.byteLength),at=Wu(o.dataType),lt=o.rawData.byteLength/at;if(o.rawData.byteLength%at!==0)throw new Error("invalid buffer length");if(c.length!==lt)throw new Error("buffer length mismatch");for(let et=0;et<lt;et++){let it=Hu(nt,o.dataType,et*at);c[et]=it}}else{let c;switch(o.dataType){case H.onnx.TensorProto.DataType.FLOAT:c=o.floatData;break;case H.onnx.TensorProto.DataType.INT32:case H.onnx.TensorProto.DataType.INT16:case H.onnx.TensorProto.DataType.UINT16:case H.onnx.TensorProto.DataType.INT8:case H.onnx.TensorProto.DataType.UINT8:case H.onnx.TensorProto.DataType.BOOL:c=o.int32Data;break;case H.onnx.TensorProto.DataType.INT64:c=o.int64Data;break;case H.onnx.TensorProto.DataType.DOUBLE:c=o.doubleData;break;case H.onnx.TensorProto.DataType.UINT32:case H.onnx.TensorProto.DataType.UINT64:c=o.uint64Data;break;default:throw new Error("unspecific error")}if(c==null)throw new Error("failed to populate data from a tensorproto value");let nt=$.data;if(nt.length!==c.length)throw new Error("array length mismatch");for(let at=0;at<c.length;at++){let lt=c[at];xe.isLong(lt)?nt[at]=ui(lt,o.dataType):nt[at]=lt}}return $}static fromData(o,s,a){return new Du(s,a,void 0,void 0,o)}static fromOrtTensor(o){if(!o)throw new Error("cannot construct Value from an empty tensor");let s=At.tensorDimsFromORTFormat(o),a=At.tensorDataTypeFromProto(o.dataType()),$=new Du(s,a);if(a==="string")for(let c=0;c<o.stringDataLength();c++)$.data[c]=o.stringData(c);else if(o.rawDataArray()&&typeof o.rawDataLength()=="number"&&o.rawDataLength()>0){let c=$.data,nt=new DataView(o.rawDataArray().buffer,o.rawDataArray().byteOffset,o.rawDataLength()),at=Wu(o.dataType()),lt=o.rawDataLength()/at;if(o.rawDataLength()%at!==0)throw new Error("invalid buffer length");if(c.length!==lt)throw new Error("buffer length mismatch");for(let et=0;et<lt;et++){let it=Hu(nt,o.dataType(),et*at);c[et]=it}}return $}}});function G(e){return e===1?bh:gh}function Xu(e){let o=G(e);return`${o.version}
precision highp float;
${o.attribute} vec3 position;
${o.attribute} vec2 textureCoord;
${o.varyingVertex} vec2 TexCoords;
void main()
{
gl_Position = vec4(position, 1.0);
TexCoords = textureCoord;
}`}function Ku(e){let o=G(e);return`${o.version}
precision highp float;
precision highp int;
precision highp sampler2D;
${o.varyingFrag} vec2 TexCoords;
${o.outputDeclaration}
const vec2 halfCR = vec2(0.5, 0.5);
// Custom vector types to handle higher dimenalities.
struct ivec5
{
int x;
int y;
int z;
int w;
int u;
};
struct ivec6
{
int x;
int y;
int z;
int w;
int u;
int v;
};
int imod(int x, int y) {
return x - y * (x / y);
}
`}function Ju(e,o){let s=G(e);return`
void main() {
int indices[${o}];
toVec(TexCoords, indices);
vec4 result = vec4(process(indices));
${s.output} = result;
}
`}var bh,gh,ut=O(()=>{bh={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},gh={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"}}),j=O(()=>{});async function li(e,o=a=>0,s){return new Promise((a,$)=>{let c=0,nt=()=>{if(e()){a();return}c++;let at=o(c);setTimeout(nt,at)};nt()})}function An(e){return ur(typeof e<"u"&&e.length!==0,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)}function Yu(e){return ur(typeof e<"u"&&e.length!==0,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)+"AtOutCoords"}function lr(e,o){let s=JSON.parse(JSON.stringify(e));return s=o,s}function fr(e,o){return o.map(s=>e[s]).join(", ")}function Bt(e){if(e<=1)return"int";if(e===2)return"ivec2";if(e===3)return"ivec3";if(e===4)return"ivec4";if(e===5)return"ivec5";if(e===6)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)}function ne(e=6){return["x","y","z","w","u","v"].slice(0,e)}var pe=O(()=>{Y()});function yh(e,o){return ne(o).map(s=>`${e}.${s}`)}function cr(e,o){return o===1?[e]:yh(e,o)}function de(){return`
float getChannel(vec4 frag, int dim) {
int modCoord = imod(dim, 2);
return modCoord == 0 ? frag.r : frag.g;
}
float getChannel(vec4 frag, vec2 innerDims) {
vec2 modCoord = mod(innerDims, 2.);
return modCoord.x == 0. ?
(modCoord.y == 0. ? frag.r : frag.g) :
(modCoord.y == 0. ? frag.b : frag.a);
}
`}var He=O(()=>{pe()});function Th(e,o,s){if(e===0)return"false";if(e===1)return`rc > ${o[0]}`;let a="";for(let $=e-2;$<e;$++)a+=`${s[$]} >= ${o[$-e+2]}`,$<e-1&&(a+="||");return a}function wh(e,o){let s=e.length;if(s===0)return"getA(), 0, 0, 0";if(s===1)return`getA(rc),
rc + 1 >= ${e[0]} ? 0. : getA(rc + 1),
0, 0`;let a="r, c",$="r, cp1",c="rp1, c",nt="rp1, cp1",at="";if(s>2)for(let lt=0;lt<s-2;++lt)at=at+`${o[lt]},`;return`getA(${at}${a}),
rEdge ? 0. : getA(${at}${c}),
cEdge ? 0. : getA(${at}${$}),
rEdge || cEdge ? 0. : getA(${at}${nt})`}function vh(e,o,s,a){return e===0||e===1?"":`
int r = ${o[e-2]};
int c = ${o[e-1]};
int rp1 = ${o[e-2]} + 1;
int cp1 = ${o[e-1]} + 1;
bool rEdge = rp1 >= ${a};
bool cEdge = cp1 >= ${s};
`}var Zu,xh,Qu,tl=O(()=>{ut(),j(),pe(),He(),Zu={name:"pack",inputNames:["A"],inputTypes:[1]},xh=(e,o)=>{let s=G(e.session.backend.glContext.version),a=o.dims,$=a.length,c=o.dims.length,nt=Bt(c),at=cr("rc",c),lt=vh(c,at,a[a.length-2],a[a.length-1]),et;$===0?et=[1,1]:$===1?et=[a[0],1]:et=[a[c-1],a[c-2]];let it=Th(c,et,at),st=wh(a,at),ct=`
void main() {
${nt} rc = getOutputCoords();
if(${it}) {
${s.output} = vec4(0);
} else {
${lt}
${s.output} = vec4(${st});
}
}
`;return{...Zu,hasMain:!0,output:{dims:o.dims,type:o.type,textureType:2},shaderSource:ct}},Qu=(e,o)=>({...Zu,get:()=>xh(e,o)})});function fi(e){if(e.length===0)return[1,1,1];let o=1;for(let s=0;s<e.length-2;++s)o*=e[s];return[o,e.length>1?e[e.length-2]:1,e[e.length-1]]}function rl(e,o){let s=!1;return e.length===0||o.length===0?s=!0:e.length<2||o.length<2?s=e[e.length-1]===o[o.length-1]:s=e[e.length-1]===o[o.length-1]&&e[e.length-2]===o[o.length-2],s}function Oh(e){let o=B.computeStrides(e),s=["b","r","c"],a="index";return`
ivec3 inputCoordsFromReshapedOutCoords(int index) {
${o.map(($,c)=>{let nt=`int ${s[c]} = ${a} / ${$}`,at=c===o.length-1?`int ${s[c+1]} = ${a} - ${s[c]} * ${$}`:`index -= ${s[c]} * ${$}`;return`${nt}; ${at};`}).join("")}
return ivec3(b, r, c);
}
`}function Sh(e){let o=B.computeStrides(e);return`
int getFlattenedIndex(ivec3 coords) {
// reverse y, z order
return coords.x * ${o[0]} + coords.z * ${o[1]} + coords.y;
}
`}var Ih,_h,el,nl=O(()=>{Y(),ut(),j(),He(),Ih=e=>({name:"Reshape (packed)",inputTypes:[2],inputNames:["A"],cacheHint:`${e}`}),_h=(e,o,s,a)=>{let $=o.dims,c=a,nt="";for(let et=0;et<4;et++){let it="";switch(et){case 0:it="outputCoords = rc;";break;case 1:it="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:it="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:it="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}nt+=`
${it}
${et>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}
int flattenedIndex = getFlattenedIndex(outputCoords);
ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);
vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));
result[${et}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);
${et>0?"}":""}
`}let at=G(e.session.backend.glContext.version),lt=`
${Oh($)}
${Sh(c)}
${de()}
void main() {
ivec3 rc = getOutputCoords();
vec4 result = vec4(0.0);
ivec3 outputCoords;
int rows = ${c[2]};
int cols = ${c[1]};
${nt}
${at.output} = result;
}
`;return{...s,output:{dims:c,type:o.type,textureType:2},shaderSource:lt,hasMain:!0}},el=(e,o,s)=>{let a=Ih(s);return{...a,get:()=>_h(e,o,a,s)}}}),ci,ol=O(()=>{ut(),j(),ci=(e,o)=>{let s=o.shape,a=G(e.session.backend.glContext.version),$=`
const float FLOAT_MAX = 1.70141184e38;
const float FLOAT_MIN = 1.17549435e-38;
bool isNaN(float val) {
return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;
}
highp vec4 encodeAsUint8(highp float v) {
if (isNaN(v)) {
return vec4(255, 255, 255, 255);
}
highp float av = abs(v);
if(av < FLOAT_MIN) {
return vec4(0.0, 0.0, 0.0, 0.0);
} else if(v > FLOAT_MAX) {
return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;
} else if(v < -FLOAT_MAX) {
return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;
}
highp vec4 c = vec4(0,0,0,0);
highp float e = floor(log2(av));
highp float m = exp2(fract(log2(av))) - 1.0;
c[2] = floor(128.0 * m);
m -= c[2] / 128.0;
c[1] = floor(32768.0 * m);
m -= c[1] / 32768.0;
c[0] = floor(8388608.0 * m);
highp float ebias = e + 127.0;
c[3] = floor(ebias / 2.0);
ebias -= c[3] * 2.0;
c[2] += floor(ebias) * 128.0;
c[3] += 128.0 * step(0.0, -v);
return c / 255.0;
}
void main() {
float value = ${a.texture2D}(X,TexCoords).r;
${a.output} = encodeAsUint8(value);
}`,c={name:"Uint8Encode",inputTypes:[0],inputNames:["X"],output:{dims:s,type:o.tensor.type,textureType:3},shaderSource:$,hasMain:!0};return e.executeProgram(c,[o.tensor])}});function Ph(e,o){if(e===1)return"rc";let s="";for(let a=0;a<e;a++)s+=o[a],a<e-1&&(s+=",");return s}var il,Ah,al,sl=O(()=>{ut(),j(),pe(),He(),il={name:"unpack",inputNames:["A"],inputTypes:[2]},Ah=(e,o)=>{let s=o.dims.length,a=cr("rc",s),$=a.slice(-2),c=Bt(s),nt=de(),at=o.dims.length===0?"":Ph(s,a),lt=s<=1?"rc":`vec2(${$.join(",")})`,et=G(e.session.backend.glContext.version),it=`
${nt}
void main() {
${c} rc = getOutputCoords();
// Sample the texture with the coords to get the rgba channel value.
vec4 packedInput = getA(${at});
${et.output} = vec4(getChannel(packedInput, ${lt}), 0, 0, 0);
}
`;return{...il,hasMain:!0,output:{dims:o.dims,type:o.type,textureType:0},shaderSource:it}},al=(e,o)=>({...il,get:()=>Ah(e,o)})}),Pn,Br,En,Fr=O(()=>{Ut(),Pn=class{constructor(e,o=1){if(o===1)this.internalFormat=e.R32F,this.format=e.RED,this.textureType=e.FLOAT,this.channelSize=o;else if(o===4)this.internalFormat=e.RGBA32F,this.format=e.RGBA,this.textureType=e.FLOAT,this.channelSize=o;else throw new Error(`Invalid number of channels: ${o}`)}encode(e,o){let s,a;return e.constructor!==Float32Array&&(tt.warning("Encoder","data was not of type Float32; creating new Float32Array"),a=new Float32Array(e)),o*this.channelSize>e.length?(tt.warning("Encoder","Source data too small. Allocating larger array"),a=e,s=this.allocate(o*this.channelSize),a.forEach(($,c)=>s[c]=$)):(a=e,s=a),s}allocate(e){return new Float32Array(e*4)}decode(e,o){return this.channelSize===1?e.filter((s,a)=>a%4===0).subarray(0,o):e.subarray(0,o)}},Br=class{constructor(e,o=1,s){if(o!==1&&o!==4)throw new Error(`Invalid number of channels: ${o}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.channelSize=o,this.textureType=s||e.FLOAT}encode(e,o){let s=e;return this.channelSize===1&&(tt.verbose("Encoder","Exploding into a larger array"),s=this.allocate(o),e.forEach((a,$)=>s[$*4]=a)),s}allocate(e){return new Float32Array(e*4)}decode(e,o){return this.channelSize===1?e.filter((s,a)=>a%4===0).subarray(0,o):e.subarray(0,o)}},En=class{constructor(e,o=1){if(this.channelSize=4,o===1)this.internalFormat=e.ALPHA,this.format=e.ALPHA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=o;else if(o===4)this.internalFormat=e.RGBA,this.format=e.RGBA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=o;else throw new Error(`Invalid number of channels: ${o}`)}encode(e,o){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}allocate(e){return new Uint8Array(e*this.channelSize)}decode(e,o){if(e instanceof Uint8Array)return e.subarray(0,o);throw new Error(`Invalid array type: ${e.constructor}`)}}}),Cr,ul,pi,ll=O(()=>{Y(),j(),Cr=(e,o,s)=>{let a=s===0||s===1?1:4,$=s===2,c=s===1||s===2,nt=s===4?o.length-1:void 0,at=s===4?o.map((lt,et)=>et===o.length-1?lt*4:lt):void 0;return pi(e,o,a,at,{isPacked:$,reverseWH:c,breakAxis:nt})},ul=(e,o,s)=>{let a=Cr(e,o,s);return[a.width,a.height]},pi=(e,o,s=1,a,$)=>{let c=!!($&&$.isPacked),[nt,at]=e.computeTextureWH(c&&a||o,$),lt=o.length,et=o.slice(0);if(lt===0&&(et=[1]),s===1)a=o;else if(c){if(s!==4)throw new Error("a packed texture must be 4-channel");a=o,lt>0&&(et[lt-1]=Math.ceil(et[lt-1]/2)),lt>1&&(et[lt-2]=Math.ceil(et[lt-2]/2))}else if(!a)throw new Error("Unpacked shape is needed when using channels > 1");return{width:nt,height:at,channels:s,isPacked:c,shape:et,strides:B.computeStrides(et),unpackedShape:a,reversedWH:$&&$.reverseWH}}}),Dh,Dn,cl=O(()=>{Ut(),We(),Y(),tl(),nl(),ol(),sl(),Fr(),ll(),j(),Dh=(e,o)=>{let s=o.map($=>`${$.unpackedShape.join(",")};${$.width}x${$.height}`).join("_"),a=e.name;return e.cacheHint&&(a+="["+e.cacheHint+"]"),a+=":"+s,a},Dn=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,o){return ul(this.session.layoutStrategy,e,o)}executeProgram(e,o){if(o.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");let s=[];for(let lt=0;lt<e.inputNames.length;++lt)s[lt]=this.getOrCreateTextureData(o[lt],e.inputTypes[lt]);let a=Dh(e,s),$=this.session.programManager.getArtifact(a),c=$?$.programInfo:typeof e.get=="function"?e.get():e,nt=Cr(this.session.layoutStrategy,c.output.dims,c.output.textureType),at=this.createTextureData(nt,c.output.type);return $||($=this.session.programManager.build(c,s,at),this.session.programManager.setArtifact(a,$)),this.runProgram($,s,at),at}run(e,o){return this.executeProgram(e,o).tensor}runProgram(e,o,s){for(let a=0;a<o.length;++a)if(!!o[a].isPacked!=(e.programInfo.inputTypes[a]===2))throw new Error(`input[${a}] property packed inconsistent`);if(!!s.isPacked!=(e.programInfo.output.textureType===2))throw new Error("output property packed inconsistent");this.session.programManager.run(e,o,s)}getOrCreateTextureData(e,o){let s=this.getTextureData(e.dataId,o===2);if(!s&&(s=this.getTextureData(e.dataId,o!==2),s))return o===2?this.pack(s):this.unpack(s);if(!s){let a=Cr(this.session.layoutStrategy,e.dims,o);if(o===4){let $=e.dims;if($.length===4){let c=[$[0],Math.ceil($[1]*$[2]*$[3]/4)],nt=Cr(this.session.layoutStrategy,c,o),at=e.numberData;if($[1]*$[2]*$[3]%4!==0){let lt=$[0],et=$[1]*$[2]*$[3],it=Math.ceil(et*1/4)*4,st=lt*it;at=new Float32Array(st);for(let ct=0;ct<lt;++ct){let ft=ct*et,pt=ct*it+ct%1*et;at.set(e.numberData.subarray(ft,ft+et),pt)}}return this.createTextureData(nt,e.type,at,e,1)}}if(o===2){let $=pi(this.session.layoutStrategy,e.dims,1,[],{reverseWH:!0}),c=this.createTextureData($,e.type,e.numberData,e,1);s=this.pack(c)}else s=this.createTextureData(a,e.type,e.numberData,e,1)}return s}createTextureDataFromLayoutBindTensor(e,o,s,a){return this.createTextureData(e,o,s,a,1)}createTextureData(e,o,s,a,$){tt.verbose("InferenceHandler",`Creating TextureData: layout:[${JSON.stringify(e)}]`);let c=this.session.textureManager.createTextureFromLayout(o,e,s,$);return this.createTextureDataFromTexture(e,o,c,a)}reshapeUnpacked(e,o){let s=this.getOrCreateTextureData(e,0),a={channels:s.channels,height:s.height,width:s.width,shape:o.length!==0?o:[1],strides:B.computeStrides(o),unpackedShape:o};return this.createTextureDataFromTexture(a,e.type,s.texture).tensor}reshapePacked(e,o){let s=this.getOrCreateTextureData(e,2);if(rl(e.dims,o)){let at={channels:s.channels,height:s.height,width:s.width,shape:o.length!==0?o:[1],strides:B.computeStrides(o),unpackedShape:o,isPacked:!0};return this.createTextureDataFromTexture(at,e.type,s.texture).tensor}let a=fi(e.dims),$=fi(o),c=this.reshapePacked(e,a),nt=this.run(el(this,c,$),[c]);return this.reshapePacked(nt,o)}cast(e,o){let s=this.getOrCreateTextureData(e,0);return this.createTextureDataFromTexture(s,o,s.texture).tensor}createTextureDataFromTexture(e,o,s,a,$){let c={...e,tensor:a||new bt(e.unpackedShape,o,nt=>this.readTexture(c),async nt=>this.readTextureAsync(c),void 0,$),texture:s};return this.setTextureData(c.tensor.dataId,c,e.isPacked),c}getTextureData(e,o=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,o):o?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,o,s=!1){this.session.isInitializer(e)?this.session.setTextureData(e,o,s):(s?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,o)}isTextureLayoutCached(e,o=!1){return!!this.getTextureData(e.dataId,o)}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(ci(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(ci(this,e))}pack(e){return this.executeProgram(Qu(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram(al(this,e.tensor),[e.tensor])}}}),di,W,It=O(()=>{di=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this.key}},W=e=>new di(e)}),pl,dl,hl,Lh,$h,ml=O(()=>{It(),ut(),j(),pl={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[0,0,0,0,0]},dl=(e,o,s)=>($h(o),[e.run({...pl,cacheHint:s.cacheKey,get:()=>Lh(e,o,s)},o)]),hl=e=>{let o=e.attributes.getFloat("epsilon",1e-5),s=e.attributes.getFloat("momentum",.9),a=e.attributes.getInt("spatial",1);return W({epsilon:o,momentum:s,spatial:a})},Lh=(e,o,s)=>{let a=G(e.session.backend.glContext.version),$=o[0].dims.length,[c,nt]=e.calculateTextureWidthAndHeight(o[1].dims,0),at=`
float process(int[${$}] indices) {
vec2 position = offsetToCoords(indices[1], ${c}, ${nt});
float scale = getColorAsFloat(${a.texture2D}(Scale, position));
float mean = getColorAsFloat(${a.texture2D}(Mean, position));
float variance = getColorAsFloat(${a.texture2D}(Variance, position));
float b = getColorAsFloat(${a.texture2D}(B, position));
return scale * ( (_A(indices) - mean) / sqrt(variance + float(${s.epsilon})) ) + b;
}`;return{...pl,output:{dims:o[0].dims,type:o[0].type,textureType:0},shaderSource:at}},$h=e=>{if(!e||e.length!==5)throw new Error("BatchNormalization requires 5 inputs.");let o=e[0],s=e[1],a=e[2],$=e[3],c=e[4];if(o.dims.length<3||s.dims.length!==1||a.dims.length!==1||$.dims.length!==1||c.dims.length!==1)throw new Error("invalid input shape.");if(s.dims[0]!==o.dims[1]||a.dims[0]!==o.dims[1]||$.dims[0]!==o.dims[1]||c.dims[0]!==o.dims[1])throw new Error("invalid input shape.");if(o.type!=="float32"&&o.type!=="float64"||s.type!=="float32"&&s.type!=="float64"||a.type!=="float32"&&a.type!=="float64"||$.type!=="float32"&&$.type!=="float64"||c.type!=="float32"&&c.type!=="float64")throw new Error("invalid input tensor types.")}}),Ln,Ht,k,Nr,$n,Te=O(()=>{Ln=class{constructor(e,o,s,a){this.glContext=e,this.programInfo=o,this.inputTextureLayouts=s,this.outputTextureLayout=a}},Ht=class{constructor(e){this.context=e}},k=class{constructor(e,o){this.routineBody=e,this.dependencies=o}},Nr=class{constructor(e,o,s){this.name=e,s?this.dependencies=s:this.dependencies=[],o&&(this.routineBody=o)}addDependency(e){e&&this.dependencies.push(e)}},$n=class{static returnOrderedNodes(e){if(!e||e.length===0)return[];if(e.length===1)return e;let o=new Set,s=new Set,a=new Array;return this.createOrderedNodes(e,o,s,a),a}static createOrderedNodes(e,o,s,a){for(let $=0;$<e.length;++$)this.dfsTraverse(e[$],o,s,a)}static dfsTraverse(e,o,s,a){if(!e||s.has(e.name))return;if(o.has(e.name))throw new Error("Cyclic dependency detected. Can't topologically sort routines needed for shader.");o.add(e.name);let $=e.dependencies;if($&&$.length>0)for(let c=0;c<$.length;++c)this.dfsTraverse($[c],o,s,a);a.push(e),s.add(e.name),o.delete(e.name)}}});function Bh(){let e="add_";return{body:`
float ${e}(float a, float b) {
return a + b;
}
vec4 ${e}(vec4 v1, vec4 v2) {
return v1 + v2;
}
`,name:e,type:0}}function Fh(){let e="div_";return{body:`
float ${e}(float a, float b) {
return a / b;
}
vec4 ${e}(vec4 v1, vec4 v2) {
return v1 / v2;
}
`,name:e,type:0}}function Ch(){let e="mul_";return{body:`
float ${e}(float a, float b) {
return a * b;
}
vec4 ${e}(vec4 v1, vec4 v2) {
return v1 * v2;
}
`,name:e,type:0}}function Nh(){let e="sub_";return{body:`
float ${e}(float a, float b) {
return a - b;
}
vec4 ${e}(vec4 v1, vec4 v2) {
return v1 - v2;
}
`,name:e,type:0}}function Rh(){let e="equal_";return{body:`
float ${e}(float a, float b) {
return float(a == b);
}
vec4 ${e}(vec4 v1, vec4 v2) {
return vec4(equal(v1, v2));
}
`,name:e,type:0}}function Gh(){let e="greater_";return{body:`
float ${e}(float a, float b) {
return float(a > b);
}
vec4 ${e}(vec4 v1, vec4 v2) {
return vec4( v1.r > v2.r ,
v1.g > v2.g,
v1.b > v2.b,
v1.a > v2.a );
}
`,name:e,type:0}}function Mh(){let e="less_";return{body:`
float ${e}(float a, float b) {
return float(a < b);
}
vec4 ${e}(vec4 v1, vec4 v2) {
return vec4( v1.r < v2.r ,
v1.g < v2.g,
v1.b < v2.b,
v1.a < v2.a );
}
`,name:e,type:0}}function Uh(){let e="and_";return{body:`
float ${e}(float a, float b) {
return float( bool(a) && bool(b) );
}
vec4 ${e}(vec4 v1, vec4 v2) {
bvec4 b1 = bvec4(v1);
bvec4 b2 = bvec4(v2);
return vec4( b1.r && b2.r ,
b1.g && b2.g,
b1.b && b2.b,
b1.a && b2.a );
}
`,name:e,type:0}}function Vh(){let e="or_";return{body:`
float ${e}(float a, float b) {
return float( bool(a) || bool(b) );
}
vec4 ${e}(vec4 v1, vec4 v2) {
bvec4 b1 = bvec4(v1);
bvec4 b2 = bvec4(v2);
return vec4( b1.r || b2.r ,
b1.g || b2.g,
b1.b || b2.b,
b1.a || b2.a );
}
`,name:e,type:0}}function zh(){let e="xor_";return{body:`
float ${e}(float a, float b) {
return float( bool(a) ^^ bool(b) );
}
vec4 ${e}(vec4 v1, vec4 v2) {
bvec4 b1 = bvec4(v1);
bvec4 b2 = bvec4(v2);
return vec4( b1.r ^^ b2.r ,
b1.g ^^ b2.g,
b1.b ^^ b2.b,
b1.a ^^ b2.a );
}
`,name:e,type:0}}function Wh(){return qh("pow")}function Hh(){let e="prelu_";return{body:`
float ${e}(float a, float b) {
return a < 0.0 ? a * b: a;
}
vec4 ${e}(vec4 v1, vec4 v2) {
return vec4(
v1.r < 0.0 ? v1.r * v2.r: v1.r,
v1.g < 0.0 ? v1.g * v2.g: v1.g,
v1.b < 0.0 ? v1.b * v2.b: v1.b,
v1.a < 0.0 ? v1.a * v2.a: v1.a
);
}
`,name:e,type:0}}function qh(e){let o=`${e}_`;return{body:`
float ${o}(float a, float b) {
return ${e}(a, b);
}
vec4 ${o}(vec4 v1, vec4 v2) {
return ${e}(v1, v2);
}
`,name:o,type:0}}var qt,jh,bl,gl,yl,xl,Tl,wl,vl,Il,_l,Ol,Sl,Al,Pl=O(()=>{Y(),Te(),ut(),j(),qt=(e,o,s,a=o[0].type,$)=>{let c=e.session.pack?2:0;return{name:s.name,inputNames:["A","B"],inputTypes:[c,c],cacheHint:$,get:()=>jh(e,o,s,a)}},jh=(e,o,s,a=o[0].type)=>{let $=e.session.pack?2:0,c=!B.areEqual(o[0].dims,o[1].dims),nt=o[0].dims,at=e.session.pack;if(c){let it=kt.calcShape(o[0].dims,o[1].dims,!1);if(!it)throw new Error("Can't perform binary op on the given tensors");nt=it;let st=nt.length,ct=o[0].dims.length!==0?o[0].dims.length:1,ft=o[1].dims.length!==0?o[1].dims.length:1,pt=o[0].dims.length!==0?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",gt=o[1].dims.length!==0?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",wt=G(e.session.backend.glContext.version),vt=at?`
${s.body}
void main() {
vec4 a = getAAtOutCoords();
vec4 b = getBAtOutCoords();
vec4 result = ${s.name}(a, b);
${wt.output} = result;
}`:`
${s.body}
float process(int indices[${st}]) {
int aindices[${ct}];
int bindices[${ft}];
${pt}
${gt}
return ${s.name}(_A(aindices), _B(bindices));
}`;return{name:s.name,inputNames:["A","B"],inputTypes:[$,$],output:{dims:nt,type:a,textureType:$},shaderSource:vt,hasMain:at}}let lt=G(e.session.backend.glContext.version),et=`
${s.body}
void main() {
vec4 v1 = ${lt.texture2D}(A, TexCoords);
vec4 v2 = ${lt.texture2D}(B, TexCoords);
vec4 result = ${s.name}(v1, v2);
${lt.output} = result;
}
`;return{name:s.name,inputNames:["A","B"],inputTypes:[$,$],output:{dims:o[0].dims,type:a,textureType:$},shaderSource:et,hasMain:!0}},bl=(e,o)=>[e.run(qt(e,o,Bh()),o)],gl=(e,o)=>[e.run(qt(e,o,Uh(),"bool"),o)],yl=(e,o)=>[e.run(qt(e,o,Fh()),o)],xl=(e,o)=>[e.run(qt(e,o,Rh(),"bool"),o)],Tl=(e,o)=>[e.run(qt(e,o,Gh(),"bool"),o)],wl=(e,o)=>[e.run(qt(e,o,Mh(),"bool"),o)],vl=(e,o)=>[e.run(qt(e,o,Ch()),o)],Il=(e,o)=>[e.run(qt(e,o,Vh(),"bool"),o)],_l=(e,o)=>[e.run(qt(e,o,Wh()),o)],Ol=(e,o)=>[e.run(qt(e,o,Hh()),o)],Sl=(e,o)=>[e.run(qt(e,o,Nh()),o)],Al=(e,o)=>[e.run(qt(e,o,zh(),"bool"),o)]}),El,Dl,Kh,Ll=O(()=>{Y(),El=(e,o,s)=>(Kh(o),[e.cast(o[0],s)]),Dl=e=>At.tensorDataTypeFromProto(e.attributes.getInt("to")),Kh=e=>{if(!e||e.length!==1)throw new Error("Cast requires 1 input.");if(e[0].type==="string")throw new Error("Invalid input type.")}}),Jh,Yh,$l,kn,kl=O(()=>{ut(),j(),pe(),He(),Jh=(e,o)=>({name:"Concat (packed)",inputNames:Array.from({length:e},(s,a)=>`X${a}`),inputTypes:Array(e).fill(2),cacheHint:o}),Yh=(e,o,s,a)=>{let $=s[0].dims.slice();if(a>=$.length||a<-1*$.length)throw new Error("axis specified for concat doesn't match input dimensionality");a<0&&(a=$.length+a);let c=$.slice(0);for(let Nt=1;Nt<s.length;Nt++){let Lt=s[Nt].dims.slice();for(let Ft=0;Ft<$.length;Ft++)if(Ft===a)c[a]+=Lt[Ft];else if($[Ft]!==Lt[Ft])throw new Error("non concat dimensions must match")}let nt=c.length,at=cr("coords",nt),lt=Bt(nt),et=de(),it=s.map(Nt=>Nt.dims),st=ne(nt),ct=new Array(it.length-1);ct[0]=it[0][a];for(let Nt=1;Nt<ct.length;Nt++)ct[Nt]=ct[Nt-1]+it[Nt][a];let ft=st[a],pt=st.slice(-2),gt=st.join(),wt=`if (${ft} < ${ct[0]}) {
return getChannel(
getX0(${gt}), vec2(${pt.join()}));
}`;for(let Nt=1;Nt<ct.length;Nt++){let Lt=ct[Nt-1];wt+=`
if (${ft} < ${ct[Nt]} && ${ft} >= ${ct[Nt-1]}) {
return getChannel(
getX${Nt}(${kn(st,ft,Lt)}),
vec2(${kn(pt,ft,Lt)}));
}`}let vt=ct.length,_t=ct[ct.length-1];wt+=`
return getChannel(
getX${vt}(${kn(st,ft,_t)}),
vec2(${kn(pt,ft,_t)}));`;let $t=G(e.session.backend.glContext.version),Pt=`
${et}
float getValue(${st.map(Nt=>"int "+Nt)}) {
${wt}
}
void main() {
${lt} coords = getOutputCoords();
int lastDim = coords.${st[nt-1]};
coords.${st[nt-1]} = coords.${st[nt-2]};
coords.${st[nt-2]} = lastDim;
vec4 result = vec4(getValue(${at}), 0., 0., 0.);
${at[nt-1]} = ${at[nt-1]} + 1;
if (${at[nt-1]} < ${c[nt-1]}) {
result.g = getValue(${at});
}
${at[nt-2]} = ${at[nt-2]} + 1;
if (${at[nt-2]} < ${c[nt-2]}) {
result.a = getValue(${at});
}
${at[nt-1]} = ${at[nt-1]} - 1;
if (${at[nt-2]} < ${c[nt-2]} &&
${at[nt-1]} < ${c[nt-1]}) {
result.b = getValue(${at});
}
${$t.output} = result;
}
`;return{...o,output:{dims:c,type:s[0].type,textureType:2},shaderSource:Pt,hasMain:!0}},$l=(e,o,s)=>{let a=Jh(o.length,s.cacheKey);return{...a,get:()=>Yh(e,a,o,s.axis)}},kn=(e,o,s)=>{let a=e.indexOf(o);return e.map(($,c)=>c===a?`${$} - ${s}`:$).join()}}),Bl,Zh,Qh,tm,Fl,em,rm,nm,Cl,om,Nl=O(()=>{It(),j(),kl(),Bl=(e,o,s)=>(om(o),e.session.pack&&o[0].dims.length>1?[e.run($l(e,o,s),o)]:[e.run(tm(e,o,s),o)]),Zh=(e,o)=>({name:"Concat",inputNames:Array.from({length:e},(s,a)=>`X${a}`),inputTypes:Array(e).fill(0),cacheHint:o}),Qh=(e,o,s,a)=>{let $=s[0].dims.slice();if(a>=$.length||a<-1*$.length)throw new Error("axis specified for concat doesn't match input dimensionality");a<0&&(a=$.length+a);let c=$.slice(0);for(let ft=1;ft<s.length;ft++){let pt=s[ft].dims.slice();for(let gt=0;gt<$.length;gt++)if(gt===a)c[a]+=pt[gt];else if($[gt]!==pt[gt])throw new Error("non concat dimensions must match")}let nt=c.length,at=new Array(s.length),lt=0;for(let ft=0;ft<at.length;++ft)lt+=s[ft].dims[a],at[ft]=lt;let et="";s.length<5?et=Fl(at):et=em(at);let it=rm(s.length,nt),st=nm(at),ct=`
${it}
${st}
${et}
float process(int indices[${nt}]) {
int textureIndex = getTextureWhereDataResides (indices[${a}]);
if(textureIndex != 0) {
indices[${a}] = indices[${a}] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));
}
return fetchDataFromCorrectTexture(textureIndex, indices);
}`;return{...o,output:{dims:c,type:s[0].type,textureType:0},shaderSource:ct}},tm=(e,o,s)=>{let a=Zh(o.length,s.cacheKey);return{...a,get:()=>Qh(e,a,o,s.axis)}},Fl=e=>`int getTextureWhereDataResides(int index) {
${e.map((o,s)=>`if(index<${o}) {return ${s};}
`).join("")}
}`,em=e=>Fl(e),rm=(e,o)=>{let s=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${o}]) {`];for(let a=0;a<e;++a)a===0?s.push(` if (textureIndex == ${a}) { return _X${a}(indices); }`):a===e-1?s.push(` else { return _X${a}(indices); }`):s.push(` else if (textureIndex == ${a}) { return _X${a}(indices); }`);return s.push(" }"),s.join(`
`)},nm=e=>{let o=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let s=0;s<e.length;++s)s===0?o.push(` if (index == ${s}) { return ${e[s]}; }`):s===e.length-1?o.push(` else { return ${e[s]}; }`):o.push(` else if (index == ${s}) { return ${e[s]}; }`);return o.push(" }"),o.join(`
`)},Cl=e=>W({axis:e.attributes.getInt("axis")}),om=e=>{if(!e||e.length<1)throw new Error("too few inputs");let o=e[0].type,s=e[0].dims.length;if(o==="string")throw new Error("string tensor is not supported yet");for(let a of e){if(a.type!==o)throw new Error("input tensors should be one type");if(a.dims.length!==s)throw new Error("input tensors should have the same shape")}}});function im(){return jt("abs")}function am(){return jt("acos")}function sm(){return jt("asin")}function um(){return jt("atan")}function lm(){return jt("ceil")}function fm(){return jt("cos")}function cm(e){let o="elu";return{body:`
const float alpha = float(${e});
float ${o}_(float a) {
return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;
}
vec4 ${o}_(vec4 v) {
return vec4(${o}_(v.x), ${o}_(v.y), ${o}_(v.z), ${o}_(v.w));
}
`,name:o,type:0}}function pm(){return jt("exp")}function dm(){return jt("floor")}function hi(e,o){let s="clip";return{body:`
const float min = float(${e});
const float max = float(${o});
float ${s}_(float a) {
return clamp(a, min, max);
}
vec4 ${s}_(vec4 v) {
return clamp(v, min, max);
}
`,name:s,type:0}}function hm(){let e="indentity";return{body:`
float ${e}_(float a) {
return a;
}
vec4 ${e}_(vec4 v) {
return v;
}
`,name:e,type:0}}function mm(e){let o="leakyRelu";return{body:`
const float alpha = float(${e});
float ${o}_(float a) {
return a < 0.0 ? a * alpha : a;
}
vec4 ${o}_(vec4 v) {
return vec4(${o}_(v.x), ${o}_(v.y), ${o}_(v.z), ${o}_(v.w));
}
`,name:o,type:0}}function bm(){return jt("log")}function gm(){let e="neg";return{body:`
float ${e}_(float a) {
return -a;
}
vec4 ${e}_(vec4 v) {
return -v;
}
`,name:e,type:0}}function ym(){let e="not";return{body:`
float ${e}_(float a) {
return float( ! bool(a) );
}
bool ${e}_(bool a) {
return !a;
}
vec4 ${e}_(vec4 v) {
return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));
}
bvec4 ${e}_(bvec4 v) {
return bvec4(!v.x, !v.y, !v.z, !v.w);
}
`,name:e,type:0}}function xm(){return jt("sin")}function mi(){let e="relu";return{body:`
float ${e}_(float a) {
return max( a, 0.0 );
}
vec4 ${e}_(vec4 v) {
return max( v, 0.0 );
}
`,name:e,type:0}}function bi(){let e="sigmoid";return{body:`
float ${e}_(float a) {
return 1.0 / (1.0 + exp(-a));
}
vec4 ${e}_(vec4 v) {
return 1.0 / (1.0 + exp(-v));
}
`,name:e,type:0}}function Tm(){return jt("sqrt")}function wm(){return jt("tan")}function vm(){let e="tanh";return{body:`
float ${e}_(float a) {
a = clamp(a, -10., 10.);
a = exp(2.*a);
return (a - 1.) / (a + 1.);
}
vec4 ${e}_(vec4 v) {
v = clamp(v, -10., 10.);
v = exp(2.*v);
return (v - 1.) / (v + 1.);
}
`,name:e,type:0}}function jt(e){return{body:`
float ${e}_(float a) {
return ${e}(a);
}
vec4 ${e}_(vec4 v) {
return ${e}(v);
}
`,name:e,type:0}}var Im,dt,Rl,Gl,Ml,Ul,gi,Vl,zl,_m,Wl,Hl,ql,jl,Xl,Kl,yi,Jl,Yl,Zl,Ql,tf,ef,rf,nf,of,af,sf,xi=O(()=>{It(),Y(),Te(),ut(),j(),Im=(e,o,s,a)=>{let $=e.session.pack?2:0,c=G(e.session.backend.glContext.version);return{...o,output:{dims:s.dims,type:s.type,textureType:$},shaderSource:`
${a.body}
void main() {
vec4 v = ${c.texture2D}(A, TexCoords);
v = ${a.name}_(v);
${c.output} = v;
}
`,hasMain:!0}},dt=(e,o,s,a)=>{let $=e.session.pack?2:0,c={name:s.name,inputTypes:[$],inputNames:["A"],cacheHint:a};return{...c,get:()=>Im(e,c,o,s)}},Rl=(e,o)=>[e.run(dt(e,o[0],im()),o)],Gl=(e,o)=>[e.run(dt(e,o[0],am()),o)],Ml=(e,o)=>[e.run(dt(e,o[0],sm()),o)],Ul=(e,o)=>[e.run(dt(e,o[0],um()),o)],gi=(e,o,s)=>[e.run(dt(e,o[0],hi(s.min,s.max),s.cacheKey),o)],Vl=e=>W({min:e.attributes.getFloat("min",Ve),max:e.attributes.getFloat("max",ze)}),zl=(e,o)=>{let s=_m(e,o);return gi(e,[o[0]],s)},_m=(e,o)=>{if(o.length>=3&&(!e.session.isInitializer(o[1].dataId)||!e.session.isInitializer(o[2].dataId)))throw new Error("dynamic clip attributes are not allowed");let s=o.length>=3?o[1].numberData[0]:Ve,a=o.length>=3?o[2].numberData[0]:ze;return W({min:s,max:a})},Wl=(e,o)=>[e.run(dt(e,o[0],lm()),o)],Hl=(e,o)=>[e.run(dt(e,o[0],fm()),o)],ql=(e,o,s)=>[e.run(dt(e,o[0],cm(s.alpha),s.cacheKey),o)],jl=e=>W({alpha:e.attributes.getFloat("alpha",1)}),Xl=(e,o)=>[e.run(dt(e,o[0],pm()),o)],Kl=(e,o)=>[e.run(dt(e,o[0],dm()),o)],yi=(e,o)=>[e.run(dt(e,o[0],hm()),o)],Jl=(e,o,s)=>[e.run(dt(e,o[0],mm(s.alpha),s.cacheKey),o)],Yl=e=>W({alpha:e.attributes.getFloat("alpha",.01)}),Zl=(e,o)=>[e.run(dt(e,o[0],bm()),o)],Ql=(e,o)=>[e.run(dt(e,o[0],gm()),o)],tf=(e,o)=>[e.run(dt(e,o[0],ym()),o)],ef=(e,o)=>[e.run(dt(e,o[0],mi()),o)],rf=(e,o)=>[e.run(dt(e,o[0],bi()),o)],nf=(e,o)=>[e.run(dt(e,o[0],xm()),o)],of=(e,o)=>[e.run(dt(e,o[0],Tm()),o)],af=(e,o)=>[e.run(dt(e,o[0],wm()),o)],sf=(e,o)=>[e.run(dt(e,o[0],vm()),o)]});function he(e){let o;switch(e.activation){case"Relu":o=mi();break;case"Sigmoid":o=bi();break;case"Clip":o=hi(e.clipMin,e.clipMax);break;default:return{activationFunction:"",applyActivation:""}}let s=o.name,a=o.body,$=`value = ${s}_(value);`;return{activationFunction:a,applyActivation:$}}var pr,qe=O(()=>{Y(),xi(),pr=e=>{let o=e.getString("activation","");if(o==="Clip"){let[s,a]=e.getFloats("activation_params",[Ve,ze]);return{activation:o,clipMax:a,clipMin:s,activationCacheKey:`${o}:${s},${a}`}}return{activation:o,activationCacheKey:o}}}),Sm,Am,uf,lf=O(()=>{Ut(),ut(),j(),Bn(),qe(),Sm=(e,o)=>({name:"GroupedConv",inputNames:e?["X","W","Bias"]:["X","W"],inputTypes:e?[0,0,0]:[0,0],cacheHint:o}),Am=(e,o,s,a)=>{let $=o.length>2?"value += getBias(output_channel);":"",c=o[0].dims.slice(),nt=o[1].dims.slice(),at=nt[0]/a.group;tt.verbose("GroupedConv",`autpPad:${a.autoPad}, dilations:${a.dilations}, group:${a.group}, kernelShape:${a.kernelShape}, pads:${a.pads}, strides:${a.strides}`);let lt=dr(c,nt,a.dilations,a.pads,a.strides),et=G(e.session.backend.glContext.version),{activationFunction:it,applyActivation:st}=he(a),ct=`
const ivec2 strides = ivec2(${a.strides[0]}, ${a.strides[1]});
const ivec2 pads = ivec2(${a.pads[0]}, ${a.pads[1]});
${it}
void main() {
ivec4 coords = getOutputCoords();
int batch = coords.x;
int output_channel = coords.y;
ivec2 xRCCorner = coords.zw * strides - pads;
int group_id = output_channel / ${at};
float value = 0.0;
for (int wInChannel = 0; wInChannel < ${nt[1]}; wInChannel++) {
int input_channel = group_id * ${nt[1]} + wInChannel;
for (int wHeight = 0; wHeight < ${nt[2]}; wHeight++) {
int xHeight = xRCCorner.x + wHeight * ${a.dilations[0]};
if (xHeight < 0 || xHeight >= ${c[2]}) {
continue;
}
for (int wWidth = 0; wWidth < ${nt[3]}; wWidth++) {
int xWidth = xRCCorner.y + wWidth * ${a.dilations[1]};
if (xWidth < 0 || xWidth >= ${c[3]}) {
continue;
}
float xVal = getX(batch, input_channel, xWidth, xHeight);
float wVal = getW(output_channel, wInChannel, wWidth, wHeight);
value += xVal*wVal;
}
}
}
${$}
${st}
${et.output} = vec4(value, .0, .0, .0);
}
`;return{...s,output:{dims:lt,type:o[0].type,textureType:0},shaderSource:ct,hasMain:!0}},uf=(e,o,s)=>{let a=Sm(o.length>2,s.cacheKey);return{...a,get:()=>Am(e,o,a,s)}}}),Pm,Em,ff,cf=O(()=>{ut(),j(),He(),Pm=e=>({name:"Im2Col (packed)",inputNames:["A"],inputTypes:[2],cacheHint:e}),Em=(e,o,s,a,$,c)=>{let nt=s.dims,at=a.dims,lt=2,et=3,it=$.length,st=[at[1]*at[2]*at[3],$[2]*$[3]],ct=at[2]*at[3],ft=de(),pt=G(e.session.backend.glContext.version),gt="";for(let vt=0;vt<=1;vt++)for(let _t=0;_t<=1;_t++)gt+=`
blockIndex = rc.x + ${_t};
pos = rc.y + ${vt};
if(blockIndex < ${st[1]} && pos < ${st[0]}) {
offsetY = int(blockIndex / (${$[it-1]})) * ${c.strides[0]} -
${c.pads[0]};
d0 = offsetY + ${c.dilations[0]} * (imod(pos, ${ct}) / ${at[2]});
if(d0 < ${nt[lt]} && d0 >= 0) {
offsetX = imod(blockIndex, ${$[it-1]}) * ${c.strides[1]} -
${c.pads[1]};
d1 = offsetX + ${c.dilations[1]} * imod(imod(pos, ${ct}), ${at[2]});
if(d1 < ${nt[et]} && d1 >= 0) {
ch = int(float(pos)/ ${ct}.);
innerDims = vec2(d0, d1);
result[${vt*2+_t}] = getChannel(
getA(0, ch, int(innerDims.x),
int(innerDims.y)), innerDims);
}
}
}
`;let wt=`
${ft}
void main() {
ivec2 rc = getOutputCoords();
vec4 result = vec4(0.0);
int blockIndex, pos, offsetY, d0, offsetX, d1, ch;
vec2 innerDims;
${gt}
${pt.output} = result;
}
`;return{...o,output:{dims:st,type:s.type,textureType:2},shaderSource:wt,hasMain:!0}},ff=(e,o,s,a,$)=>{let c=Pm($.cacheKey);return{...c,get:()=>Em(e,c,o,s,a,$)}}});function Lm(e,o,s){let a=o[0].dims,$=o[1].dims,c=kt.calcShape(a,$,!0);if(!c)throw new Error("Can't use matmul on the given tensors");let nt=Bt(c.length),at=ne(),{activationFunction:lt,applyActivation:et}=he(s),it=o.length>2,st=it?"value += getBiasForMatmul();":"",ct=it?`${wi(nt,at,o[2].dims,c,!1)}`:"",ft=c.length,pt=a.length,gt=$.length,wt=a[a.length-1],vt=`
${lt}
${ct}
float process(int indices[${ft}]) {
int a[${pt}];
int b[${gt}];
bcastMatmulIndices_A(indices, a);
bcastMatmulIndices_B(indices, b);
float value;
for (int k=0; k<${wt}; ++k) {
a[${pt-1}] = k;
b[${gt-2}] = k;
value += _A(a) * _B(b);
}
${st}
${et}
return value;
}`;return{...e,output:{dims:c,type:o[0].type,textureType:0},shaderSource:vt}}function Ti(e,o){let s=Dm(e.length>2,o.activationCacheKey);return{...s,get:()=>Lm(s,e,o)}}function wi(e,o,s,a,$){let c="",nt=s.length,at=a.length,lt=at-nt;at<2&&nt>0?c="coords":c=s.map((ct,ft)=>`coords.${o[ft+lt]}`).join(", ");let et=kt.getBroadcastDims(s,a).map(ct=>`coords.${o[ct+lt]} = 0;`).join(`
`),it=B.size(s)===1,st="vec4(outputValue.xx, outputValue.yy)";return it&&(st="vec4(outputValue.x)"),$?`
vec4 getBiasForMatmul() {
${e} coords = getOutputCoords();
${et}
vec4 outputValue = getBias(${c});
return ${st};
}`:`
float getBiasForMatmul() {
${e} coords = getOutputCoords();
${et}
return getBias(coords.x);
}`}var pf,df,Dm,$m,Fn=O(()=>{Y(),j(),pe(),qe(),vi(),pf=(e,o,s)=>($m(o),e.session.pack?[e.run(Cn(e,o,s),o)]:[e.run(Ti(o,s),o)]),df=e=>pr(e.attributes),Dm=(e,o)=>({name:"MatMul",inputNames:e?["A","B","Bias"]:["A","B"],inputTypes:e?[0,0,0]:[0,0],cacheHint:o}),$m=e=>{if(!e||e.length!==2)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(e[0].type!=="float32"&&e[0].type!=="float64"||e[1].type!=="float32"&&e[1].type!=="float64")throw new Error("inputs should be float type");if(e[0].type!==e[1].type)throw new Error("inputs types should match")}});function Fm(e,o,s,a){let $=[],c=[],nt=s[0].dims,at=s[1].dims,lt=nt.length,et=at.length,it=a.length,st=it-lt,ct=it-et;$=nt.map((_t,$t)=>`coords.${o[$t+st]}`),$[lt-1]="i*2",$.join(", "),c=at.map((_t,$t)=>`coords.${o[$t+ct]}`),c[et-2]="i*2",c.join(", ");let ft=kt.getBroadcastDims(nt,a),pt=kt.getBroadcastDims(at,a),gt=ft.map(_t=>`coords.${o[_t+st]} = 0;`).join(`
`),wt=pt.map(_t=>`coords.${o[_t+ct]} = 0;`).join(`
`),vt=`int lastDim = coords.${o[it-1]};
coords.${o[it-1]} = coords.${o[it-2]};
coords.${o[it-2]} = lastDim;`;return`
vec4 getAAtOutCoordsMatmul(int i) {
${e} coords = getOutputCoords();
${vt}
${gt}
vec4 outputValue = getA(${$});
return outputValue;
}
vec4 getBAtOutCoordsMatmul(int i) {
${e} coords = getOutputCoords();
${vt}
${wt}
vec4 outputValue = getB(${c});
return outputValue;
}`}function Cm(e,o){let s="";for(let a=0;a<o-2;a++)s+=`rc.${e[a]}, `;return s+=`rc.${e[o-2]}, i*2`,s}function Nm(e,o){let s="";for(let a=0;a<o-2;a++)s+=`rc.${e[a]}, `;return s+=`i*2, rc.${e[o-1]}`,s}var km,Bm,Cn,vi=O(()=>{Y(),ut(),j(),pe(),qe(),Fn(),km=(e,o)=>({name:"MatMul (packed)",inputNames:e?["A","B","Bias"]:["A","B"],inputTypes:e?[2,2,2]:[2,2],cacheHint:o}),Bm=(e,o,s,a)=>{let $=s.length>2,c=$?"value += getBiasForMatmul();":"",nt=s[0].dims,at=s[1].dims,lt=kt.calcShape(nt,at,!0),et=!B.areEqual(s[0].dims,s[1].dims);if(!lt)throw new Error("Can't use matmul on the given tensors");let it=nt[nt.length-1],st=Math.ceil(it/2),ct=nt.length,ft=at.length,pt=G(e.session.backend.glContext.version),gt=Bt(lt.length),wt=lt.length,vt=ne(),{activationFunction:_t,applyActivation:$t}=he(a),Pt=$?`${wi(gt,vt,s[2].dims,lt,!0)}`:"",Nt=et?`${Fm(gt,vt,s,lt)}`:"",Lt=et?"getAAtOutCoordsMatmul(i)":`getA(${Cm(vt,ct)})`,Ft=et?"getBAtOutCoordsMatmul(i)":`getB(${Nm(vt,ft)})`,Jt=et?"":`${gt} rc =
getOutputCoords(); int lastDim = rc.${vt[wt-1]}; rc.${vt[wt-1]} =
rc.${vt[wt-2]}; rc.${vt[wt-2]} = lastDim;
`,_r=`
${Nt}
${Pt}
${_t}
void main() {
${Jt}
vec4 value = vec4(0);
for (int i = 0; i < ${st}; i++) {
vec4 a = ${Lt};
vec4 b = ${Ft};
value += (a.rrbb * b.rgrg);
value += (a.ggaa * b.baba);
}
${c}
${$t}
${pt.output} = value;
}`;return{...o,output:{dims:lt,type:s[0].type,textureType:2},shaderSource:_r,hasMain:!0}},Cn=(e,o,s)=>{let a=km(o.length>2,s.activationCacheKey);return{...a,get:()=>Bm(e,a,o,s)}}}),hf,mf=O(()=>{Bn(),cf(),vi(),hf=(e,o,s)=>{let a=o[0].dims,$=o[1].dims,c=dr(a,$,s.dilations,s.pads,s.strides),nt=e.run(ff(e,o[0],o[1],c,s),[o[0]]),at=e.reshapePacked(o[1],[$[0],$[1]*$[2]*$[3]]),lt=o.length===3?[at,nt,o[2]]:[at,nt],et=e.run(Cn(e,lt,s),lt);return e.reshapePacked(et,c)}}),Rm,Gm,bf,Ii,_i=O(()=>{j(),Rm=e=>({name:"Im2Col",inputNames:["X"],inputTypes:[0],cacheHint:e}),Gm=(e,o,s,a,$,c)=>{let nt=s.dims,at=a.dims,lt=$.length,et=Ii(nt,at,$,4),it=`
const int XC = ${nt[1]};
const int XH = ${nt[2]};
const int XW = ${nt[3]};
const int KH = ${c.kernelShape[0]};
const int KW = ${c.kernelShape[1]};
const int dilationH = ${c.dilations[0]};
const int dilationW = ${c.dilations[1]};
const int strideH = ${c.strides[0]};
const int strideW = ${c.strides[1]};
const int padH = ${c.pads[0]};
const int padW = ${c.pads[1]};
const int KHKW = KH*KW;
const int XCKHKW = XC * KHKW;
const int outputChannels = 4;
vec4 process(int indices[${lt}]) {
int b = indices[0]; // batch size
int oh = indices[1] * strideH - padH; //output height
int ow = indices[2] * strideW - padW; //output width
int p = indices[3] * outputChannels; //patch
vec4 value = vec4(0.0);
for(int i=0; i < outputChannels; ++i) {
if(p < XCKHKW) {
int patchC = p / KHKW;
int patchH = (p - patchC*KHKW) / KW;
int patchW = (p - patchC*KHKW) - patchH * KW;
int xh2 = oh + patchH * dilationH;
int xw2 = ow + patchW * dilationW;
int x[${nt.length}];
x[0] = b;
x[1] = patchC;
x[2] = xh2;
x[3] = xw2;
if(xh2 >= 0 &&
xh2 < XH &&
xw2 >= 0 &&
xw2 < XW) {
value[i] = _X(x);
}
}
++p;
}
return value;
}
`;return{...o,output:{dims:et,type:s.type,textureType:4},shaderSource:it}},bf=(e,o,s,a,$)=>{let c=Rm($.cacheKey);return{...c,get:()=>Gm(e,c,o,s,a,$)}},Ii=(e,o,s,a=4)=>[s[0],s[2],s[3],Math.ceil(e[1]*o[2]*o[3]/a)]}),Mm,Um,gf,yf=O(()=>{Y(),ut(),j(),qe(),_i(),Mm=(e,o)=>({name:"ConvDotProduct",inputNames:e?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:e?[0,4,0]:[0,4],cacheKey:o.activationCacheKey}),Um=(e,o,s,a,$)=>{let c=s[0].dims,nt=s[1].dims,at=[nt[0],Math.ceil(c[1]*nt[2]*nt[3]/4)],lt=Ii(c,nt,a),[et,it]=e.calculateTextureWidthAndHeight(at,4),st=B.computeStrides(lt),[ct,ft]=e.calculateTextureWidthAndHeight(lt,4),pt=a.length,gt=s.length<3?"0.0":"_B(b)",wt=Math.ceil(c[1]*nt[2]*nt[3]/4),{activationFunction:vt,applyActivation:_t}=he($),$t=G(e.session.backend.glContext.version),Pt=`
${vt}
float process(int indices[${pt}]) {
int b[1];
b[0] = indices[1];
int im2col[4];
im2col[0] = indices[0];
im2col[1] = indices[2];
im2col[2] = indices[3];
int im2colOffset = im2col[0] * ${st[0]} + im2col[1] * ${st[1]} + im2col[2] * ${st[2]};
int kernelOffset = indices[1] * ${at[1]};
float value = ${gt};
for (int i = 0; i < ${wt}; ++i) {
vec2 im2colCoords = offsetToCoords(im2colOffset, ${ct}, ${ft});
vec2 kernelCoords = offsetToCoords(kernelOffset, ${et}, ${it});
value += dot(${$t.texture2D}(Im2Col, im2colCoords), ${$t.texture2D}(K, kernelCoords));
++im2colOffset;
++kernelOffset;
}
${_t}
return value;
}`;return{...o,output:{dims:a,type:s[0].type,textureType:0},shaderSource:Pt}},gf=(e,o,s,a)=>{let $=Mm(o.length>2,a);return{...$,get:()=>Um(e,$,o,s,a)}}}),dr,Oi,Vm,zm,Wm,Hm,Si,qm,Bn=O(()=>{It(),Y(),lf(),mf(),yf(),qe(),_i(),Fn(),dr=(e,o,s,a,$)=>{let c=e[0],nt=e.slice(2),at=nt.length,lt=o[0],et=o.slice(2).map((st,ct)=>st+(st-1)*(s[ct]-1)),it=nt.map((st,ct)=>st+a[ct]+a[ct+at]).map((st,ct)=>Math.floor((st-et[ct]+$[ct])/$[ct]));return[c,lt].concat(...it)},Oi=(e,o,s)=>(qm(o,s),Vm(e,o,s)),Vm=(e,o,s)=>{let a=Hm(s,o),$=e.session.pack,c=a.kernelShape[0]===1&&a.kernelShape[1]===1;return a.group>1?[e.run(uf(e,o,a),o)]:c&&$?[zm(e,o,a)]:$&&o[0].dims.length===4&&o[0].dims[0]===1&&!c?[hf(e,o,a)]:[Wm(e,o,a)]},zm=(e,o,s)=>{let a=o[0].dims,$=o[1].dims,c=dr(a,$,s.dilations,s.pads,s.strides),nt=e.reshapeUnpacked(o[0],[a[1],a[2]*a[3]]),at=e.reshapeUnpacked(o[1],[$[0],$[1]]),lt=o.length>2?[at,nt,o[2]]:[at,nt],et=e.run(Ti(lt,s),lt);return e.reshapeUnpacked(et,c)},Wm=(e,o,s)=>{let a=o[0].dims,$=o[1].dims,c=dr(a,$,s.dilations,s.pads,s.strides),nt=e.run(bf(e,o[0],o[1],c,s),[o[0]]),at=o.length===3?[nt,o[1],o[2]]:[nt,o[1]];return e.run(gf(e,o,c,s),at)},Hm=(e,o)=>{let s=e.kernelShape.slice();if(e.kernelShape.length===0)for(let c=2;c<o[1].dims.length;++c)s.push(o[1].dims[c]);let a=e.pads.slice();Ue.adjustPadsBasedOnAutoPad(o[0].dims,e.strides,e.dilations,s,a,e.autoPad);let $=Object.assign({},e);return Object.assign($,{kernelShape:s,pads:a,cacheKey:e.cacheKey}),$},Si=e=>{let o=e.attributes,s=pr(o),a=o.getString("auto_pad","NOTSET"),$=o.getInts("dilations",[1,1]),c=o.getInt("group",1),nt=o.getInts("kernel_shape",[]),at=o.getInts("pads",[0,0,0,0]),lt=o.getInts("strides",[1,1]);return W({autoPad:a,dilations:$,group:c,kernelShape:nt,pads:at,strides:lt,...s})},qm=(e,o)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length!==4||e[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");let s=e[0].dims[1],a=e[1].dims[1]*o.group;if(s!==a)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");let $=e[0].dims.length-2;if(o.dilations.length!==$)throw new Error(`dilations should be ${$}D`);if(o.strides.length!==$)throw new Error(`strides should be ${$}D`);if(o.pads.length!==$*2)throw new Error(`pads should be ${$*2}D`);if(o.kernelShape.length!==0&&o.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(e[0].type!=="float32"||e[1].type!=="float32")throw new Error("Conv input(X,W) should be float tensor");if(e.length===3&&e[2].type!=="float32")throw new Error("Conv input(bias) should be float tensor")}}),jm,Xm,Km,xf,Jm,Ym,Zm,Qm,tb,eb,Tf,rb,wf=O(()=>{It(),ut(),j(),qe(),jm=(e,o,s,a,$,c)=>(e-1)*o+s+(a-1)*$+1-c,Xm=(e,o,s,a,$)=>{let c=Math.floor(e/2);o==="SAME_UPPER"?(s[a]=c,s[$]=e-c):o==="SAME_LOWER"&&(s[a]=e-c,s[$]=c)},Km=(e,o,s,a,$,c,nt,at)=>{let lt=e.length-2,et=at.length===0;for(let it=0;it<lt;++it){let st=et?e[it+2]*c[it]:at[it],ct=jm(e[it+2],c[it],$[it],o[it],s[it],st);Xm(ct,a,$,it,it+lt),et&&at.push(c[it]*(e[it+2]-1)+nt[it]+(o[it]-1)*s[it]+1-$[it]-$[it+lt])}},xf=(e,o,s)=>(rb(o,s),Jm(e,o,s)),Jm=(e,o,s)=>{let a=eb(s,o);return[tb(e,o,a)]},Ym=(e,o)=>({name:"ConvTranspose",inputNames:e?["X","W","B"]:["X","W"],inputTypes:e?[0,0,0]:[0,0],cacheHint:o}),Zm=(e,o,s,a)=>{let $=o.length>2?"getB(output_channel)":"0.0",c=o[0].dims,nt=o[1].dims,at=nt[1],lt=nt[0]/a.group,et=[o[0].dims[0],o[1].dims[1]*a.group,...a.outputShape],it=G(e.session.backend.glContext.version),{activationFunction:st,applyActivation:ct}=he(a),ft=`
const ivec2 strides = ivec2(${a.strides[0]}, ${a.strides[1]});
const ivec2 pads = ivec2(${a.pads[0]}, ${a.pads[1]});
${st}
void main() {
ivec4 coords = getOutputCoords();
int batch = coords.x;
int output_channel = coords.y;
ivec2 loc = coords.zw + pads;
int group_id = output_channel / ${at};
int wOutChannel = output_channel - group_id * ${at};
float value = ${$};
for (int inChannelOffset = 0; inChannelOffset < ${lt}; inChannelOffset++) {
int input_channel = group_id * ${lt} + inChannelOffset;
for (int wWOff = 0; wWOff < ${nt[2]}; wWOff++) {
for (int wHOff = 0; wHOff < ${nt[3]}; wHOff++) {
ivec2 wOff = ivec2(wWOff * ${a.dilations[0]}, wHOff * ${a.dilations[1]});
ivec2 wLoc = loc - wOff;
ivec2 wLocIn = wLoc / strides;
if (
wLocIn * strides == wLoc &&
wLocIn.x >= 0 && wLocIn.x < ${c[2]} &&
wLocIn.y >= 0 && wLocIn.y < ${c[3]}
) {
float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);
float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);
value += xVal * wVal;
}
}
}
}
${ct}
${it.output} = vec4(value, .0, .0, .0);
}
`;return{...s,output:{dims:et,type:o[0].type,textureType:0},shaderSource:ft,hasMain:!0}},Qm=(e,o,s)=>{let a=Ym(o.length>2,s.cacheKey);return{...a,get:()=>Zm(e,o,a,s)}},tb=(e,o,s)=>e.run(Qm(e,o,s),o),eb=(e,o)=>{let s=e.kernelShape.slice();if(e.kernelShape.length===0)for(let at=2;at<o[1].dims.length;++at)s.push(o[1].dims[at]);let a=e.pads.slice(),$=e.outputShape.slice(),c=o[0].dims;Km(c,s,e.dilations,e.autoPad,a,e.strides,e.outputPadding,$);let nt=Object.assign({},e);return Object.assign(nt,{kernelShape:s,pads:a,outputShape:$,cacheKey:e.cacheKey}),nt},Tf=e=>{let o=e.attributes,s=pr(o),a=o.getString("auto_pad","NOTSET"),$=o.getInts("dilations",[1,1]),c=o.getInt("group",1),nt=o.getInts("kernel_shape",[]),at=o.getInts("output_padding",[0,0]),lt=o.getInts("output_shape",[]),et=o.getInts("pads",[0,0,0,0]),it=o.getInts("strides",[1,1]);return W({autoPad:a,dilations:$,group:c,kernelShape:nt,outputPadding:at,outputShape:lt,pads:et,strides:it,...s})},rb=(e,o)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length!==4||e[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");let s=e[0].dims[1],a=e[1].dims[0];if(s!==a)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");let $=e[1].dims[1]*o.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==$))throw new Error("invalid bias");let c=e[0].dims.length-2;if(o.dilations.length!==c)throw new Error(`dilations should be ${c}D`);if(o.strides.length!==c)throw new Error(`strides should be ${c}D`);if(o.pads.length!==c*2)throw new Error(`pads should be ${c*2}D`);if(o.outputPadding.length!==c)throw new Error(`output_padding should be ${c}D`);if(o.kernelShape.length!==0&&o.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(o.outputShape.length!==0&&o.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape");if(e[0].type!=="float32"||e[1].type!=="float32")throw new Error("ConvTranspose input(X,W) should be float tensor");if(e.length===3&&e[2].type!=="float32")throw new Error("ConvTranspose input(bias) should be float tensor")}}),vf,je,If,nb,_f,ob,ib,ab,Nn=O(()=>{It(),Y(),j(),vf={name:"Transpose",inputNames:["A"],inputTypes:[0]},je=(e,o,s)=>(ab(o),[e.run({...vf,cacheHint:s.cacheKey,get:()=>nb(e,o[0],s.perm)},o)]),If=e=>W({perm:e.attributes.getInts("perm",[])}),nb=(e,o,s)=>{let a=o.dims;s=_f(a,s);let $=ob(a,s),c=a.length,nt=`
${ib("perm",s,c)}
float process(int indices[${c}]) {
int a[${c}];
perm(a, indices);
return _A(a);
}`;return{...vf,output:{dims:$,type:o.type,textureType:0},shaderSource:nt}},_f=(e,o)=>(o&&o.length!==e.length&&(o=[...e.keys()].reverse()),o),ob=(e,o)=>(o=_f(e,o),B.sortBasedOnPerm(e,o)),ib=(e,o,s)=>{let a=[];a.push(`void ${e}(out int a[${s}], int src[${s}]) {`);for(let $=0;$<s;++$)a.push(` a[${o[$]}]=src[${$}];`);return a.push(" }"),a.join(`
`)},ab=e=>{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("input should be float tensor")}}),Of,Sf,sb,Af=O(()=>{Nn(),Of=(e,o,s)=>{sb(o);let a=s.blocksize,$=a*a,c=s.mode==="DCR"?[0,3,4,1,5,2]:[0,1,4,2,5,3],nt=s.mode==="DCR"?[o[0].dims[0],a,a,o[0].dims[1]/$,o[0].dims[2],o[0].dims[3]]:[o[0].dims[0],o[0].dims[1]/$,a,a,o[0].dims[2],o[0].dims[3]],at=e.reshapeUnpacked(o[0],nt),lt={perm:c,cacheKey:`${c}`},[et]=je(e,[at],lt),it=[o[0].dims[0],o[0].dims[1]/$,o[0].dims[2]*a,o[0].dims[3]*a];return[e.reshapeUnpacked(et,it)]},Sf=e=>{let o=e.attributes.getInt("blocksize");if(o<1)throw new Error(`blocksize must be >= 1, but got : ${o} for DepthToSpace`);let s=e.attributes.getString("mode","DCR");if(s!=="DCR"&&s!=="CRD")throw new Error(`unrecognized mode: ${s} for DepthToSpace`);return{mode:s,blocksize:o}},sb=e=>{if(e.length!==1)throw new Error(`DepthToSpace expect 1 inputs, but got ${e.length}`);if(e[0].type==="string"||e[0].dims.length!==4)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}}),Pf,Ef,ub,Df=O(()=>{Y(),Pf=(e,o,s)=>{ub(o,s);let a=B.flattenShape(o[0].dims,s);return[e.reshapeUnpacked(o[0],a)]},Ef=e=>e.attributes.getInt("axis",1),ub=(e,o)=>{if(!e||e.length!==1)throw new Error("Flatten requires 1 input.");let s=e[0].dims.length;if(s===0)throw new Error("scalar tensor is not supported.");if(o<-s||o>s)throw new Error("Invalid axis");if(e[0].type==="string")throw new Error("string tensor is not supported.")}}),Pe,Rr=O(()=>{Pe=["float32","float64","int32","int16","int8","uint16","uint32","uint8"]}),Lf,$f,lb,fb,cb$1,pb,kf=O(()=>{It(),Rr(),Y(),j(),Lf=(e,o,s)=>(pb(o,s.axis),[e.run(cb$1(e,o,s),o)]),$f=e=>W({axis:e.attributes.getInt("axis",0)}),lb={name:"Gather",inputNames:["A","B"],inputTypes:[0,0]},fb=(e,o,s,a)=>{let $=s[0].dims.slice(),c=s[1].dims.slice(),nt=new Array($.length+c.length-1);a=B.normalizeAxis(a,$.length);let at=[];for(let ct=0;ct<nt.length;ct++)ct<a?(nt[ct]=$[ct],at.push(`inputIdx[${ct}] = outputIdx[${ct}];`)):ct<a+c.length?(nt[ct]=c[ct-a],at.push(`indexDataIdx[${ct-a}] = outputIdx[${ct}];`)):(nt[ct]=$[ct-c.length+1],at.push(`inputIdx[${ct-c.length+1}] = outputIdx[${ct}];`));let lt=nt.length||1,et=$.length,it=c.length||1,st=`
float process(int outputIdx[${lt}]) {
int inputIdx[${et}];
int indexDataIdx[${it}];
indexDataIdx[0] = 0;
${at.join(`
`)}
int idx = int(_B(indexDataIdx));
inputIdx[${a}] = idx < 0 ? idx + ${$[a]} : idx;
return _A(inputIdx);
}`;return{...o,output:{dims:nt,type:s[0].type,textureType:0},shaderSource:st}},cb$1=(e,o,s)=>{let a={...lb,cacheHint:s.cacheKey};return{...a,get:()=>fb(e,a,o,s.axis)}},pb=(e,o)=>{if(!e||e.length!==2)throw new Error("Gather requires 2 inputs.");let s=e[0].dims.length;if(s<1)throw new Error("Invalid input shape.");if(o<-s||o>s-1)throw new Error("Invalid axis.");if(Pe.indexOf(e[0].type)===-1)throw new Error("Invaid input type.");if(e[1].type!=="int32"&&e[1].type!=="int16")throw new Error("Invaid input type.")}}),Ai,Bf,Ff,Cf,db,hb,mb,Nf=O(()=>{It(),Y(),j(),Ai=(e,o,s)=>(mb(o,s),[e.run(db(o,s),o)]),Bf=(e,o)=>{let s=e.attributes.getInt("transA",0)!==0,a=e.attributes.getInt("transB",0)!==0,$=e.attributes.getFloat("alpha",1),c=e.attributes.getFloat("beta",1);return W({transA:s,transB:a,alpha:$,beta:c,isOptionalC:o})},Ff=e=>Bf(e,!1),Cf=e=>Bf(e,!0),db=(e,o)=>{let s={name:"Gemm",inputNames:e.length===3?["A","B","C"]:["A","B"],inputTypes:e.length===3?[0,0,0]:[0,0],key:o.cacheKey};return{...s,get:()=>hb(s,e,o)}},hb=(e,o,s)=>{let a=o[0].dims.slice(),$=o[1].dims.slice(),[c,nt]=Sn.getShapeOfGemmResult(a,s.transA,$,s.transB,o.length===3?o[2].dims:void 0),at=[c,nt];if(!at)throw new Error("Can't use gemm on the given tensors");let lt=a[a.length-1],et="";s.transA&&(lt=a[0]),s.transA&&s.transB?et="value += _A_T(a) * _B_T(b);":s.transA&&!s.transB?et="value += _A_T(a) * _B(b);":!s.transA&&s.transB?et="value += _A(a) * _B_T(b);":!s.transA&&!s.transB&&(et="value += _A(a) * _B(b);");let it=at.length,st=o.length===3?`int c[${o[2].dims.length}];`:"",ct=o.length===3?"bcastIndices_C(indices, c);":"",ft=o.length===3?"value += beta * _C(c);":"",pt=`
float process(int indices[${it}]) {
int a[${it}];
int b[${it}];
${st}
copyVec(indices, a);
copyVec(indices, b);
${ct}
float value = 0.0;
for (int k=0; k<${lt}; ++k) {
a[${it-1}] = k;
b[${it-2}] = k;
${et}
}
value = value * alpha;
${ft}
return value;
}`;return{...e,output:{dims:at,type:o[0].type,textureType:0},variables:[{name:"alpha",type:"float",data:s.alpha},{name:"beta",type:"float",data:s.beta}],shaderSource:pt}},mb=(e,o)=>{if(!e)throw new Error("Input is missing");if(o.isOptionalC&&(e.length<2||e.length>3))throw new Error("Invaid input shape.");if(!o.isOptionalC&&e.length!==3)throw new Error("Gemm requires 3 inputs");if(e.length===3&&e[2].dims.length!==1&&e[2].dims.length!==2)throw new Error("Invalid input shape of C");if(e[0].type!=="float32"&&e[0].type!=="float64"||e[1].type!=="float32"&&e[1].type!=="float64"||e.length===3&&e[2].type!=="float32"&&e[2].type!=="float64")throw new Error("Invalid input type.");if(e[0].type!==e[1].type||e.length===3&&e[0].type!==e[2].type)throw new Error("Input types are mismatched")}}),Rf,Gf,bb,gb,yb,xb,Tb,Mf=O(()=>{It(),j(),Rf=(e,o,s)=>(Tb(o),[e.run(yb(e,o,s),o)]),Gf=e=>{let o=e.attributes.getFloat("scale"),s=e.attributes.getFloats("bias");return W({scale:o,bias:s})},bb={name:"ImageScaler",inputNames:["X"],inputTypes:[0]},gb=(e,o,s,a)=>{let $=s[0].dims.slice(),c=$.length,nt=`
${xb(a.bias.length)}
float process(int indices[${c}]) {
return _X(indices) * scale + getBias(bias, indices[1]);
}`;return{...o,output:{dims:$,type:s[0].type,textureType:0},variables:[{name:"bias",type:"float",arrayLength:a.bias.length,data:a.bias},{name:"scale",type:"float",data:a.scale}],shaderSource:nt}},yb=(e,o,s)=>{let a={...bb,cacheHint:s.cacheKey};return{...a,get:()=>gb(e,a,o,s)}},xb=e=>{let o=[`float getBias(float bias[${e}], int channel) {`];for(let s=0;s<e;++s)s===0?o.push(` if (channel == ${s}) { return bias[${s}]; }`):s===e-1?o.push(` else { return bias[${s}]; }`):o.push(` else if (channel == ${s}) { return bias[${s}]; }`);return o.push(" }"),o.join(`
`)},Tb=e=>{if(!e||e.length!==1)throw new Error("ImageScaler requires 1 input.");if(e[0].dims.length!==4)throw new Error("Invalid input shape.");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("Invalid input type.")}}),Vf,zf,Uf,wb,vb,Ib,_b,Ob,Sb,Wf=O(()=>{ut(),j(),Vf=(e,o,s)=>{Sb(o);let a=e.run(vb(o[0]),o);return[e.run(Ob(e,o[0],s,a.dims),[o[0],a,o[1],o[2]])]},zf=e=>e.attributes.getFloat("epsilon",1e-5),Uf={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[0]},wb=(e,o)=>{let s=o.dims.slice(),a=s[1],$=s[2]*s[3],c=[s[0],a],nt=`
vec4 process(int[2] indices) {
vec4 v = vec4(0.0);
int a[4];
a[0] = indices[0];
a[1] = indices[1];
float temp = 0.0;
for(int a2=0; a2<${s[2]}; a2++) {
a[2] = a2;
for(int a3=0; a3<${s[3]}; a3++) {
a[3] = a3;
float x = _X(a);
temp += x;
}
}
float mean = temp / float(${$});
temp = 0.0;
for(int a2=0; a2<${s[2]}; a2++) {
a[2] = a2;
for(int a3=0; a3<${s[3]}; a3++) {
a[3] = a3;
float x = _X(a);
temp += (x - mean) * (x - mean);
}
}
v.r = mean;
v.g = temp / float(${$});
return v;
}`;return{...e,output:{dims:c,type:o.type,textureType:4},shaderSource:nt}},vb=e=>({...Uf,get:()=>wb(Uf,e)}),Ib={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[0,4,0,0]},_b=(e,o,s,a,$)=>{let c=G(e.session.backend.glContext.version),[nt,at]=e.calculateTextureWidthAndHeight($,4),[lt,et]=[nt/4,at],it=`
vec4 get_MeanAndVariance(int[2] mv) {
int offset = indicesToOffset_MeanAndVariance(mv);
vec2 coords = offsetToCoords(offset, ${lt}, ${et});
return ${c.texture2D}(MeanAndVariance, coords);
}
float process(int[4] indices) {
int mv[2];
mv[0] = indices[0];
mv[1] = indices[1];
vec4 mean_and_variance = get_MeanAndVariance(mv);
float mean = mean_and_variance.r;
float variance = mean_and_variance.g;
int sb[1];
sb[0] = indices[1];
float scale = _Scale(sb);
float b = _B(sb);
return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;
}`;return{...o,output:{dims:s.dims,type:s.type,textureType:0},variables:[{name:"epsilon",type:"float",data:a}],shaderSource:it}},Ob=(e,o,s,a)=>{let $={...Ib,cacheHint:`${s}`};return{...$,get:()=>_b(e,$,o,s,a)}},Sb=e=>{if(!e||e.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");let o=e[0],s=e[1],a=e[2];if(o.dims.length<3||s.dims.length!==1||a.dims.length!==1)throw new Error("Invalid input shape.");if(s.dims[0]!==o.dims[1]||a.dims[0]!==o.dims[1])throw new Error("Input shapes are mismatched.");if(o.type!=="float32"&&o.type!=="float64"||s.type!=="float32"&&s.type!=="float64"||a.type!=="float32"&&a.type!=="float64")throw new Error("Invalid input type.");if(e[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}});function Ab(e,o){let s=e[0].dims[1],a=e[0].dims.length,$=-Math.floor((o.size-1)/2),c=Math.ceil((o.size-1)/2),nt=`float(${o.alpha}) / float(${o.size})`,at=`float(${o.bias})`,lt=`float(${o.beta})`,et=`
float process(int indices[${a}]) {
int c = indices[1];
float x = _X(indices);
float square_sum = 0.0;
for (int i = ${$}; i <= ${c}; i++) {
int idx = c + i;
if (c >= 0 && c < ${s}) {
indices[1] = idx;
float j = _X(indices);
square_sum += j * j;
}
}
return x / pow(${at} + ${nt} * square_sum, ${lt});
}`;return{...jf,cacheHint:o.cacheKey,output:{dims:e[0].dims,type:e[0].type,textureType:0},shaderSource:et}}function Pb(e,o){return{...jf,cacheHint:o.cacheKey,get:()=>Ab(e,o)}}var Hf,qf,jf,Eb,Xf=O(()=>{It(),j(),Hf=(e,o,s)=>(Eb(o),[e.run(Pb(o,s),o)]),qf=e=>{let o=e.attributes.getFloat("alpha",1e-4),s=e.attributes.getFloat("beta",.75),a=e.attributes.getFloat("bias",1),$=e.attributes.getInt("size");return W({alpha:o,beta:s,bias:a,size:$})},jf={name:"LRN",inputNames:["X"],inputTypes:[0]},Eb=e=>{if(!e||e.length!==1)throw new Error("LRN requires 1 input.");if(e[0].dims.length!==4)throw new Error('currently only support LRN for input with "NCHW" format');if(e[0].type!=="float32")throw new Error("input should be float type")}}),Db,Pi,Kf,Jf,Yf,Lb,$b,kb,Bb,Fb,Cb,Nb,Rb,Zf=O(()=>{It(),Y(),ut(),j(),Db={name:"Pad",inputNames:["A"],inputTypes:[0]},Pi=(e,o,s)=>(kb(o),[e.run({...Db,cacheHint:s.cacheKey,get:()=>$b(e,o[0],s)},o)]),Kf=e=>{let o=e.attributes.getString("mode","constant"),s=e.attributes.getFloat("value",0),a=e.attributes.getInts("pads");return W({mode:o,value:s,pads:a})},Jf=(e,o,s)=>{Bb(o);let a=Lb(e,o,s);return Pi(e,[o[0]],a)},Yf=e=>e.attributes.getString("mode","constant"),Lb=(e,o,s)=>{if(!e.session.isInitializer(o[1].dataId)||o.length>=3&&!e.session.isInitializer(o[2].dataId))throw new Error("dynamic pad attributes are not allowed");let a=Array.from(o[1].integerData),$=o.length>=3?o[2].floatData[0]:0;return W({mode:s,pads:a,value:$})},$b=(e,o,s)=>{let a=B.padShape(o.dims.slice(),s.pads),$=a.length,c=`
${Fb(e,o,s)}
float process(int[${$}] indices) {
return padA(indices);
}`;return{name:"Pad",inputNames:["A"],inputTypes:[0],output:{dims:a,type:o.type,textureType:0},shaderSource:c}},kb=e=>{if(!e||e.length!==1)throw new Error("Pad requires 1 input");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("Invalid input type.")},Bb=e=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Pad requires 2 or 3 inputs");if(e[1].type!=="int32")throw new Error("Invalid input type.");if(e.length>=3&&e[2].type==="string")throw new Error("Invalid input type.")},Fb=(e,o,s)=>{let a=G(e.session.backend.glContext.version),[$,c]=e.calculateTextureWidthAndHeight(o.dims,0),nt=B.computeStrides(o.dims);switch(s.mode){case"constant":return Cb(a,o.dims,nt,$,c,s.pads,s.value);case"reflect":return Nb(a,o.dims,nt,$,c,s.pads);case"edge":return Rb(a,o.dims,nt,$,c,s.pads);default:throw new Error("Invalid mode")}},Cb=(e,o,s,a,$,c,nt)=>{let at=o.length,lt="";for(let et=at-1;et>=0;--et)lt+=`
k = m[${et}] - ${c[et]};
if (k < 0) return constant;
if (k >= ${o[et]}) return constant;
offset += k * ${s[et]};
`;return`
float padA(int m[${at}]) {
const float constant = float(${nt});
int offset = 0;
int k = 0;
${lt}
vec2 coords = offsetToCoords(offset, ${a}, ${$});
float value = getColorAsFloat(${e.texture2D}(A, coords));
return value;
}
`},Nb=(e,o,s,a,$,c)=>{let nt=o.length,at="";for(let lt=nt-1;lt>=0;--lt)at+=`
k = m[${lt}] - ${c[lt]};
if (k < 0) { k = -k; }
{
const int _2n_1 = ${2*(o[lt]-1)};
k = int( mod( float(k), float(_2n_1) ) ) ;
if(k >= ${o[lt]}) { k = _2n_1 - k; }
}
offset += k * ${s[lt]};
`;return`
float padA(int m[${nt}]) {
int offset = 0;
int k = 0;
${at}
vec2 coords = offsetToCoords(offset, ${a}, ${$});
float value = getColorAsFloat(${e.texture2D}(A, coords));
return value;
}
`},Rb=(e,o,s,a,$,c)=>{let nt=o.length,at="";for(let lt=nt-1;lt>=0;--lt)at+=`
k = m[${lt}] - ${c[lt]};
if (k < 0) k = 0;
if (k >= ${o[lt]}) k = ${o[lt]-1};
offset += k * ${s[lt]};
`;return`
float padA(int m[${nt}]) {
int offset = 0;
int k = 0;
${at}
vec2 coords = offsetToCoords(offset, ${a}, ${$});
float value = getColorAsFloat(${e.texture2D}(A, coords));
return value;
}
`}}),tc,ec,rc,nc,oc,ic,ac,sc,uc,Gb,Qf,lc,Gn,fc,Rn,Mb,cc=O(()=>{It(),Y(),j(),tc=(e,o,s)=>{Gn(o);let a={name:"AveragePool",inputNames:["X"],inputTypes:[0],cacheHint:s.cacheKey};return[e.run({...a,get:()=>rc(o,a,!1,s)},o)]},ec=e=>{let o=e.attributes.getString("auto_pad","NOTSET"),s=e.attributes.getInt("ceil_mode",0),a=e.attributes.getInt("count_include_pad",0)!==0,$=e.attributes.getInts("kernel_shape"),c=e.attributes.getInts("strides",[]),nt=e.attributes.getInts("pads",[]);if(s!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return W({autoPad:o,ceilMode:s,countIncludePad:a,kernelShape:$,strides:c,pads:nt})},rc=(e,o,s,a)=>{let[$,c]=uc(e,a,s),nt=B.size($.kernelShape),at="value += _X(x);",lt="";$.countIncludePad?lt+=`value /= float(${nt});`:lt+=`value /= float(${nt} - pad);`;let et=`
${fc(e[0].dims,$,at,lt,"0.0")}
`;return{...o,output:{dims:c,type:e[0].type,textureType:0},shaderSource:et}},nc=(e,o,s)=>{Gn(o);let a={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[0],cacheHint:`${s.countIncludePad}`};return[e.run({...a,get:()=>rc(o,a,!0,s)},o)]},oc=e=>{let o=e.attributes.getInt("count_include_pad",0)!==0;return W({autoPad:"",ceilMode:0,countIncludePad:o,kernelShape:[],strides:[],pads:[]})},ic=(e,o,s)=>{Gn(o);let a={name:"MaxPool",inputNames:["X"],inputTypes:[0],cacheHint:s.cacheKey};return[e.run({...a,get:()=>sc(o,a,!1,s)},o)]},ac=e=>{let o=e.attributes.getString("auto_pad","NOTSET"),s=e.attributes.getInt("ceil_mode",0),a=e.attributes.getInts("kernel_shape"),$=e.attributes.getInts("strides",[]),c=e.attributes.getInts("pads",[]),nt=e.attributes.getInt("storage_order",0),at=e.attributes.getInts("dilations",[]);if(nt!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(s!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return W({autoPad:o,ceilMode:s,countIncludePad:!1,kernelShape:a,strides:$,pads:c,storageOrder:nt,dilations:at})},sc=(e,o,s,a)=>{let[$,c]=uc(e,a,s),nt=`
value = max(_X(x), value);
`,at="",lt=`
${fc(e[0].dims,$,nt,at,"-1e5")}
`;return{...o,output:{dims:c,type:e[0].type,textureType:0},shaderSource:lt}},uc=(e,o,s)=>{let a=e[0].dims.slice(),$=Object.hasOwnProperty.call(o,"dilations"),c=o.kernelShape.slice(),nt=o.strides.slice(),at=$?o.dilations.slice():[],lt=o.pads.slice();Ue.adjustPoolAttributes(s,a,c,nt,at,lt);let et=Ue.computePoolOutputShape(s,a,nt,at,c,lt,o.autoPad),it=Object.assign({},o);return $?Object.assign(it,{kernelShape:c,strides:nt,pads:lt,dilations:at,cacheKey:o.cacheKey}):Object.assign(it,{kernelShape:c,strides:nt,pads:lt,cacheKey:o.cacheKey}),[it,et]},Gb={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},Qf={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[0]},lc=(e,o)=>(Gn(o),[e.run({...Qf,get:()=>sc(o,Qf,!0,Gb)},o)]),Gn=e=>{if(!e||e.length!==1)throw new Error("Pool ops requires 1 input.");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("Invalid input type.")},fc=(e,o,s,a,$)=>{let c=e.length;if(o.kernelShape.length<=2){let nt=o.kernelShape[o.kernelShape.length-1],at=o.strides[o.strides.length-1],lt=o.pads[o.pads.length/2-1],et=o.pads[o.pads.length-1],it=e[c-1],st="",ct="",ft="";if(lt+et!==0?st=`
for (int i = 0; i < ${nt}; i++) {
x[${c} - 1] = indices[${c} - 1] * ${at} - ${lt} + i;
if (x[${c} - 1] < 0 || x[${c} - 1] >= ${it}) {
pad++;
continue;
}
${s}
}`:st=`
for (int i = 0; i < ${nt}; i++) {
x[${c} - 1] = indices[${c} - 1] * ${at} - ${lt} + i;
${s}
}`,o.kernelShape.length===2){let pt=o.kernelShape[o.kernelShape.length-2],gt=o.strides[o.strides.length-2],wt=o.pads[o.pads.length/2-2],vt=o.pads[o.pads.length-2],_t=e[c-2];wt+vt!==0?ct=`
for (int j = 0; j < ${pt}; j++) {
x[${c} - 2] = indices[${c} - 2] * ${gt} - ${wt} + j;
if (x[${c} - 2] < 0 || x[${c} - 2] >= ${_t}) {
pad+= ${nt};
continue;
}
`:ct=`
for (int j = 0; j < ${pt}; j++) {
x[${c} - 2] = indices[${c} - 2] * ${gt} - ${wt} + j;
`,ft=`
}
`}return`
float process(int indices[${c}]) {
int x[${c}];
copyVec(indices, x);
float value = ${$};
int pad = 0;
${ct}
${st}
${ft}
${a}
return value;
}
`}else{let nt=B.size(o.kernelShape),at=B.computeStrides(o.kernelShape),lt=at.length,et=o.pads.length,it=Mb(lt),st=Rn(e,"inputDims"),ct=Rn(o.pads,"pads"),ft=Rn(at,"kernelStrides"),pt=Rn(o.strides,"strides"),gt=o.pads.reduce((vt,_t)=>vt+_t),wt="";return gt?wt=`
if (x[j] >= inputDims[j] || x[j] < 0) {
pad++;
isPad = true;
break;
}
}
if (!isPad) {
${s}
}`:wt=`
}
${s}
`,`
${it}
float process(int indices[${c}]) {
int x[${c}];
copyVec(indices, x);
int offset[${lt}];
int pads[${et}];
int inputDims[${c}];
int kernelStrides[${lt}];
int strides[${lt}];
${ct}
${st}
${pt}
${ft}
float value = ${$};
int pad = 0;
bool isPad = false;
for (int i = 0; i < ${nt}; i++) {
offsetToIndices(i, kernelStrides, offset);
isPad = false;
for (int j = ${c} - ${lt}; j < ${c}; j++) {
x[j] = indices[j] * strides[j - ${c} + ${lt}]
+ offset[j - ${c} + ${lt}] - pads[j - 2];
${wt}
}
${a}
return value;
}
`}},Rn=(e,o)=>{let s="";for(let a=0;a<e.length;a++)s+=`
${o}[${a}] = ${e[a]};
`;return s},Mb=e=>`
void offsetToIndices(int offset, int[${e}] strides, out int[${e}] indices) {
if (${e} == 0) {
return;
}
for (int i = 0; i < ${e} - 1; ++i) {
indices[i] = offset / strides[i];
offset -= indices[i] * strides[i];
}
indices[${e} - 1] = offset;
}`}),Xe,Ee,Ub,Vb,pc,dc,hc,mc,bc,gc,yc,xc=O(()=>{It(),Rr(),Y(),j(),Xe=(e,o,s,a,$)=>{Vb(o);let c={name:a,inputNames:["A"],inputTypes:[0]};return[e.run({...c,cacheHint:s.cacheKey,get:()=>Ub(e,o,s,a,$,c)},o)]},Ee=e=>{let o=e.attributes.getInts("axes",[]),s=e.attributes.getInt("keepdims",1)===1;return W({axes:o,keepDims:s})},Ub=(e,o,s,a,$,c)=>{let nt=[],at=o[0].dims.length||1,lt=[],et=B.normalizeAxes(s.axes,o[0].dims.length),it=$(o,et),st=it[1];for(let ft=0;ft<o[0].dims.length;ft++)et.indexOf(ft)>=0||et.length===0?(s.keepDims&&nt.push(1),st=`
for(int j${ft} = 0; j${ft} < ${o[0].dims[ft]}; j${ft}++) {
inputIdx[${ft}] = j${ft};
${st}
}`):(lt.push(`inputIdx[${ft}] = outputIdx[${nt.length}];`),nt.push(o[0].dims[ft]));let ct=`
float process(int outputIdx[${nt.length||1}]) {
float value; // final result
int inputIdx[${at}]; // addressing input data
${lt.join(`
`)}
${it[0]} // init ops for reduce max/min
${st}
${it[2]} // final computation for reduce mean
return value;
}`;return{...c,output:{dims:nt,type:o[0].type,textureType:0},shaderSource:ct}},Vb=e=>{if(!e||e.length!==1)throw new Error("Reduce op requires 1 input.");if(Pe.indexOf(e[0].type)===-1)throw new Error("Invalid input type.")},pc=(e,o,s)=>Xe(e,o,s,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),dc=(e,o,s)=>Xe(e,o,s,"ReduceMean",(a,$)=>{let c=1;for(let nt=0;nt<a[0].dims.length;nt++)($.indexOf(nt)>=0||$.length===0)&&(c*=a[0].dims[nt]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${c}.;`]}),hc=(e,o,s)=>Xe(e,o,s,"ReduceMax",(a,$)=>{let c=[];for(let nt=0;nt<a[0].dims.length;nt++)($.indexOf(nt)>=0||$.length===0)&&c.push(`inputIdx[${nt}] = 0;`);return[`${c.join(`
`)}
value = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),mc=(e,o,s)=>Xe(e,o,s,"ReduceMin",(a,$)=>{let c=[];for(let nt=0;nt<a[0].dims.length;nt++)($.indexOf(nt)>=0||$.length===0)&&c.push(`inputIdx[${nt}] = 0;`);return[`${c.join(`
`)}
value = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),bc=(e,o,s)=>Xe(e,o,s,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),gc=(e,o,s)=>Xe(e,o,s,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),yc=(e,o,s)=>Xe(e,o,s,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])}),Tc,wc=O(()=>{Y(),Tc=(e,o)=>{let s=B.calculateReshapedDims(o[0].dims,o[1].integerData);return e.session.pack?[e.reshapePacked(o[0],s)]:[e.reshapeUnpacked(o[0],s)]}}),vc,Ei,Ic,_c,Gr,zb,Di,Mn,Li=O(()=>{It(),ut(),j(),vc={name:"Upsample",inputNames:["X"],inputTypes:[0]},Ei=(e,o,s)=>(Di(o,s),[e.run({...vc,cacheHint:s.cacheKey,get:()=>zb(e,o,s)},o)]),Ic=e=>Gr(e,7),_c=e=>Gr(e,9),Gr=(e,o)=>{let s=o>=10,a=e.attributes.getString("mode","nearest");if(a!=="nearest"&&a!=="linear"&&(o<11||a!=="cubic"))throw new Error(`unrecognized mode: ${a}`);let $=[];o<9&&($=e.attributes.getFloats("scales"),Mn($,a,s));let c=e.attributes.getFloat("extrapolation_value",0),nt=o>10?e.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(nt)===-1)throw new Error(`coordinate_transform_mode '${nt}' is not supported`);let at=nt==="tf_crop_and_resize",lt=at,et=a==="nearest"&&o>=11?e.attributes.getString("nearest_mode","round_prefer_floor"):"";if(["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(et)===-1)throw new Error(`nearest_mode '${et}' is not supported`);let it=e.attributes.getFloat("cubic_coeff_a",-.75),st=e.attributes.getInt("exclude_outside",0)!==0;if(st&&a!=="cubic")throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");let ct=o<11?!0:a==="nearest"&&nt==="asymmetric"&&et==="floor",ft=0,pt=0,gt=0;return o>10?e.inputs.length>2?(ft=1,pt=2,gt=3):(pt=1,gt=2):o===9&&(pt=1),W({opset:o,isResize:s,mode:a,scales:$,extrapolationValue:c,coordinateTransformMode:nt,useExtrapolation:lt,needRoiInput:at,nearestMode:et,cubicCoefficientA:it,excludeOutside:st,useNearest2xOptimization:ct,roiInputIdx:ft,scalesInputIdx:pt,sizesInputIdx:gt})},zb=(e,o,s)=>{let a=G(e.session.backend.glContext.version),[$,c]=e.calculateTextureWidthAndHeight(o[0].dims,0),nt=o[0].dims.map((gt,wt)=>Math.floor(gt*s.scales[wt])),[at,lt]=e.calculateTextureWidthAndHeight(nt,0),et=nt.length,it=new Array(et),st=new Array(et),ct=`
int output_pitches[${et}];
int input_pitches[${et}];
`;for(let gt=et-1;gt>=0;gt--)it[gt]=gt===et-1?1:it[gt+1]*nt[gt+1],st[gt]=gt===et-1?1:st[gt+1]*o[0].dims[gt+1],ct+=`
output_pitches[${gt}] = ${it[gt]};
input_pitches[${gt}] = ${st[gt]};
`;let ft=`
float getInputFloat(int index) {
vec2 coords = offsetToCoords(index, ${$}, ${c});
float value = getColorAsFloat(${a.texture2D}(X, coords));
return value;
}
`,pt=s.mode==="nearest"?`
${ft}
float process(int indices[${et}]) {
int input_index = 0;
int output_index = coordsToOffset(TexCoords, ${at}, ${lt});
${ct}
int d, m;
for (int dim = 0; dim < ${et}; ++dim) {
d = output_index / output_pitches[dim];
m = output_index - d * output_pitches[dim];
output_index = m;
if (scales[dim] != 1 && d > 0) {
int d2 = d / scales[dim];
m = d - d2 * scales[dim];
d = d2;
}
input_index += input_pitches[dim] * d;
}
return getInputFloat(input_index);
}`:et===4?`
${ft}
float process(int indices[4]) {
int input_index = 0;
int output_index = coordsToOffset(TexCoords, ${at}, ${lt});
${ct}
int m;
int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;
index_of_dim0 = output_index / output_pitches[0];
m = output_index - index_of_dim0 * output_pitches[0];
index_of_dim1 = m / output_pitches[1];
m = m - index_of_dim1 * output_pitches[1];
index_of_dim2 = m / output_pitches[2];
m = m - index_of_dim2 * output_pitches[2];
index_of_dim3 = m;
int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;
index_of_input_dim2 = index_of_dim2 / scales[2];
y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];
index_of_input_dim3 = index_of_dim3 / scales[3];
x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];
input_index = index_of_dim0 * input_pitches[0] +
index_of_dim1 * input_pitches[1] +
index_of_input_dim2 * input_pitches[2] +
index_of_input_dim3;
float x00 = getInputFloat(input_index);
float x10, x01, x11;
bool end_of_dim2 = false;
if (index_of_input_dim2 == (${o[0].dims[2]} - 1)) {
// It's the end in dimension 2
x01 = x00;
end_of_dim2 = true;
} else {
x01 = getInputFloat(input_index + input_pitches[2]);
}
if (index_of_input_dim3 == (input_pitches[2] - 1)) {
// It's the end in dimension 3
x10 = x00;
x11 = x01;
}
else {
x10 = getInputFloat(input_index + 1);
x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);
}
float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);
float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);
return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);
}`:`
${ft}
float process(int indices[2]) {
int input_index = 0;
int output_index = coordsToOffset(TexCoords, ${at}, ${lt});
${ct}
int m;
int index_of_dim0, index_of_dim1;
index_of_dim0 = output_index / output_pitches[0];
m = output_index - index_of_dim0 * output_pitches[0];
index_of_dim1 = m;
int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;
index_of_input_dim0 = index_of_dim0 / scales[0];
y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];
index_of_input_dim1 = index_of_dim1 / scales[1];
x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];
input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;
float x00 = getInputFloat(input_index);
float x10, x01, x11;
bool end_of_dim0 = false;
if (index_of_input_dim0 == (${o[0].dims[0]} - 1)) {
// It's the end in dimension 0
x01 = x00;
end_of_dim0 = true;
} else {
x01 = getInputFloat(input_index + input_pitches[0]);
}
if (index_of_input_dim1 == (input_pitches[0] - 1)) {
// It's the end in dimension 1
x10 = x00;
x11 = x01;
}
else {
x10 = getInputFloat(input_index + 1);
x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);
}
float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);
float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);
return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);
}`;return{...vc,output:{dims:nt,type:o[0].type,textureType:0},shaderSource:pt,variables:[{name:"scales",type:"int",arrayLength:s.scales.length,data:s.scales.map(gt=>Math.ceil(gt))}]}},Di=(e,o)=>{if(!e||o.opset<9&&e.length!==1||o.opset>=9&&o.opset<11&&e.length!==2||o.opset>=11&&e.length<2)throw new Error("invalid inputs.");if(o.scales.length>0&&e[0].dims.length!==o.scales.length)throw new Error("Invalid input shape.");if(e[0].type==="string")throw new Error("Invalid input tensor types.")},Mn=(e,o,s)=>{if(s){for(let a of e)if(a<=0)throw new Error("Scale value should be greater than 0.")}else for(let a of e)if(a<1)throw new Error("Scale value should be greater than or equal to 1.");if((o==="linear"||o==="cubic")&&e.length!==2&&(e.length!==4||e[0]!==1||e[1]!==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 ${s?"Resize":"Upsample"} opeartor.`)}}),$i,ki,Oc,Sc,Wb,Hb,qb,jb,Ac=O(()=>{ut(),j(),pe(),He(),Li(),$i={name:"Resize",inputNames:["A"],inputTypes:[2]},ki=(e,o,s)=>(Di(o,s),[e.run({...$i,cacheHint:s.cacheKey,get:()=>Wb(e,o,s)},o)]),Oc=e=>Gr(e,10),Sc=e=>Gr(e,11),Wb=(e,o,s)=>{let a=G(e.session.backend.glContext.version),[$,c]=Hb(o,s);if($.every(_t=>_t===1)&&s.coordinateTransformMode!=="tf_crop_and_resize")return{...$i,output:{dims:c,type:o[0].type,textureType:2},hasMain:!0,shaderSource:`void main() {
vec4 v = ${a.texture2D}(X, TexCoords);
${a.output} = v;
}`};let nt=c.length;if(nt<2)throw new Error(`output dimension should be at least 2, but got ${nt}`);let at=c[nt-2],lt=c[nt-1],et=o[0].dims;if(nt!==et.length)throw new Error(`output dimension should match input ${et.length}, but got ${nt}`);let it=et[nt-2],st=et[nt-1],ct=$[nt-2],ft=$[nt-1],pt="";if(s.mode!=="linear")throw new Error(`resize (packed) does not support mode: '${s.mode}'`);switch(s.coordinateTransformMode){case"asymmetric":pt=`
vec4 getSourceFracIndex(ivec4 coords) {
return vec4(coords) / scaleWHWH;
}
`;break;case"half_pixel":pt=`
vec4 getSourceFracIndex(ivec4 coords) {
return (vec4(coords) + 0.5) / scaleWHWH - 0.5;
}
`;break;case"pytorch_half_pixel":pt=`
vec4 getSourceFracIndex(ivec4 coords) {
vec4 fcoords = vec4(coords);
return vec4(
${lt}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,
${at}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,
${lt}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,
${at}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0
);
}
`;break;case"align_corners":pt=`
vec4 getSourceFracIndex(ivec4 coords) {
vec4 resized = vec4(${lt}.0 - 1.0, ${at}.0 - 1.0, ${lt}.0 - 1.0,
${at}.0 - 1.0);
vec4 original = vec4(${st}.0 - 1.0, ${it}.0 - 1.0, ${st}.0 - 1.0,
${it}.0 - 1.0);
vec4 new_scale = original / resized;
return vec4(coords) * new_scale;
}
`;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${s.coordinateTransformMode}'`)}let gt=Bt(nt),wt=de(),vt=`
const vec2 inputWH = vec2(${it}.0, ${st}.0);
const vec4 scaleWHWH = vec4(float(${ct}), float(${ft}), float(${ct}), float(${ft}));
${wt}
${pt}
float getAValue(int x10, int r, int c, int d) {
return getChannel(getA(x10, r, c, d), vec2(c, d));
}
void main() {
${gt} rc = getOutputCoords();
int batch = rc[0];
int depth = rc[1];
// retrieve the 4 coordinates that is used in the 4 packed output values.
ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);
// calculate the source index in fraction
vec4 sourceFrac = getSourceFracIndex(coords);
// get the lower and upper bound of the 4 values that will be packed into one texel.
ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));
ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));
ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));
ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));
bool hasNextRow = rc.w < ${at-1};
bool hasNextCol = rc.z < ${lt-1};
// pack x00, x01, x10, x11's top-left corner into one vec4 structure
vec4 topLeft = vec4(
getAValue(batch, depth, x00.x, x00.y),
hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,
hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,
(hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);
// pack x00, x01, x10, x11's top-right corner into one vec4 structure
vec4 topRight = vec4(
getAValue(batch, depth, x00.x, x00.w),
hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,
hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,
(hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);
// pack x00, x01, x10, x11's bottom-left corner into one vec4 structure
vec4 bottomLeft = vec4(
getAValue(batch, depth, x00.z, x00.y),
hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,
hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,
(hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);
// pack x00, x01, x10, x11's bottom-right corner into one vec4 structure
vec4 bottomRight = vec4(
getAValue(batch, depth, x00.z, x00.w),
hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,
hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,
(hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);
// calculate the interpolation fraction on u and v direction
vec4 frac = vec4(sourceFrac) - floor(sourceFrac);
vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));
vec4 top = mix(topLeft, topRight, clampFrac.ywyw);
vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);
vec4 newValue = mix(top, bottom, clampFrac.xxzz);
${a.output} = vec4(newValue);
}
`;return{...$i,output:{dims:c,type:o[0].type,textureType:2},hasMain:!0,shaderSource:vt}},Hb=(e,o)=>{let s=e[0].dims,a=o.scales,$;if(a.length===0){let nt=e[o.scalesInputIdx];if(nt&&nt.size!==0){if(e[o.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");a=qb(nt,o.mode,o.isResize)}else{let at=e[o.sizesInputIdx];if(!at||at.size===0)throw new Error("Either scales or sizes MUST be provided as input.");$=Array.from(at.integerData),a=jb($,s,o.mode,o.isResize)}}else if(e[o.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");let c=$||s.map((nt,at)=>Math.floor(nt*a[at]));return[a,c]},qb=(e,o,s)=>{let a=Array.from(e.floatData);return Mn(a,o,s),a},jb=(e,o,s,a)=>{let $=o.length,c=new Array($);for(let nt=0,at=$;nt<at;nt++)if(o[nt]===0){if(e[nt]!==0)throw new Error("Input dim is zero but required output dim is non-zero.");c[nt]=1}else c[nt]=e[nt]/o[nt];return Mn(c,s,a),c}}),Pc,Xb,Ec=O(()=>{We(),Pc=(e,o)=>(Xb(o),[new bt([o[0].dims.length],"int32",void 0,void 0,new Int32Array(o[0].dims))]),Xb=e=>{if(!e||e.length!==1)throw new Error("Shape requires 1 input.")}}),Bi,Dc,Lc,$c,Kb,kc,Jb,Yb,Bc=O(()=>{It(),Rr(),Y(),j(),Bi={name:"Slice",inputNames:["A"],inputTypes:[0]},Dc=(e,o,s)=>(Kb(o),[e.run({...Bi,cacheHint:s.cacheKey,get:()=>$c(e,o[0],s)},o)]),Lc=e=>{let o=e.attributes.getInts("starts"),s=e.attributes.getInts("ends"),a=e.attributes.getInts("axes",[]);return W({starts:o,ends:s,axes:a})},$c=(e,o,s)=>{let a=s.axes.length===0?o.dims.slice(0).map((it,st)=>st):s.axes,$=B.normalizeAxes(a,o.dims.length),c=s.starts.map((it,st)=>it>o.dims[$[st]]-1?o.dims[$[st]]:B.normalizeAxis(it,o.dims[$[st]])),nt=s.ends.map((it,st)=>it>o.dims[$[st]]-1?o.dims[$[st]]:B.normalizeAxis(it,o.dims[$[st]])),at=o.dims.slice(),lt=[];for(let it=0;it<$.length;it++)at[$[it]]=nt[it]-c[it],c[it]>0&&lt.push(`outputIdx[${$[it]}] += ${c[it]};`);let et=`
float process(int outputIdx[${at.length}]) {
${lt.join(`
`)}
return _A(outputIdx);
}`;return{...Bi,output:{dims:at,type:o.type,textureType:0},shaderSource:et}},Kb=e=>{if(!e||e.length!==1)throw new Error("Slice requires 1 input.");if(Pe.indexOf(e[0].type)===-1)throw new Error("Invalid input type.")},kc=(e,o)=>{Yb(o);let s=Jb(e,o);return[e.run({...Bi,cacheHint:s.cacheKey,get:()=>$c(e,o[0],s)},[o[0]])]},Jb=(e,o)=>{if(!e.session.isInitializer(o[1].dataId)||!e.session.isInitializer(o[2].dataId)||o.length>=4&&!e.session.isInitializer(o[3].dataId)||o.length>=5&&!e.session.isInitializer(o[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(o.length>=5&&o[4].integerData.some(nt=>nt!==1))throw new Error("currently non-1 steps is not supported for Slice");let s=Array.from(o[1].integerData),a=Array.from(o[2].integerData),$=o.length>=4?Array.from(o[3].integerData):[],c=`${$};${s};${a}`;return{starts:s,ends:a,axes:$,cacheKey:c}},Yb=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if(e[1].type!=="int32"||e[1].dims.length!==1)throw new Error("Invalid input type.");if(e[2].type!=="int32"||e[2].dims.length!==1)throw new Error("Invalid input type.");if(e.length>=4&&(e[3].type!=="int32"||e[3].dims.length!==1))throw new Error("Invalid input type.");if(e.length>=5&&(e[4].type!=="int32"||e[4].dims.length!==1))throw new Error("Invalid input type.")}}),Fc,Cc,Nc,Rc,Gc,Mc,Uc,Vc,Zb,Qb,tg,zc,Wc=O(()=>{It(),Y(),ut(),j(),Nn(),Fc={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[0]},Cc={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[0,0]},Nc={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[0,0,0]},Rc=(e,o,s)=>{zc(o);let a=o[0].dims.slice(),$=B.normalizeAxis(s.axis,a.length),c=B.sizeToDimension(a,$),nt=B.sizeFromDimension(a,$);return Vc(e,o,s,c,nt)},Gc=e=>W({axis:e.attributes.getInt("axis",1)}),Mc=e=>W({axis:e.attributes.getInt("axis",-1)}),Uc=(e,o,s)=>{zc(o);let a=o[0].dims.slice(),$=B.normalizeAxis(s.axis,a.length),c=a.length,nt=$!==c-1,at=[],lt=[],et=[],it;nt&&(lt=Array.from({length:c}).map((pt,gt)=>gt),lt[$]=c-1,lt[c-1]=$,lt.map(pt=>at.push(a[pt])),it=W({perm:lt}),et=je(e,o,it));let st=nt?B.sizeToDimension(at,c-1):B.sizeToDimension(a,c-1),ct=nt?B.sizeFromDimension(at,c-1):B.sizeFromDimension(a,c-1),ft=Vc(e,nt?et:o,s,st,ct);return nt?je(e,ft,it):ft},Vc=(e,o,s,a,$)=>{let c=Zb(e,o[0],a,$,[a]),nt=e.run({...Fc,cacheHint:s.cacheKey,get:()=>c},o),at=Qb(e,o[0],a,$,c.output.dims,[a]),lt=e.run({...Cc,cacheHint:s.cacheKey,get:()=>at},[o[0],nt]),et=tg(e,o[0],a,$,c.output.dims,at.output.dims);return[e.run({...Nc,cacheHint:s.cacheKey,get:()=>et},[o[0],nt,lt])]},Zb=(e,o,s,a,$)=>{let[c,nt]=e.calculateTextureWidthAndHeight(o.dims,0),at=$.length;if(s<1||a<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if($.length!==1)throw new Error("Dimensionality of the output should be 1");if($[0]!==s)throw new Error("Shape of the output should be equal to logical row count");let lt=G(e.session.backend.glContext.version),et=`
float process(int[${at}] indices) {
int logical_row_start_offset = indices[0] * ${a};
float max = getColorAsFloat(${lt.texture2D}(A, offsetToCoords(logical_row_start_offset, ${c},
${nt} )));
for(int i=1; i<${a}; ++i)
{
float current = getColorAsFloat(${lt.texture2D}(A, offsetToCoords(logical_row_start_offset + i,
${c}, ${nt})));
if(current > max)
max = current;
}
return max;
}`;return{...Fc,output:{dims:$,type:o.type,textureType:0},shaderSource:et}},Qb=(e,o,s,a,$,c)=>{let[nt,at]=e.calculateTextureWidthAndHeight(o.dims,0),lt=c.length;if(s<1||a<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(c.length!==1)throw new Error("Dimensionality of the output should be 1");if(c[0]!==s)throw new Error("Shape of the output should be equal to logical row count");if($.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if($[0]!==s)throw new Error("Shape of the intermediate results should be equal to logical row count");let et=G(e.session.backend.glContext.version),it=`
float process(int[${lt}] indices) {
int logical_row_start_offset = indices[0] * ${a};
float norm_factor = 0.0;
float max = _Max(indices);
for(int i=0; i<${a}; ++i)
{
norm_factor += exp(getColorAsFloat(${et.texture2D}(A, offsetToCoords(logical_row_start_offset + i,
${nt}, ${at}))) - max);
}
return norm_factor;
}`;return{...Cc,output:{dims:c,type:o.type,textureType:0},shaderSource:it}},tg=(e,o,s,a,$,c)=>{let[nt,at]=e.calculateTextureWidthAndHeight(o.dims,0),lt=o.dims.length;if(s<1||a<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if($.length!==1||c.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if($[0]!==s||c[0]!==s)throw new Error("Shape of the intermediate results should be equal to logical row count");let et=`
float process(int[${lt}] indices) {
// get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)
int offset = coordsToOffset(TexCoords, ${nt}, ${at});
//determine the logical row for this index
int logical_row_index[1];
logical_row_index[0] = offset / ${a};
float norm_factor = _Norm(logical_row_index);
// avoid possible division by 0
// if norm_facor is 0, all elements are zero
// if so, return 0
if(norm_factor == 0.0)
return 0.0;
return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;
}`;return{...Nc,output:{dims:o.dims,type:o.type,textureType:0},shaderSource:et}},zc=e=>{if(!e||e.length!==1)throw new Error("Softmax requires 1 input.");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("Invalid input type")}}),Hc,qc,jc,eg,rg,ng,Xc=O(()=>{It(),Y(),j(),Hc={name:"Split",inputNames:["A"],inputTypes:[0]},qc=(e,o,s)=>{ng(o);let a=B.normalizeAxis(s.axis,o[0].dims.length),$=eg(e,o,a,s),c=[];for(let nt=0;nt<$;++nt)c.push(e.run({...Hc,cacheHint:`${s.cacheKey};${nt}`,get:()=>rg(e,o[0],s,a,nt)},o));return c},jc=e=>{let o=e.attributes.getInt("axis",0),s=e.attributes.getInts("split",[]),a=e.outputs.length;return W({axis:o,split:s,numOutputs:a})},eg=(e,o,s,a)=>{let[,$]=$r.splitShape(o[0].dims,s,a.split,a.numOutputs);return $.length},rg=(e,o,s,a,$)=>{let[c,nt]=$r.splitShape(o.dims,a,s.split,s.numOutputs),at=nt[$],lt=c[$],et=`
float process(int indices[${lt.length}]) {
indices[${a}] += ${at};
return _A(indices);
}
`;return{...Hc,cacheHint:`${s.cacheKey}:${$}`,output:{dims:lt,type:o.type,textureType:0},shaderSource:et}},ng=e=>{if(!e||e.length!==1)throw new Error("Split requires one input.");if(e[0].type!=="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")throw new Error("Invalid input type.")}}),Fi,Kc,Jc,og,ig,Yc=O(()=>{Y(),Fi=(e,o,s)=>{og(o);let a=B.squeezeShape(o[0].dims,s);return[e.reshapeUnpacked(o[0],a)]},Kc=(e,o)=>(ig(o),Fi(e,[o[0]],Array.from(o[1].integerData))),Jc=e=>e.attributes.getInts("axes"),og=e=>{if(!e||e.length!==1)throw new Error("Squeeze requires 1 input.");if(e[0].type==="string")throw new Error("invalid input tensor types.")},ig=e=>{if(!e||e.length!==2)throw new Error("Squeeze requires 2 inputs.");if(e[1].type!=="int32")throw new Error("Invalid input type.")}}),Zc,ag,sg,Qc=O(()=>{ut(),j(),Zc=(e,o)=>{sg(o);let s={name:"Sum",inputNames:o.map((a,$)=>`X${$}`),inputTypes:new Array(o.length).fill(0)};return[e.run({...s,get:()=>ag(e,o,s)},o)]},ag=(e,o,s)=>{let a=G(e.session.backend.glContext.version),$=o[0].dims.slice(),c=`
void main() {
vec4 result = ${o.map((nt,at)=>`${a.texture2D}(X${at},TexCoords)`).join(" + ")};
${a.output} = result;
}
`;return{...s,output:{dims:$,type:o[0].type,textureType:0},hasMain:!0,shaderSource:c}},sg=e=>{if(!e||e.length===0)throw new Error("Sum requires inputs.");let o=e[0].dims.length;for(let s=1;s<e.length;s++){if(o!==e[s].dims.length)throw new Error("Input shapes are mismatched.");for(let a=0;a<o;a++)if(e[0].dims[a]!==e[s].dims[a])throw new Error("Input shapes are not matched.")}if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("Invalid input type.");for(let s=1;s<e.length;s++)if(e[0].type!==e[s].type)throw new Error("Input types are not matched.")}}),tp,ug,lg,ep=O(()=>{Rr(),j(),tp=(e,o)=>{lg(o);let s={name:"Tile",inputNames:["A"],inputTypes:[0]};return[e.run({...s,get:()=>ug(e,o,s)},o)]},ug=(e,o,s)=>{let a=o[0].dims.slice(),$=new Array(a.length),c=[];for(let lt=0;lt<a.length;lt++)$[lt]=a[lt]*o[1].numberData[lt],c.push(`inputIdx[${lt}] = int(mod(float(outputIdx[${lt}]), ${a[lt]}.));`);let nt=$.length,at=`
float process(int outputIdx[${nt}]) {
int inputIdx[${nt}];
${c.join(`
`)}
return _A(inputIdx);
}
`;return{...s,output:{dims:$,type:o[0].type,textureType:0},shaderSource:at}},lg=e=>{if(!e||e.length!==2)throw new Error("Tile requires 2 input.");if(e[1].dims.length!==1)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(Pe.indexOf(e[0].type)===-1)throw new Error("Invalid input type.");if(e[1].type!=="int32"&&e[1].type!=="int16")throw new Error("Invalid repeat type.")}}),Ci,rp,np,fg,cg,op=O(()=>{Y(),Ci=(e,o,s)=>{fg(o);let a=B.unsqueezeShape(o[0].dims,s);return[e.reshapeUnpacked(o[0],a)]},rp=(e,o)=>(cg(o),Ci(e,[o[0]],Array.from(o[1].integerData))),np=e=>e.attributes.getInts("axes"),fg=e=>{if(!e||e.length!==1)throw new Error("Unsqueeze requires 1 input.");if(e[0].type==="string")throw new Error("invalid input tensor types.")},cg=e=>{if(!e||e.length!==2)throw new Error("Unsqueeze requires 2 inputs.");if(e[1].type!=="int32")throw new Error("Invalid input type.")}}),ip,ap=O(()=>{ml(),Pl(),Ll(),Nl(),Bn(),wf(),Af(),Df(),kf(),Nf(),Mf(),Wf(),Xf(),Fn(),Zf(),cc(),xc(),wc(),Ac(),Ec(),Bc(),Wc(),Xc(),Yc(),Qc(),ep(),Nn(),xi(),op(),Li(),ip=[["Abs","","6+",Rl],["Acos","","7+",Gl],["Add","","7+",bl],["And","","7+",gl],["Asin","","7+",Ml],["Atan","","7+",Ul],["AveragePool","","7+",tc,ec],["BatchNormalization","","7+",dl,hl],["Cast","","6+",El,Dl],["Ceil","","6+",Wl],["Clip","","6-10",gi,Vl],["Clip","","11+",zl],["Concat","","4+",Bl,Cl],["Conv","","1+",Oi,Si],["ConvTranspose","","1+",xf,Tf],["Cos","","7+",Hl],["Div","","7+",yl],["Dropout","","7+",yi],["DepthToSpace","","1+",Of,Sf],["Equal","","7+",xl],["Elu","","6+",ql,jl],["Exp","","6+",Xl],["Flatten","","1+",Pf,Ef],["Floor","","6+",Kl],["FusedConv","com.microsoft","1+",Oi,Si],["Gather","","1+",Lf,$f],["Gemm","","7-10",Ai,Ff],["Gemm","","11+",Ai,Cf],["GlobalAveragePool","","1+",nc,oc],["GlobalMaxPool","","1+",lc],["Greater","","7+",Tl],["Identity","","1+",yi],["ImageScaler","","1+",Rf,Gf],["InstanceNormalization","","6+",Vf,zf],["LeakyRelu","","6+",Jl,Yl],["Less","","7+",wl],["LRN","","1+",Hf,qf],["Log","","6+",Zl],["MatMul","","1+",pf,df],["MaxPool","","1+",ic,ac],["Mul","","7+",vl],["Neg","","6+",Ql],["Not","","1+",tf],["Or","","7+",Il],["Pad","","2-10",Pi,Kf],["Pad","","11+",Jf,Yf],["Pow","","7+",_l],["PRelu","","7+",Ol],["ReduceLogSum","","1+",gc,Ee],["ReduceMax","","1+",hc,Ee],["ReduceMean","","1+",dc,Ee],["ReduceMin","","1+",mc,Ee],["ReduceProd","","1+",bc,Ee],["ReduceSum","","1-12",pc,Ee],["ReduceSumSquare","","1+",yc,Ee],["Relu","","6+",ef],["Reshape","","5+",Tc],["Resize","","10",ki,Oc],["Resize","","11+",ki,Sc],["Shape","","1+",Pc],["Sigmoid","","6+",rf],["Sin","","7+",nf],["Slice","","10+",kc],["Slice","","1-9",Dc,Lc],["Softmax","","1-12",Rc,Gc],["Softmax","","13+",Uc,Mc],["Split","","2-12",qc,jc],["Sqrt","","6+",of],["Squeeze","","1-12",Fi,Jc],["Squeeze","","13+",Kc],["Sub","","7+",Sl],["Sum","","6+",Zc],["Tan","","7+",af],["Tanh","","6+",sf],["Tile","","6+",tp],["Transpose","","1+",je,If],["Upsample","","7-8",Ei,Ic],["Upsample","","9",Ei,_c],["Unsqueeze","","1-12",Ci,np],["Unsqueeze","","13+",rp],["Xor","","7+",Al]]});function up(e){let o={},s;for(;(s=sp.exec(e))!==null;){let a=s[3].split(",").map($=>{let c=$.trim().split(" ");return c&&c.length===2?{type:c[0],name:c[1]}:null}).filter($=>$!==null);o[s[2]]={params:a,body:s[4]}}for(let a in o){let $=pg.replace("__FUNC__",a),c=new RegExp($,"gm");for(;(s=c.exec(e))!==null;){let nt=s[1],at=s[2],lt=s[3].split(","),et=nt?`${nt} ${at};`:"",it=o[a].body,st="";o[a].params.forEach((ft,pt)=>{ft&&(st+=`${ft.type} ${ft.name} = ${lt[pt]};
`)}),it=`${st}
${it}`,it=it.replace("return",`${at} = `);let ct=`
${et}
{
${it}
}
`;e=e.replace(s[0],ct)}}return e=e.replace(sp,""),e}var sp,pg,lp=O(()=>{sp=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm,pg="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;"});function hr(e,o){let s=[],a=[];for(let $=0;$<e.length;++$)e[$]!==1&&(s.push(e[$]),a.push($));return{newShape:s,keptDims:a}}function mg(e){if(e.length===0)return 1;let o=e[0];for(let s=1;s<e.length;s++)o*=e[s];return o}function fp(e){let o=Math.ceil(Math.sqrt(e));return[o,Math.ceil(e/o)]}var Un,Ni=O(()=>{Ut(),Y(),Un=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,o){let s=this.computeTexture(e,o);return o&&o.isPacked&&(s[0]/=2,s[1]/=2),o&&o.reverseWH?[s[1],s[0]]:s}computeTexture(e,o){let s=o&&o.isPacked;if(e.length===0)return s?[2,2]:[1,1];let a=this.maxTextureSize;if(o&&o.breakAxis!==void 0){let nt=o.breakAxis>=e.length?1:e.slice(o.breakAxis).reduce((lt,et)=>lt*et),at=o.breakAxis<=0?1:e.slice(0,o.breakAxis).reduce((lt,et)=>lt*et);if(nt>a||at>a)tt.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${o.breakAxis}`);else return[nt,at]}let $=e.slice(0);s&&(a=a*2,$=$.map((nt,at)=>at>=$.length-2?$[at]%2===0?$[at]:$[at]+1:$[at]),$.length===1&&($=[2,$[0]])),$.length!==2&&($=hr($).newShape);let c=mg($);return $.length<=1&&c<=a?[1,c]:$.length===2&&$[0]<=a&&$[1]<=a?$:$.length===3&&$[0]*$[1]<=a&&$[2]<=a?[$[0]*$[1],$[2]]:$.length===3&&$[0]<=a&&$[1]*$[2]<=a?[$[0],$[1]*$[2]]:$.length===4&&$[0]*$[1]*$[2]<=a&&$[3]<=a?[$[0]*$[1]*$[2],$[3]]:$.length===4&&$[0]<=a&&$[1]*$[2]*$[3]<=a?[$[0],$[1]*$[2]*$[3]]:s?fp(c/4).map(nt=>nt*2):fp(c)}}}),Vn,cp=O(()=>{Y(),Te(),ut(),Ni(),pe(),Vn=class extends Ht{constructor(e){super(e)}getFunctions(){return{...this.offsetToCoords(),...this.coordsToOffset(),...this.toVec(),...this.valueFrom(),...this.getCommonUtilFuncs(),...this.getInputsSamplingSnippets(),...this.getOutputSamplingSnippet()}}getCustomTypes(){return{}}offsetToCoords(){let e="offsetToCoords";return{offsetToCoords:new k(`
vec2 ${e}(int offset, int width, int height) {
int t = offset / width;
int s = offset - t*width;
vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);
return coords;
}
`)}}coordsToOffset(){let e="coordsToOffset";return{coordsToOffset:new k(`
int ${e}(vec2 coords, int width, int height) {
float s = coords.s * float(width);
float t = coords.t * float(height);
int offset = int(t) * width + int(s);
return offset;
}
`)}}getOutputSamplingSnippet(){let e=this.context.outputTextureLayout;return e.isPacked?this.getPackedOutputSamplingSnippet(e):this.getUnpackedOutputSamplingSnippet(e)}getPackedOutputSamplingSnippet(e){let o=e.unpackedShape,s=[e.width,e.height],a={},$="getOutputCoords";switch(o.length){case 0:a[$]=this.getOutputScalarCoords();break;case 1:a[$]=this.getOutputPacked1DCoords(o,s);break;case 2:a[$]=this.getOutputPacked2DCoords(o,s);break;case 3:a[$]=this.getOutputPacked3DCoords(o,s);break;default:a[$]=this.getOutputPackedNDCoords(o,s)}let c=`
void setOutput(vec4 val) {
${G(this.context.glContext.version).output} = val;
}
`,nt="floatTextureSetRGBA";return a[nt]=new k(c),a}getUnpackedOutputSamplingSnippet(e){let o=e.unpackedShape,s=[e.width,e.height],a={},$="getOutputCoords";switch(o.length){case 0:a[$]=this.getOutputScalarCoords();break;case 1:a[$]=this.getOutputUnpacked1DCoords(o,s);break;case 2:a[$]=this.getOutputUnpacked2DCoords(o,s);break;case 3:a[$]=this.getOutputUnpacked3DCoords(o,s);break;case 4:a[$]=this.getOutputUnpacked4DCoords(o,s);break;case 5:a[$]=this.getOutputUnpacked5DCoords(o,s);break;case 6:a[$]=this.getOutputUnpacked6DCoords(o,s);break;default:throw new Error(`Unsupported output dimensionality: ${o.length}`)}let c=`
void setOutput(float val) {
${G(this.context.glContext.version).output} = vec4(val, 0, 0, 0);
}
`,nt="floatTextureSetR";return a[nt]=new k(c),a}getOutputScalarCoords(){return new k(`
int getOutputCoords() {
return 0;
}
`)}getOutputPacked1DCoords(e,o){let s=o,a="";return s[0]===1?(a=`
int getOutputCoords() {
return 2 * int(TexCoords.y * ${s[1]}.0);
}
`,new k(a)):s[1]===1?(a=`
int getOutputCoords() {
return 2 * int(TexCoords.x * ${s[0]}.0);
}
`,new k(a)):(a=`
int getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${s[0]}, ${s[1]}));
return 2 * (resTexRC.y * ${s[0]} + resTexRC.x);
}
`,new k(a))}getOutputPacked2DCoords(e,o){let s="";if(Me.arraysEqual(e,o))return s=`
ivec2 getOutputCoords() {
return 2 * ivec2(TexCoords.xy * vec2(${o[0]}, ${o[1]}));
}
`,new k(s);let a=o,$=Math.ceil(e[1]/2);return s=`
ivec2 getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${a[0]}, ${a[1]}));
int index = resTexRC.y * ${a[0]} + resTexRC.x;
// reverse r and c order for packed texture
int r = imod(index, ${$}) * 2;
int c = 2 * (index / ${$});
return ivec2(r, c);
}
`,new k(s)}getOutputPacked3DCoords(e,o){let s=[o[0],o[1]],a=Math.ceil(e[2]/2),$=a*Math.ceil(e[1]/2),c=`
ivec3 getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${s[0]}, ${s[1]}));
int index = resTexRC.y * ${s[0]} + resTexRC.x;
int b = index / ${$};
index -= b * ${$};
// reverse r and c order for packed texture
int r = imod(index, ${a}) * 2;
int c = 2 * (index / ${a});
return ivec3(b, r, c);
}
`;return new k(c)}getOutputPackedNDCoords(e,o){let s=[o[0],o[1]],a=Math.ceil(e[e.length-1]/2),$=a*Math.ceil(e[e.length-2]/2),c=$,nt="",at="b, r, c";for(let et=2;et<e.length-1;et++)c*=e[e.length-et-1],nt=`
int b${et} = index / ${c};
index -= b${et} * ${c};
`+nt,at=`b${et}, `+at;let lt=`
ivec${e.length} getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${s[0]}, ${s[1]}));
int index = resTexRC.y * ${s[0]} + resTexRC.x;
${nt}
int b = index / ${$};
index -= b * ${$};
// reverse r and c order for packed texture
int r = imod(index, ${a}) * 2;
int c = 2 * (index / ${a});
return ivec${e.length}(${at});
}
`;return new k(lt)}getOutputUnpacked1DCoords(e,o){let s=`
int getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${o[0]}, ${o[1]}));
return resTexRC.y * ${o[0]} + resTexRC.x;
}
`;return new k(s)}getOutputUnpacked2DCoords(e,o){let s=`
ivec2 getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${o[0]}, ${o[1]}));
int index = resTexRC.y * ${o[0]} + resTexRC.x;
int r = index / ${e[1]};
int c = index - r * ${e[1]};
return ivec2(r, c);
}
`;return new k(s)}getOutputUnpacked3DCoords(e,o){let s="",a=e.length,$=null;a<2&&($=[]),$=new Array(a-1),$[a-2]=e[a-1];for(let at=a-3;at>=0;--at)$[at]=$[at+1]*e[at+1];let c=["r","c","d"],nt=$.map((at,lt)=>{let et=`int ${c[lt]} = index / ${at}`,it=lt===$.length-1?`int ${c[lt+1]} = index - ${c[lt]} * ${at}`:`index -= ${c[lt]} * ${at}`;return`${et}; ${it};`}).join("");return s=`
ivec3 getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${o[0]}, ${o[1]}));
int index = resTexRC.y * ${o[0]} + resTexRC.x;
${nt}
return ivec3(r, c, d);
}
`,new k(s)}getOutputUnpacked4DCoords(e,o){let s="",a=e.length,$=null;a<2&&($=[]),$=new Array(a-1),$[a-2]=e[a-1];for(let at=a-3;at>=0;--at)$[at]=$[at+1]*e[at+1];let c=["r","c","d","d2"],nt=$.map((at,lt)=>{let et=`int ${c[lt]} = index / ${at}`,it=lt===$.length-1?`int ${c[lt+1]} = index - ${c[lt]} * ${at}`:`index -= ${c[lt]} * ${at}`;return`${et}; ${it};`}).join("");return s=`
ivec4 getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${o[0]}, ${o[1]}));
int index = resTexRC.y * ${o[0]} + resTexRC.x;
${nt}
return ivec4(r, c, d, d2);
}
`,new k(s)}getOutputUnpacked5DCoords(e,o){let s="",a=e.length,$=null;a<2&&($=[]),$=new Array(a-1),$[a-2]=e[a-1];for(let at=a-3;at>=0;--at)$[at]=$[at+1]*e[at+1];let c=["r","c","d","d2","d3"],nt=$.map((at,lt)=>{let et=`int ${c[lt]} = index / ${at}`,it=lt===$.length-1?`int ${c[lt+1]} = index - ${c[lt]} * ${at}`:`index -= ${c[lt]} * ${at}`;return`${et}; ${it};`}).join("");return s=`
ivec5 getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${o[0]}, ${o[1]}));
int index = resTexRC.y * ${o[0]} + resTexRC.x;
${nt}
return ivec5(r, c, d, d2, d3);
}
`,new k(s)}getOutputUnpacked6DCoords(e,o){let s="",a=e.length,$=null;a<2&&($=[]),$=new Array(a-1),$[a-2]=e[a-1];for(let at=a-3;at>=0;--at)$[at]=$[at+1]*e[at+1];let c=["r","c","d","d2","d3","d4"],nt=$.map((at,lt)=>{let et=`int ${c[lt]} = index / ${at}`,it=lt===$.length-1?`int ${c[lt+1]} = index - ${c[lt]} * ${at}`:`index -= ${c[lt]} * ${at}`;return`${et}; ${it};`}).join("");return s=`
ivec6 getOutputCoords() {
ivec2 resTexRC = ivec2(TexCoords.xy *
vec2(${o[0]}, ${o[1]}));
int index = resTexRC.y * ${o[0]} + resTexRC.x;
${nt}
return ivec6(r, c, d, d2, d3, d4);
}
`,new k(s)}getCommonUtilFuncs(){let e={},o="uvFromFlat";e[o]=new k(`
vec2 uvFromFlat(int texNumR, int texNumC, int index) {
int texC = index / texNumR;
int texR = index - texC * texNumR;
// TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to
// v.
return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);
}
`),o="packedUVfrom1D",e[o]=new k(`
vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {
int texelIndex = index / 2;
int texR = texelIndex / texNumC;
int texC = texelIndex - texR * texNumC;
return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);
}
`),o="packedUVfrom2D",e[o]=new k(`
vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {
int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);
int texR = texelIndex / texNumC;
int texC = texelIndex - texR * texNumC;
return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);
}
`),o="packedUVfrom3D",e[o]=new k(`
vec2 packedUVfrom3D(int texNumR, int texNumC,
int texelsInBatch, int texelsInLogicalRow, int b,
int row, int col) {
int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);
int texR = index / texNumC;
int texC = index - texR * texNumC;
return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);
}
`),o="sampleTexture";let s=G(this.context.glContext.version);return e[o]=new k(`
float sampleTexture(sampler2D textureSampler, vec2 uv) {
return ${s.texture2D}(textureSampler, uv).r;
}`),e}getInputsSamplingSnippets(){let e={},o=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((s,a)=>{let $=this.context.inputTextureLayouts[a],c=An(s);$.isPacked?e[c]=this.getPackedSamplerFromInput(c,s,$):e[c]=this.getUnpackedSamplerFromInput(c,s,$);let nt=Yu(s);$.unpackedShape.length<=o.unpackedShape.length&&($.isPacked?e[nt]=this.getPackedSamplerAtOutputCoords(nt,$,o,s):e[nt]=this.getUnpackedSamplerAtOutputCoords(nt,$,o,s))}),e}getPackedSamplerAtOutputCoords(e,o,s,a){let $=o.unpackedShape,c=s.unpackedShape,nt=An(a),at=$.length,lt=c.length,et=kt.getBroadcastDims($,c),it=Bt(lt),st=lt-at,ct,ft=ne();at===0?ct="":lt<2&&et.length>=1?ct="coords = 0;":ct=et.map(Pt=>`coords.${ft[Pt+st]} = 0;`).join(`
`);let pt="";lt<2&&at>0?pt="coords":pt=$.map((Pt,Nt)=>`coords.${ft[Nt+st]}`).join(", ");let gt="return outputValue;",wt=B.size($)===1,vt=B.size(c)===1;if(at===1&&!wt&&!vt)gt=`
return vec4(outputValue.xy, outputValue.xy);
`;else if(wt&&!vt)lt===1?gt=`
return vec4(outputValue.x, outputValue.x, 0., 0.);
`:gt=`
return vec4(outputValue.x);
`;else if(et.length){let Pt=at-2,Nt=at-1;et.indexOf(Pt)>-1&&et.indexOf(Nt)>-1?gt="return vec4(outputValue.x);":et.indexOf(Pt)>-1?gt="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":et.indexOf(Nt)>-1&&(gt="return vec4(outputValue.xx, outputValue.zz);")}let _t=`
int lastDim = coords.${ft[lt-1]};
coords.${ft[lt-1]} = coords.${ft[lt-2]};
coords.${ft[lt-2]} = lastDim;
`,$t=`
vec4 ${e}() {
${it} coords = getOutputCoords();
${_t}
${ct}
vec4 outputValue = ${nt}(${pt});
${gt}
}
`;return new k($t,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(e,o,s,a){let $=[s.width,s.height],c=[o.width,o.height],nt=o.unpackedShape.length,at=s.unpackedShape.length,lt=o.unpackedShape,et=s.unpackedShape,it=An(a);if(nt===at&&Me.arraysEqual(c,$)){let _t=`
float ${e}() {
return sampleTexture(${a}, TexCoords);
}
`;return new k(_t,["coordinates.sampleTexture"])}let st=Bt(at),ct=kt.getBroadcastDims(lt,et),ft=at-nt,pt,gt=ne();nt===0?pt="":at<2&&ct.length>=1?pt="coords = 0;":pt=ct.map(_t=>`coords.${gt[_t+ft]} = 0;`).join(`
`);let wt="";at<2&&nt>0?wt="coords":wt=o.unpackedShape.map((_t,$t)=>`coords.${gt[$t+ft]}`).join(", ");let vt=`
float ${e}() {
${st} coords = getOutputCoords();
${pt}
return ${it}(${wt});
}
`;return new k(vt,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(e,o,s){switch(s.unpackedShape.length){case 0:return this.getPackedSamplerScalar(e,o);case 1:return this.getPackedSampler1D(e,o,s);case 2:return this.getPackedSampler2D(e,o,s);case 3:return this.getPackedSampler3D(e,o,s);default:return this.getPackedSamplerND(e,o,s)}}getUnpackedSamplerFromInput(e,o,s){let a=s.unpackedShape;switch(a.length){case 0:return this.getUnpackedSamplerScalar(e,o,s);case 1:return this.getUnpackedSampler1D(e,o,s);case 2:return this.getUnpackedSampler2D(e,o,s);case 3:return this.getUnpackedSampler3D(e,o,s);case 4:return this.getUnpackedSampler4D(e,o,s);case 5:return this.getUnpackedSampler5D(e,o,s);case 6:return this.getUnpackedSampler6D(e,o,s);default:throw new Error(`Unsupported dimension ${a.length}-D`)}}getPackedSamplerScalar(e,o){let s=G(this.context.glContext.version),a=`
vec4 ${e}() {
return ${s.texture2D}(${o}, halfCR);
}
`;return new k(a)}getPackedSampler1D(e,o,s){let a=[s.width,s.height],$=[a[1],a[0]],c=G(this.context.glContext.version),nt=`vec4 ${e}(int index) {
vec2 uv = packedUVfrom1D(
${$[0]}, ${$[1]}, index);
return ${c.texture2D}(${o}, uv);
}`;return new k(nt,["coordinates.packedUVfrom1D"])}getPackedSampler2D(e,o,s){let a=s.unpackedShape,$=[s.width,s.height],c=G(this.context.glContext.version),nt=$[0],at=$[1];if($!=null&&Me.arraysEqual(a,$)){let st=`vec4 ${e}(int row, int col) {
vec2 uv = (vec2(col, row) + halfCR) / vec2(${at}.0, ${nt}.0);
return ${c.texture2D}(${o}, uv);
}`;return new k(st)}let lt=$,et=Math.ceil(a[1]/2),it=`vec4 ${e}(int row, int col) {
vec2 uv = packedUVfrom2D(${lt[1]}, ${lt[0]}, ${et}, row, col);
return ${c.texture2D}(${o}, uv);
}`;return new k(it,["coordinates.packedUVfrom2D"])}getPackedSampler3D(e,o,s){let a=s.unpackedShape,$=[s.width,s.height],c=[$[0],$[1]],nt=G(this.context.glContext.version);if(a[0]===1){let ct=a.slice(1),ft=[1,2],pt=lr(a,ct),gt=["b","row","col"],wt=JSON.parse(JSON.stringify(s));wt.unpackedShape=pt;let vt=this.getPackedSamplerFromInput(e,o,wt),_t=`${vt.routineBody}
vec4 ${e}(int b, int row, int col) {
return ${e}(${fr(gt,ft)});
} `;return new k(_t,vt.dependencies)}let at=c[0],lt=c[1],et=Math.ceil(a[2]/2),it=et*Math.ceil(a[1]/2),st=`vec4 ${e}(int b, int row, int col) {
vec2 uv = packedUVfrom3D(
${lt}, ${at}, ${it}, ${et}, b, row, col);
return ${nt.texture2D}(${o}, uv);}`;return new k(st,["coordinates.packedUVfrom3D"])}getPackedSamplerND(e,o,s){let a=s.unpackedShape,$=a.length,c=[s.width,s.height],nt=G(this.context.glContext.version),at=[c[0],c[1]],lt=at[1],et=at[0],it=Math.ceil(a[$-1]/2),st=it*Math.ceil(a[$-2]/2),ct="int b, int row, int col",ft=`b * ${st} + (row / 2) * ${it} + (col / 2)`;for(let gt=2;gt<$-1;gt++)ct=`int b${gt}, `+ct,st*=a[$-gt-1],ft=`b${gt} * ${st} + `+ft;let pt=`vec4 ${e}(${ct}) {
int index = ${ft};
int texR = index / ${et};
int texC = index - texR * ${et};
vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${et}, ${lt});
return ${nt.texture2D}(${o}, uv);
}`;return new k(pt)}getUnpackedSamplerScalar(e,o,s){let[a,$]=[s.width,s.height];if(a===1&&$===1){let nt=`
float ${e}() {
return sampleTexture(${o}, halfCR);
}
`;return new k(nt,["coordinates.sampleTexture"])}let c=`
float ${e}() {
int offset_${o} = coordsToOffset(TexCoords, ${a}, ${$});
vec2 uv = uvFromFlat(${a}, ${$}, offset_${o});
return sampleTexture(${o}, uv);
}
`;return new k(c,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler1D(e,o,s){let a=s.width,$=s.height;if($===1&&a===1){let nt=`
float ${e}(int index) {
return sampleTexture(${o}, halfCR);
}
`;return new k(nt,["coordinates.sampleTexture"])}if($===1){let nt=`
float ${e}(int index) {
vec2 uv = vec2((float(index) + 0.5) / ${a}.0, 0.5);
return sampleTexture(${o}, uv);
}
`;return new k(nt,["coordinates.sampleTexture"])}if(a===1){let nt=`
float ${e}(int index) {
vec2 uv = vec2(0.5, (float(index) + 0.5) / ${$}.0);
return sampleTexture(${o}, uv);
}
`;return new k(nt,["coordinates.sampleTexture"])}let c=`
float ${e}(int index) {
vec2 uv = uvFromFlat(${a}, ${$}, index);
return sampleTexture(${o}, uv);
}
`;return new k(c,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler2D(e,o,s){let a=s.unpackedShape,$=[s.height,s.width];if($!=null&&Me.arraysEqual(a,$)){let st=$[1],ct=$[0],ft=`
float ${e}(int row, int col) {
vec2 uv = (vec2(row, col) + halfCR) / vec2(${st}.0, ${ct}.0);
return sampleTexture(${o}, uv);
}
`;return new k(ft,["coordinates.sampleTexture"])}let{newShape:c,keptDims:nt}=hr(a),at=c;if(at.length<a.length){let st=lr(a,at),ct=JSON.parse(JSON.stringify(s));ct.unpackedShape=st;let ft=["col","row"],pt=`
${this.getUnpackedSamplerFromInput(e,o,ct).routineBody}
float ${e}(int row, int col) {
return ${e}(${fr(ft,nt)});
}
`;return new k(pt,["coordinates.sampleTexture"])}let lt=$[1],et=$[0];if(et===1){let st=`
float ${e}(int row, int col) {
int offset_${o} = coordsToOffset(TexCoords, ${lt}, ${et});
float index = dot(vec3(row, col, offset_${o}), vec3(${a[1]}, 1, 1));
vec2 uv = vec2(0.5, (index + 0.5) / ${lt}.0);
return sampleTexture(${o}, uv);
}
`;return new k(st,["coordinates.sampleTexture","coordinates.coordsToOffset"])}if(lt===1){let st=`
float ${e}(int row, int col) {
int offset_${o} = coordsToOffset(TexCoords, ${lt}, ${et});
float index = dot(vec3(row, col, offset_${o}), vec3(${a[1]}, 1, 1));
vec2 uv = vec2((index + 0.5) / ${et}.0, 0.5);
return sampleTexture(${o}, uv);
}
`;return new k(st,["coordinates.sampleTexture","coordinates.coordsToOffset"])}let it=`
float ${e}(int row, int col) {
int index = col * ${a[1]} + row;
vec2 uv = uvFromFlat(${lt}, ${et}, index);
return sampleTexture(${o}, uv);
}
`;return new k(it,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler3D(e,o,s){let a=s.unpackedShape,$=a[1]*a[2],c=a[2],{newShape:nt,keptDims:at}=hr(a),lt=nt;if(lt.length<a.length){let ct=lr(a,lt),ft=["batch","col","row"],pt=JSON.parse(JSON.stringify(s));pt.unpackedShape=ct;let gt=this.getUnpackedSamplerFromInput(e,o,pt),wt=at.reverse(),vt=`
${gt.routineBody}
float ${e}(int batch, int row, int col) {
return ${e}(${fr(ft,wt)});
}
`;return new k(vt,gt.dependencies)}let et=s.width,it=s.height,st=`
float ${e}(int depth, int row, int col) {
// Explicitly use integer operations as dot() only works on floats.
int index = depth * ${$} + col * ${c} + row;
vec2 uv = uvFromFlat(${et}, ${it}, index);
return sampleTexture(${o}, uv);
}
`;return new k(st,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler4D(e,o,s){let a=s.unpackedShape,$=a[3],c=a[2]*$,nt=a[1]*c,at=s.width,lt=s.height,et=`
float ${e}(int row, int col, int depth, int depth2) {
int index = row * ${nt} + col * ${c} +
depth2 * ${$} + depth;
vec2 uv = uvFromFlat(${at}, ${lt}, index);
return sampleTexture(${o}, uv);
}
`;return new k(et,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler5D(e,o,s){let a=s.unpackedShape,$=a[4],c=a[3]*$,nt=a[2]*c,at=a[1]*nt,{newShape:lt,keptDims:et}=hr(a);if(lt.length<a.length){let ft=lr(a,lt),pt=["row","col","depth","depth2","depth3"],gt=JSON.parse(JSON.stringify(s));gt.unpackedShape=ft;let wt=`
${this.getUnpackedSamplerFromInput(e,o,gt).routineBody}
float ${e}(int row, int col, int depth, int depth2, int depth3) {
return ${e}(${fr(pt,et)});
}
`;return new k(wt,["coordinates.sampleTexture","coordinates.uvFromFlat"])}let it=s.width,st=s.height,ct=`
float ${e}(int row, int col, int depth, int depth2, int depth3) {
int index = row * ${at} + col * ${nt} + depth * ${c} +
depth3 * ${$} + depth2;
vec2 uv = uvFromFlat(${it}, ${st}, index);
return sampleTexture(${o}, uv);
}
`;return new k(ct,["coordinates.sampleTexture","coordinates.uvFromFlat"])}getUnpackedSampler6D(e,o,s){let a=s.unpackedShape,$=a[5],c=a[4]*$,nt=a[3]*c,at=a[2]*nt,lt=a[1]*at,{newShape:et,keptDims:it}=hr(a);if(et.length<a.length){let pt=lr(a,et),gt=["row","col","depth","depth2","depth3","depth4"],wt=JSON.parse(JSON.stringify(s));wt.unpackedShape=pt;let vt=`
${this.getUnpackedSamplerFromInput(e,o,wt).routineBody}
float ${e}(int row, int col, int depth,
int depth2, int depth3, int depth4) {
return ${e}(${fr(gt,it)});
}
`;return new k(vt,["coordinates.sampleTexture","coordinates.uvFromFlat"])}let st=s.width,ct=s.height,ft=`
float ${e}(int row, int col, int depth,
int depth2, int depth3, int depth4) {
int index = row * ${lt} + col * ${at} + depth * ${nt} +
depth2 * ${c} + depth3 * ${$} + depth4;
vec2 uv = uvFromFlat(${st}, ${ct}, index);
return sampleTexture(${o}, uv);
}
`;return new k(ft,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}toVec(){let e=this.context.outputTextureLayout,o=e.shape.length,s=e.strides,a=e.width,$=e.height,c=[];for(let at=0;at<o-1;++at)c.push(`
c[${at}] = offset / ${s[at]};`),c.push(`
offset -= c[${at}] * ${s[at]};`);c.push(`
c[${o-1}] = offset;`);let nt=`
void toVec(vec2 texCoords, out int c[${o}]) {
int offset = coordsToOffset(texCoords, ${a}, ${$});
${c.join("")}
}
void toVec(int offset, out int c[${o}]) {
${c.join("")}
}
`;return{toVec:new k(nt,["coordinates.coordsToOffset"])}}valueFrom(){let e={};return this.context.programInfo.inputNames.forEach((o,s)=>{let a=this.context.inputTextureLayouts[s],$=(a.unpackedShape.length>0?a.unpackedShape:a.shape).length,c=`_${o}`;e[c]=new k(this.getValueFromSingle(o,$,a.width,a.height,!1),[`shapeUtils.indicesToOffset${c}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),c=c+"_T",e[c]=new k(this.getValueFromSingle(o,$,a.width,a.height,!0),[`shapeUtils.indicesToOffset${c}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),e}getValueFromSingle(e,o,s,a,$){let c=`_${e}`;$&&(c=c+"_T");let nt=G(this.context.glContext.version);return`
float ${c}(int m[${o}]) {
int offset = indicesToOffset${c}(m);
vec2 coords = offsetToCoords(offset, ${s}, ${a});
float value = getColorAsFloat(${nt.texture2D}(${e}, coords));
return value;
}
`}getPackedValueFrom(e,o,s,a,$){let c=`_${e}_Pack`;$&&(c=c+"_T");let nt=G(this.context.glContext.version);return`
vec4 ${c}(int m[${o}]) {
int offset = indicesToOffset_${e}(m);
vec2 coords = offsetToCoords(offset, ${s}, ${a});
return ${nt.texture2D}(${e}, coords);
}
`}}}),zn,pp=O(()=>{Te(),zn=class ny extends Ht{constructor(o){super(o)}getFunctions(){return{...this.encodeFloat32(),...this.decodeFloat32()}}getCustomTypes(){return{}}encodeFloat32(){return{encode:new k(`highp vec4 encode(highp float f) {
return vec4(f, 0.0, 0.0, 0.0);
}
`)}}decodeFloat32(){return{decode:new k(`highp float decode(highp vec4 rgba) {
return rgba.r;
}
`)}}encodeUint8(){let o=ny.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new k(`
highp vec4 encode(highp float f) {
highp float F = abs(f);
highp float Sign = step(0.0,-f);
highp float Exponent = floor(log2(F));
highp float Mantissa = (exp2(- Exponent) * F);
Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));
highp vec4 rgba;
rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));
rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);
rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));
rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));
${o}
rgba = rgba / 255.0; // values need to be normalized to [0,1]
return rgba;
}
`)}}decodeUint8(){let o=ny.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new k(`
highp float decode(highp vec4 rgba) {
rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]
${o}
highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;
highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;
highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);
highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));
return Result;
}
`)}}static isLittleEndian(){let o=new ArrayBuffer(4),s=new Uint32Array(o),a=new Uint8Array(o);if(s[0]=3735928559,a[0]===239)return!0;if(a[0]===222)return!1;throw new Error("unknown endianness")}}}),Wn,dp=O(()=>{Te(),ut(),Wn=class extends Ht{constructor(e){super(e)}getFunctions(){return{...this.setFragColor(),...this.getColorAsFloat()}}getCustomTypes(){return{}}setFragColor(){let e=G(this.context.glContext.version);return{setFragColor:new k(`
void setFragColor(float value) {
${e.output} = encode(value);
}
`,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new k(`
float getColorAsFloat(vec4 color) {
return decode(color);
}
`,["encoding.decode"])}}}}),Hn,hp=O(()=>{Te(),Hn=class Eu extends Ht{constructor(o){super(o)}getFunctions(){return{...this.bcastIndex(),...this.bcastMatmulIndex(),...this.offsetToIndices(),...this.indicesToOffset(),...this.incrementIndices()}}getCustomTypes(){return{}}bcastIndex(){let o=this.context.outputTextureLayout.shape.length,s={};return this.context.programInfo.inputNames.forEach((a,$)=>{let c=this.context.inputTextureLayouts[$].unpackedShape;if(c.length<=o){let nt=c.length,at=o-nt,lt=`bcastIndices_${a}`,et="";for(let st=0;st<nt;++st)et+=`
realIndices[${st}] = int( mod(float(bcastedIndices[${at+st}]), ${c[st]}.0) );
`;let it=`
void ${lt} (int bcastedIndices[${o}], out int realIndices[${nt}]) {
${et}
}
`;s[lt]=new k(it)}}),s}bcastMatmulIndex(){let o=this.context.outputTextureLayout.shape.length,s={};return this.context.programInfo.inputNames.forEach((a,$)=>{let c=this.context.inputTextureLayouts[$].shape;if(!(c.length<2||c.length>o)){let nt=c.length,at=o-nt,lt=`bcastMatmulIndices_${a}`,et="";for(let st=0;st<nt-2;++st)et+=`
realIndices[${st}] = int( mod(float(bcastedIndices[${at+st}]), ${c[st]}.0) );
`;let it=`
void ${lt}(int bcastedIndices[${o}], out int realIndices[${nt}]) {
${et}
realIndices[${nt-1}] = bcastedIndices[${o-1}];
realIndices[${nt-2}] = bcastedIndices[${o-2}];
}
`;s[lt]=new k(it)}}),s}indicesToOffset(){let o={};return this.context.programInfo.inputNames.forEach((s,a)=>{let $=this.context.inputTextureLayouts[a].shape,c=this.context.inputTextureLayouts[a].strides,nt=$.length,at=`indicesToOffset_${s}`;o[at]=new k(Eu.indexToOffsetSingle(at,nt,c)),at=`indicesToOffset_${s}_T`,o[at]=new k(Eu.indexToOffsetSingle(at,nt,c.slice().reverse()))}),o}static indexToOffsetSingle(o,s,a){let $="";for(let c=s-1;c>=0;--c)$+=`
offset += indices[${c}] * ${a[c]};
`;return`
int ${o}(int indices[${s}]) {
int offset = 0;
${$}
return offset;
}
`}offsetToIndices(){let o={};return this.context.programInfo.inputNames.forEach((s,a)=>{let $=this.context.inputTextureLayouts[a].shape,c=this.context.inputTextureLayouts[a].strides,nt=$.length,at=`offsetToIndices_${s}`;o[at]=new k(Eu.offsetToIndicesSingle(at,nt,c)),at=`offsetToIndices_${s}_T`,o[at]=new k(Eu.offsetToIndicesSingle(at,nt,c.slice().reverse()))}),o}static offsetToIndicesSingle(o,s,a){let $=[];for(let c=0;c<s-1;++c)$.push(`
indices[${c}] = offset / ${a[c]};`),$.push(`
offset -= indices[${c}] * ${a[c]};`);return $.push(`
indices[${s-1}] = offset;`),`
void ${o}(int offset, out int indices[${s}]) {
${$.join("")}
}
`}incrementIndices(){let o={};return this.context.programInfo.inputNames.forEach((s,a)=>{let $=this.context.inputTextureLayouts[a].shape,c=$.length,nt=`incrementIndices_${s}`,at="";for(let et=0;et<c;++et)at+=`
shape[${et}] = ${$[et]};`;let lt=`
void ${nt}(int axis, out int indices[${c}]) {
int shape[${c}];
${at};
for(int i = ${c} -1 ; i >= 0; --i) {
if(i > axis) continue;
indices[i] += 1;
if(indices[i] < shape[i]) {
break;
}
indices[i] = 0;
}
}
`;o[nt]=new k(lt)}),o}}}),qn,mp=O(()=>{Te(),qn=class extends Ht{constructor(e){super(e)}getCustomTypes(){return{}}getFunctions(){return{...this.binaryVecFunctions(),...this.copyVec(),...this.setVecItem(),...this.getVecItem()}}binaryVecFunctions(){let e=this.context.outputTextureLayout.shape.length,o={add:"+=",sub:"-=",mul:"*=",div:"/="},s={};for(let a in o){let $=`${a}Vec`,c="";for(let at=0;at<e;++at)c+=`
dest[${at}] ${o[a]} src[${at}];
`;let nt=`
void ${$}(int src[${e}], out int dest[${e}]) {
${c}
}
`;s[$]=new k(nt)}return s}copyVec(){let e=this.context.outputTextureLayout.shape.length,o="";for(let a=0;a<e;++a)o+=`
dest[${a}] = src[${a}];
`;let s=`
void copyVec(int src[${e}], out int dest[${e}]) {
${o}
}
`;return{copyVec:new k(s)}}setVecItem(){let e=this.context.outputTextureLayout.shape.length,o=`
if(index < 0)
index =${e} + index;
if (index == 0)
m[0] = value;
`;for(let a=1;a<e-1;++a)o+=`
else if (index == ${a})
m[${a}] = value;
`;o+=`
else
m[${e-1}] = value;
`;let s=`
void setVecItem(out int m[${e}], int index, int value) {
${o}
}
`;return{setVecItem:new k(s)}}getVecItem(){let e=this.context.outputTextureLayout.shape.length,o=`
if(index < 0)
index = ${e} + index;
if (index == 0)
return m[0];
`;for(let a=1;a<e-1;++a)o+=`
else if (index == ${a})
return m[${a}];
`;o+=`
else
return m[${e-1}];
`;let s=`
int getVecItem(int m[${e}], int index) {
${o}
}
`;return{getVecItem:new k(s)}}}}),Ri,bp=O(()=>{cp(),pp(),dp(),hp(),mp(),Ri={encoding:zn,fragcolor:Wn,vec:qn,shapeUtils:Hn,coordinates:Vn}}),jn,gp=O(()=>{Te(),lp(),bp(),ut(),jn=class{constructor(e,o,s,a){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new Ln(e,o,s,a),Object.keys(Ri).forEach(c=>{let nt=new Ri[c](this.context);this.libs[c]=nt});let $=this.glslLibRoutineDependencyGraph;for(let c in this.libs){let nt=this.libs[c].getFunctions();for(let at in nt){let lt=c+"."+at,et;$[lt]?(et=$[lt],et.routineBody=nt[at].routineBody):(et=new Nr(lt,nt[at].routineBody),$[lt]=et);let it=nt[at].dependencies;if(it)for(let st=0;st<it.length;++st)if($[it[st]])et.addDependency($[it[st]]);else{let ct=new Nr(it[st]);$[it[st]]=ct,et.addDependency(ct)}}}}preprocess(){let e=this.context.programInfo,o=e.shaderSource;return this.context.programInfo.hasMain||(o=`${o}
${Ju(this.context.glContext.version,this.context.outputTextureLayout.shape.length)}`),o=up(o),`${Ku(this.context.glContext.version)}
${this.getUniforms(e.inputNames,e.variables)}
${this.getImports(o)}
${o}`}getImports(e){let o=this.selectGlslLibRoutinesToBeIncluded(e);if(o.length===0)return"";let s="";for(let a=0;a<o.length;++a)if(o[a].routineBody)s+=o[a].routineBody+`
`;else throw new Error(`Missing body for the Glsl Library routine: ${o[a].name}`);return s}selectGlslLibRoutinesToBeIncluded(e){let o=[];return Object.keys(this.glslLibRoutineDependencyGraph).forEach(s=>{let a=s.split(".")[1];e.indexOf(a)!==-1&&o.push(this.glslLibRoutineDependencyGraph[s])}),$n.returnOrderedNodes(o)}getUniforms(e,o){let s=[];if(e)for(let a of e)s.push(`uniform sampler2D ${a};`);if(o)for(let a of o)s.push(`uniform ${a.type} ${a.name}${a.arrayLength?`[${a.arrayLength}]`:""};`);return s.join(`
`)}}}),Xn,yp=O(()=>{Yt(),Ut(),gp(),ut(),Xn=class{constructor(e,o,s){this.profiler=e,this.glContext=o,this.textureLayoutStrategy=s,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,o){this.repo.set(e,o)}run(e,o,s){this.profiler.event("op",`ProgramManager.run ${e.programInfo.name??"unknown kernel"}`,()=>{let a=this.glContext.gl,$=e.program;a.useProgram($);try{this.bindOutput(s),this.attributesBound||this.bindAttributes(e.attribLocations),this.bindUniforms(e.uniformLocations,e.programInfo.variables??[],o)}catch(c){throw tt.error("ProgramManager",e.programInfo.shaderSource),c}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,o,s){return this.profiler.event("backend","ProgramManager.build",()=>{let a=new jn(this.glContext,e,o,s),$=a.preprocess(),c=this.compile($);return{programInfo:e,program:c,uniformLocations:this.getUniformLocations(c,a.context.programInfo.inputNames,a.context.programInfo.variables),attribLocations:this.getAttribLocations(c)}})}compile(e){if(!this.vertexShader){tt.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");let a=Xu(this.glContext.version);this.vertexShader=this.glContext.compileShader(a,this.glContext.gl.VERTEX_SHADER)}z.debug&&tt.verbose("ProrgramManager",`FragShader:
${e}
`);let o=this.glContext.compileShader(e,this.glContext.gl.FRAGMENT_SHADER),s=this.glContext.createProgram(this.vertexShader,o);return this.glContext.deleteShader(o),s}bindOutput(e){let o=e.width,s=e.height;tt.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${o}/${s}, shape=${e.shape}, type=${e.tensor.type}`),this.glContext.attachFramebuffer(e.texture,o,s)}bindAttributes(e){let o=e.position,s=e.textureCoord;this.glContext.setVertexAttributes(o,s),this.attributesBound=!0}bindUniforms(e,o,s){let a=this.glContext.gl,$=0;for(let{name:c,type:nt,location:at,arrayLength:lt}of e){let et=o.find(it=>it.name===c)?.data;if(nt!=="sampler2D"&&!et)throw new Error(`variable '${c}' does not have data defined in program info`);switch(nt){case"sampler2D":this.bindTexture(s[$],at,$),$++;break;case"float":lt?a.uniform1fv(at,et):a.uniform1f(at,et);break;case"int":lt?a.uniform1iv(at,et):a.uniform1i(at,et);break;default:throw new Error(`Uniform not implemented: ${nt}`)}}}bindTexture(e,o,s){this.glContext.bindTextureToUniform(e.texture,s,o)}getAttribLocations(e){return{position:this.getAttribLocation(e,"position"),textureCoord:this.getAttribLocation(e,"textureCoord")}}getUniformLocations(e,o,s){let a=[];if(o)for(let $ of o)a.push({name:$,type:"sampler2D",location:this.getUniformLocation(e,$)});if(s)for(let $ of s)a.push({...$,location:this.getUniformLocation(e,$.name)});return a}getUniformLocation(e,o){let s=this.glContext.gl.getUniformLocation(e,o);if(s===null)throw new Error(`Uniform ${o} not found.`);return s}getAttribLocation(e,o){return this.glContext.gl.getAttribLocation(e,o)}}}),Kn,xp=O(()=>{Ut(),Fr(),Kn=class{constructor(e,o,s,a){this.glContext=e,this.layoutStrategy=o,this.profiler=s,this.config=a,this.pendingRead=new Map,a.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(e,o,s,a){let $=this.toEncoderType(e),c=this.glContext.getEncoder($,o.channels||1,a);if(o.isPacked&&a===1)throw new Error("not implemented");let nt=o.width,at=o.height,lt,et;if(this.config.reuseTextures){lt=`${nt}x${at}_${c.format}_${c.internalFormat}_${c.textureType}`,et=this.inUseTextures.get(lt),et||(et=[],this.inUseTextures.set(lt,et));let st=this.idleTextures.get(lt);if(st&&st.length>0){let ct=st.pop();return et.push(ct),a===1&&this.glContext.updateTexture(ct,nt,at,c,this.toTextureData(e,s)),ct}}tt.verbose("TextureManager",`Creating new texture of size ${o.width}x${o.height}`);let it=this.glContext.allocateTexture(nt,at,c,this.toTextureData(e,s));return this.config.reuseTextures&&(et.push(it),this.textureLookup.set(it,lt)),it}readTexture(e,o,s){return s||(s=1),this.profiler.event("backend","TextureManager.readTexture",()=>{let a=e.shape.reduce((c,nt)=>c*nt)*s,$=this.glContext.readTexture(e.texture,e.width,e.height,a,this.toEncoderType(o),s);return this.toTensorData(o,$)})}async readTextureAsync(e,o,s){let a=e.tensor.dataId;if(s||(s=1),this.pendingRead.has(a)){let $=this.pendingRead.get(a);return new Promise(c=>$?.push(c))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(a,[]);let $=e.shape.reduce((lt,et)=>lt*et)*s;await this.glContext.createAndWaitForFence();let c=this.glContext.readTexture(e.texture,e.width,e.height,$,this.toEncoderType(o),s),nt=this.toTensorData(o,c),at=this.pendingRead.get(a);return this.pendingRead.delete(a),at?.forEach(lt=>lt(nt)),nt})}readUint8TextureAsFloat(e){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{let o=e.shape.reduce((a,$)=>a*$),s=this.glContext.readTexture(e.texture,e.width,e.height,o*4,"byte",4);return new Float32Array(s.buffer,s.byteOffset,o)})}releaseTexture(e,o){let s;if(this.config.reuseTextures&&(s=this.textureLookup.get(e.texture),s)){o&&this.textureLookup.delete(s);let a=this.inUseTextures.get(s);if(a){let $=a.indexOf(e.texture);if($!==-1){a.splice($,1);let c=this.idleTextures.get(s);c||(c=[],this.idleTextures.set(s,c)),c.push(e.texture)}}}(!s||o)&&(tt.verbose("TextureManager",`Deleting texture of size ${e.width}x${e.height}`),this.glContext.deleteTexture(e.texture))}toTensorData(e,o){switch(e){case"int16":return o instanceof Int16Array?o:Int16Array.from(o);case"int32":return o instanceof Int32Array?o:Int32Array.from(o);case"int8":return o instanceof Int8Array?o:Int8Array.from(o);case"uint16":return o instanceof Uint16Array?o:Uint16Array.from(o);case"uint32":return o instanceof Uint32Array?o:Uint32Array.from(o);case"uint8":case"bool":return o instanceof Uint8Array?o:Uint8Array.from(o);case"float32":return o instanceof Float32Array?o:Float32Array.from(o);case"float64":return o instanceof Float64Array?o:Float64Array.from(o);default:throw new Error(`TensorData type ${e} is not supported`)}}toTextureData(e,o){if(o)return o instanceof Float32Array?o:new Float32Array(o)}toEncoderType(e){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}}),Jn,Tp=O(()=>{Ut(),Bs(),cl(),ap(),yp(),Ni(),xp(),Jn=class{constructor(e,o){this.backend=e,this.context=o,this.layoutStrategy=new Un(e.glContext.maxTextureSize),this.programManager=new Xn(this.context.profiler,e.glContext,this.layoutStrategy),this.textureManager=new Kn(e.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:e.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=e.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new Dn(this)}onGraphInitialized(e){let o=e.getValues().filter(s=>s.from===-1&&s.tensor).map(s=>s.tensor.dataId);this.initializers=new Set(o)}isInitializer(e){return this.initializers?this.initializers.has(e):!1}addInitializer(e){this.initializers.add(e)}getTextureData(e,o){return o?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,o,s=!1){tt.verbose("WebGLSessionHandler","Storing Texture data in cache"),s?this.packedTextureDataCache.set(e,o):this.unpackedTextureDataCache.set(e,o)}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,o,s){let a=ks(e,o,ip);return{impl:a.opImpl,context:a.opInit?a.opInit(e,s):e}}}});function bg(e){let o=0;for(;o<e.length&&e[o]();++o);return o-1}var Mr,wp=O(()=>{Yt(),Fr(),Fr(),pe(),Mr=class{constructor(e,o){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=e,this.version=o,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}allocateTexture(e,o,s,a){let $=this.gl,c=$.createTexture();$.bindTexture($.TEXTURE_2D,c),$.texParameteri($.TEXTURE_2D,$.TEXTURE_MIN_FILTER,$.NEAREST),$.texParameteri($.TEXTURE_2D,$.TEXTURE_MAG_FILTER,$.NEAREST),$.texParameteri($.TEXTURE_2D,$.TEXTURE_WRAP_S,$.CLAMP_TO_EDGE),$.texParameteri($.TEXTURE_2D,$.TEXTURE_WRAP_T,$.CLAMP_TO_EDGE);let nt=a?s.encode(a,e*o):null;return $.texImage2D($.TEXTURE_2D,0,s.internalFormat,e,o,0,s.format,s.textureType,nt),this.checkError(),c}updateTexture(e,o,s,a,$){let c=this.gl;c.bindTexture(c.TEXTURE_2D,e);let nt=a.encode($,o*s);c.texSubImage2D(c.TEXTURE_2D,0,0,0,o,s,a.format,a.textureType,nt),this.checkError()}attachFramebuffer(e,o,s){let a=this.gl;a.bindTexture(a.TEXTURE_2D,e),a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e,0),this.checkError(),a.viewport(0,0,o,s),a.scissor(0,0,o,s)}readTexture(e,o,s,a,$,c){let nt=this.gl;c||(c=1),this.frameBufferBound||this.attachFramebuffer(e,o,s);let at=this.getEncoder($,c),lt=at.allocate(o*s);return nt.bindTexture(nt.TEXTURE_2D,e),nt.framebufferTexture2D(nt.FRAMEBUFFER,nt.COLOR_ATTACHMENT0,nt.TEXTURE_2D,e,0),nt.readPixels(0,0,o,s,nt.RGBA,at.textureType,lt),this.checkError(),at.decode(lt,a)}isFramebufferReady(){return!0}getActiveTexture(){let 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,o){let s=this.gl;s.vertexAttribPointer(e,3,s.FLOAT,!1,20,0),s.enableVertexAttribArray(e),o!==-1&&(s.vertexAttribPointer(o,2,s.FLOAT,!1,20,12),s.enableVertexAttribArray(o)),this.checkError()}createProgram(e,o){let s=this.gl,a=s.createProgram();return s.attachShader(a,e),s.attachShader(a,o),s.linkProgram(a),a}compileShader(e,o){let s=this.gl,a=s.createShader(o);if(!a)throw new Error(`createShader() returned null with type ${o}`);if(s.shaderSource(a,e),s.compileShader(a),s.getShaderParameter(a,s.COMPILE_STATUS)===!1)throw new Error(`Failed to compile shader: ${s.getShaderInfoLog(a)}
Shader source:
${e}`);return a}deleteShader(e){this.gl.deleteShader(e)}bindTextureToUniform(e,o,s){let a=this.gl;a.activeTexture(a.TEXTURE0+o),this.checkError(),a.bindTexture(a.TEXTURE_2D,e),this.checkError(),a.uniform1i(s,o),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(z.debug){let e=this.gl,o=e.getError(),s="";switch(o){case e.NO_ERROR:return;case e.INVALID_ENUM:s="INVALID_ENUM";break;case e.INVALID_VALUE:s="INVALID_VALUE";break;case e.INVALID_OPERATION:s="INVALID_OPERATION";break;case e.INVALID_FRAMEBUFFER_OPERATION:s="INVALID_FRAMEBUFFER_OPERATION";break;case e.OUT_OF_MEMORY:s="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:s="CONTEXT_LOST_WEBGL";break;default:s=`Unknown WebGL Error: ${o.toString(16)}`}throw new Error(s)}}deleteTexture(e){this.gl.deleteTexture(e)}deleteProgram(e){this.gl.deleteProgram(e)}getEncoder(e,o,s=0){if(this.version===2)return new Pn(this.gl,o);switch(e){case"float":return s===1||this.isRenderFloat32Supported?new Br(this.gl,o):new Br(this.gl,o,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new En(this.gl,o);default:throw new Error(`Invalid dataType: ${e}`)}}clearActiveTextures(){let e=this.gl;for(let o=0;o<this.maxTextureImageUnits;++o)e.activeTexture(e.TEXTURE0+o),e.bindTexture(e.TEXTURE_2D,null)}dispose(){if(this.disposed)return;let 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(){let e=this.gl,o=e.createBuffer();if(!o)throw new Error("createBuffer() returned null");let s=this.createDefaultGeometry();return e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW),this.checkError(),o}createFramebuffer(){let e=this.gl.createFramebuffer();if(!e)throw new Error("createFramebuffer returned null");return e}queryVitalParameters(){let e=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),this.version===1&&!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(){this.version===2?(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(){let e=this.gl,o=e.createTexture();e.bindTexture(e.TEXTURE_2D,o);let s=this.version===2?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,s,1,1,0,e.RGBA,e.FLOAT,null);let a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,o,0);let $=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(o),e.deleteFramebuffer(a),$}checkRenderFloat32(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension||!this.gl.getExtension("WEBGL_color_buffer_float"))return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){let e=this.gl,o,s,a,$,c;try{o=e.createTexture(),s=e.createFramebuffer(),e.bindTexture(e.TEXTURE_2D,o);let nt=this.version===2?e.RGBA32F:e.RGBA;return e.texImage2D(e.TEXTURE_2D,0,nt,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,o,0),e.enable(e.BLEND),a=e.createShader(e.VERTEX_SHADER),!a||(e.shaderSource(a,"void main(){}"),e.compileShader(a),$=e.createShader(e.FRAGMENT_SHADER),!$)||(e.shaderSource($,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),e.compileShader($),c=e.createProgram(),!c)?!1:(e.attachShader(c,a),e.attachShader(c,$),e.linkProgram(c),e.useProgram(c),e.drawArrays(e.POINTS,0,1),e.getError()===e.NO_ERROR)}finally{e.disable(e.BLEND),c&&e.deleteProgram(c),a&&e.deleteShader(a),$&&e.deleteShader($),s&&(e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(s)),o&&(e.bindTexture(e.TEXTURE_2D,null),e.deleteTexture(o))}}beginTimer(){if(this.version===2&&this.disjointTimerQueryWebgl2Extension){let e=this.gl,o=this.disjointTimerQueryWebgl2Extension,s=e.createQuery();return e.beginQuery(o.TIME_ELAPSED_EXT,s),s}else throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(this.version===2&&this.disjointTimerQueryWebgl2Extension){let e=this.gl,o=this.disjointTimerQueryWebgl2Extension;e.endQuery(o.TIME_ELAPSED_EXT);return}else throw new Error("WebGL1 profiling currently not supported")}isTimerResultAvailable(e){let o=!1,s=!1;if(this.version===2&&this.disjointTimerQueryWebgl2Extension){let a=this.gl,$=this.disjointTimerQueryWebgl2Extension;o=a.getQueryParameter(e,a.QUERY_RESULT_AVAILABLE),s=a.getParameter($.GPU_DISJOINT_EXT)}else throw new Error("WebGL1 profiling currently not supported");return o&&!s}getTimerResult(e){let o=0;if(this.version===2){let s=this.gl;o=s.getQueryParameter(e,s.QUERY_RESULT),s.deleteQuery(e)}else throw new Error("WebGL1 profiling currently not supported");return o/1e6}async waitForQueryAndGetTime(e){return await li(()=>this.isTimerResultAvailable(e)),this.getTimerResult(e)}async createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let o,s=e,a=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),a===null?o=()=>!0:o=()=>{let $=s.clientWaitSync(a,0,0);return $===s.ALREADY_SIGNALED||$===s.CONDITION_SATISFIED},{query:a,isFencePassed:o}}async pollFence(e){return new Promise(o=>{this.addItemToPoll(()=>e.isFencePassed(),()=>o())})}pollItems(){let e=bg(this.itemsToPoll.map(o=>o.isDoneFn));for(let o=0;o<=e;++o){let{resolveFn:s}=this.itemsToPoll[o];s()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}async addItemToPoll(e,o){this.itemsToPoll.push({isDoneFn:e,resolveFn:o}),!(this.itemsToPoll.length>1)&&await li(()=>(this.pollItems(),this.itemsToPoll.length===0))}}});function Gi(e){let o;if((!e||e==="webgl2")&&"webgl2"in mr?o=mr.webgl2:(!e||e==="webgl")&&"webgl"in mr&&(o=mr.webgl),!o)try{let a=yg();o=vp(a,e)}catch{let a=gg();o=vp(a,e)}e=e||o.version===1?"webgl":"webgl2";let s=o.gl;return mr[e]=o,s.isContextLost()?(delete mr[e],Gi(e)):(s.disable(s.DEPTH_TEST),s.disable(s.STENCIL_TEST),s.disable(s.BLEND),s.disable(s.DITHER),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SAMPLE_COVERAGE),s.enable(s.SCISSOR_TEST),s.enable(s.CULL_FACE),s.cullFace(s.BACK),o)}function vp(e,o){let s={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1},a,$=s;if((!o||o==="webgl2")&&(a=e.getContext("webgl2",$),a))try{return new Mr(a,2)}catch(c){tt.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${c}`)}if((!o||o==="webgl")&&(a=e.getContext("webgl",$)||e.getContext("experimental-webgl",$),a))try{return new Mr(a,1)}catch(c){tt.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${c}`)}throw new Error("WebGL is not supported")}function gg(){if(typeof document>"u")throw new TypeError("failed to create canvas: document is not supported");let e=document.createElement("canvas");return e.width=1,e.height=1,e}function yg(){if(typeof OffscreenCanvas>"u")throw new TypeError("failed to create offscreen canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}var mr,Ip=O(()=>{Ut(),wp(),mr={}}),Yn,_p=O(()=>{Yt(),Ut(),Tp(),Ip(),Yn=class{get contextId(){return z.webgl.contextId}set contextId(e){z.webgl.contextId=e}get matmulMaxBatchSize(){return z.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(e){z.webgl.matmulMaxBatchSize=e}get textureCacheMode(){return z.webgl.textureCacheMode}set textureCacheMode(e){z.webgl.textureCacheMode=e}get pack(){return z.webgl.pack}set pack(e){z.webgl.pack=e}get async(){return z.webgl.async}set async(e){z.webgl.async=e}initialize(){try{return this.glContext=Gi(this.contextId),typeof this.matmulMaxBatchSize!="number"&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!="string"&&(this.textureCacheMode="full"),typeof this.pack!="boolean"&&(this.pack=!1),typeof this.async!="boolean"&&(this.async=!1),tt.setWithEnv(z),z.webgl.context||Object.defineProperty(z.webgl,"context",{value:this.glContext.gl}),tt.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(e){return tt.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${e}`),!1}}createSessionHandler(e){return new Jn(this,e)}dispose(){this.glContext.dispose()}}});async function Mi(e){if(e){let o=typeof e=="string"?[e]:e;for(let s of o){let a=Op.get(s);if(a)return a;let $=await Tg(s);if($)return $}}else return Mi(["webgl"]);throw new Error("no available backend to use")}async function Tg(e){let o=xg;if(typeof o[e]<"u"&&wg(o[e])){let s=o[e],a=s.initialize();if(typeof a=="object"&&"then"in a&&(a=await a),a)return Op.set(e,s),s}}function wg(e){let o=e;return"initialize"in o&&typeof o.initialize=="function"&&"createSessionHandler"in o&&typeof o.createSessionHandler=="function"&&"dispose"in o&&typeof o.dispose=="function"}var Op,xg,Sp=O(()=>{_p(),Op=new Map,xg={webgl:new Yn}}),Ui,Zn,Ap=O(()=>{Ut(),Ui=class{constructor(e,o){this.op=e,this.node=o}},Zn=class{constructor(e,o,s){this.graph=e,this.profiler=s,this.initialize(o)}initialize(e){this.profiler.event("session","ExecutionPlan.initialize",()=>{let o=this.graph.getNodes();if(o.length!==e.length)throw new Error("The size of nodes and OPs do not match.");this._ops=e.map((s,a)=>new Ui(s,o[a])),this.reset(),this._starter=[],this._ops.forEach((s,a)=>{let $=!0;for(let c of s.node.inputs)if(!this._values[c]&&this.graph.getInputIndices().indexOf(c)===-1){$=!1;break}$&&this._starter.push(a)})})}reset(){this._values=this.graph.getValues().map(e=>e.tensor)}async execute(e,o){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();let s=e.createInferenceHandler(),a=this.graph.getInputIndices();if(o.length!==a.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${o.length} expected: ${a.length}`);o.forEach((et,it)=>{let st=a[it];this._values[st]=et});let $=this._starter.slice(0),c=this.graph.getValues(),nt=this.graph.getNodes(),at=0;for(;at<$.length;){let et=$[at++],it=this._ops[et],st=it.node.inputs.map(gt=>this._values[gt]);if(st.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${it.node}`);let ct=st;tt.verbose("ExecPlan",`Running op:${it.node.name} (${ct.map((gt,wt)=>`'${it.node.inputs[wt]}': ${gt.type}[${gt.dims.join(",")}]`).join(", ")})`);let ft=await this.profiler.event("node",it.node.name,async()=>it.op.impl(s,ct,it.op.context));if(ft.length!==it.node.outputs.length)throw new Error("the size of output does not match model definition.");ft.forEach((gt,wt)=>{let vt=it.node.outputs[wt];if(this._values[vt])throw new Error(`output [${vt}] already has value: op:${it.node.name}`);this._values[vt]=gt});let pt=new Set;ft.forEach((gt,wt)=>{let vt=it.node.outputs[wt];for(let _t of c[vt].to){let $t=nt[_t],Pt=!0;for(let Nt of $t.inputs)if(!this._values[Nt]){Pt=!1;break}Pt&&pt.add(_t)}}),$.push(...pt)}let lt=[];for(let et=0;et<this.graph.getOutputIndices().length;et++){let it=this.graph.getOutputIndices()[et],st=this._values[it];if(st===void 0)throw new Error(`required output [${it}] does not have value`);it===0?await st.getData():st.data,lt.push(st)}return tt.verbose("ExecPlan","disposing of inferenceHandler"),s.dispose(),lt})}}}),q,Xt,Ur,Pp=O(()=>{Pr(),q=rr(sr()),We(),Y(),Xt=F.experimental.fbs,Ur=class Su{constructor(o){if(this._attributes=new Map,o!=null){for(let s of o)s instanceof q.onnx.AttributeProto?this._attributes.set(s.name,[Su.getValue(s),Su.getType(s)]):s instanceof Xt.Attribute&&this._attributes.set(s.name(),[Su.getValue(s),Su.getType(s)]);if(this._attributes.size<o.length)throw new Error("duplicated attribute names")}}set(o,s,a){this._attributes.set(o,[a,s])}delete(o){this._attributes.delete(o)}getFloat(o,s){return this.get(o,"float",s)}getInt(o,s){return this.get(o,"int",s)}getString(o,s){return this.get(o,"string",s)}getTensor(o,s){return this.get(o,"tensor",s)}getFloats(o,s){return this.get(o,"floats",s)}getInts(o,s){return this.get(o,"ints",s)}getStrings(o,s){return this.get(o,"strings",s)}getTensors(o,s){return this.get(o,"tensors",s)}get(o,s,a){let $=this._attributes.get(o);if($===void 0){if(a!==void 0)return a;throw new Error(`required attribute not found: ${o}`)}if($[1]!==s)throw new Error(`type mismatch: expected ${s} but got ${$[1]}`);return $[0]}static getType(o){let s=o instanceof q.onnx.AttributeProto?o.type:o.type();switch(s){case q.onnx.AttributeProto.AttributeType.FLOAT:return"float";case q.onnx.AttributeProto.AttributeType.INT:return"int";case q.onnx.AttributeProto.AttributeType.STRING:return"string";case q.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case q.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case q.onnx.AttributeProto.AttributeType.INTS:return"ints";case q.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case q.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${q.onnx.AttributeProto.AttributeType[s]}`)}}static getValue(o){let s=o instanceof q.onnx.AttributeProto?o.type:o.type();if(s===q.onnx.AttributeProto.AttributeType.GRAPH||s===q.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");let a=this.getValueNoCheck(o);if(s===q.onnx.AttributeProto.AttributeType.INT&&Rt.isLong(a))return Rt.longToNumber(a);if(s===q.onnx.AttributeProto.AttributeType.INTS){let $=a,c=new Array($.length);for(let nt=0;nt<$.length;nt++){let at=$[nt];c[nt]=Rt.longToNumber(at)}return c}if(s===q.onnx.AttributeProto.AttributeType.TENSOR)return o instanceof q.onnx.AttributeProto?bt.fromProto(a):bt.fromOrtTensor(a);if(s===q.onnx.AttributeProto.AttributeType.TENSORS){if(o instanceof q.onnx.AttributeProto)return a.map($=>bt.fromProto($));if(o instanceof Xt.Attribute)return a.map($=>bt.fromOrtTensor($))}return s===q.onnx.AttributeProto.AttributeType.STRING&&o instanceof q.onnx.AttributeProto?kr(a):s===q.onnx.AttributeProto.AttributeType.STRINGS&&o instanceof q.onnx.AttributeProto?a.map(kr):a}static getValueNoCheck(o){return o instanceof q.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(o):this.getValueNoCheckFromOrtFormat(o)}static getValueNoCheckFromOnnxFormat(o){switch(o.type){case q.onnx.AttributeProto.AttributeType.FLOAT:return o.f;case q.onnx.AttributeProto.AttributeType.INT:return o.i;case q.onnx.AttributeProto.AttributeType.STRING:return o.s;case q.onnx.AttributeProto.AttributeType.TENSOR:return o.t;case q.onnx.AttributeProto.AttributeType.GRAPH:return o.g;case q.onnx.AttributeProto.AttributeType.FLOATS:return o.floats;case q.onnx.AttributeProto.AttributeType.INTS:return o.ints;case q.onnx.AttributeProto.AttributeType.STRINGS:return o.strings;case q.onnx.AttributeProto.AttributeType.TENSORS:return o.tensors;case q.onnx.AttributeProto.AttributeType.GRAPHS:return o.graphs;default:throw new Error(`unsupported attribute type: ${q.onnx.AttributeProto.AttributeType[o.type]}`)}}static getValueNoCheckFromOrtFormat(o){switch(o.type()){case Xt.AttributeType.FLOAT:return o.f();case Xt.AttributeType.INT:return o.i();case Xt.AttributeType.STRING:return o.s();case Xt.AttributeType.TENSOR:return o.t();case Xt.AttributeType.GRAPH:return o.g();case Xt.AttributeType.FLOATS:return o.floatsArray();case Xt.AttributeType.INTS:{let s=[];for(let a=0;a<o.intsLength();a++)s.push(o.ints(a));return s}case Xt.AttributeType.STRINGS:{let s=[];for(let a=0;a<o.stringsLength();a++)s.push(o.strings(a));return s}case Xt.AttributeType.TENSORS:{let s=[];for(let a=0;a<o.tensorsLength();a++)s.push(o.tensors(a));return s}default:throw new Error(`unsupported attribute type: ${Xt.AttributeType[o.type()]}`)}}}}),zi,Qn,Wi,me,to,Vi,Ep=O(()=>{Pp(),Pr(),zi=rr(sr()),We(),Y(),Qn=F.experimental.fbs,Wi={from:(e,o)=>new Vi(e,o)},me=class{constructor(e){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,e&&(this.type=At.tensorValueTypeFromProto(e.type.tensorType))}get from(){return this._from}get to(){return this._to}},to=class{constructor(e,o){e instanceof zi.onnx.NodeProto?(this.name=e.name,this.opType=e.opType,this.attributes=new Ur(e.attribute)):e instanceof Qn.Node&&(this.name=o??e.name(),this.opType=e.opType(),this.attributes=new Ur(At.tensorAttributesFromORTFormat(e))),this.inputs=[],this.outputs=[],this.executeNode=!0}},Vi=class{constructor(e,o){if(!e)throw new TypeError("graph is empty");this.buildGraph(e),this.transformGraph(o),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 zi.onnx.GraphProto)this.buildGraphFromOnnxFormat(e);else if(e instanceof Qn.Graph)this.buildGraphFromOrtFormat(e);else throw new TypeError("Graph type is not supported.")}buildGraphFromOnnxFormat(e){let o=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];let s=new Map;if(!e.input)throw new Error("missing information in graph: input");let a=[];for(let $ of e.input){if(o.has($.name))throw new Error(`duplicated input name: ${$.name}`);let c=this._allData.push(new me($))-1;o.set($.name,c),a.push($.name)}if(!e.initializer)throw new Error("missing information in graph: initializer");for(let $ of e.initializer){let c=o.get($.name);if(c===void 0){let nt=new me;nt.type={shape:{dims:At.tensorDimsFromProto($.dims)},tensorType:At.tensorDataTypeFromProto($.dataType)},c=this._allData.push(nt)-1,o.set($.name,c)}this._allData[c]._from=-1,this._allData[c].tensor=bt.fromProto($)}for(let $=0;$<this._allData.length;$++)this._allData[$].tensor||(this._allInputIndices.push($),this._allInputNames.push(a[$]));if(!e.output)throw new Error("missing information in graph: output");for(let $ of e.output){if(o.has($.name))throw new Error(`duplicated output name: ${$.name}`);let c=this._allData.push(new me($))-1;o.set($.name,c),this._allOutputIndices.push(c),this._allOutputNames.push($.name)}if(!e.node)throw new Error("missing information in graph: node");for(let $ of e.node){if(!$.name)for(let nt=0;;nt++){let at=`unnamed_${$.opType}_${nt}`;if(!s.has(at)){$.name=at;break}}if(s.has($.name))throw new Error(`duplicated node name: ${$.name}`);let c=this._nodes.push(new to($))-1;s.set($.name,c)}for(let $=0;$<this._nodes.length;$++){let c=this._nodes[$],nt=e.node[$];if(!nt.output)throw new Error(`missing output for node: ${nt.name}`);for(let at of nt.output){let lt=o.get(at);if(typeof lt>"u"&&(lt=this._allData.push(new me)-1,o.set(at,lt)),c.outputs.push(lt),this._allData[lt]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${lt}`);if(this._allData[lt]._from=$,nt.opType==="Constant"){if(!nt.attribute||nt.attribute.length!==1||!nt.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!nt.output||nt.output.length!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");c.outputs.pop(),c.executeNode=!1,this._allData[lt]._from=-1,this._allData[lt].tensor=bt.fromProto(nt.attribute[0].t)}}}for(let $=0;$<this._nodes.length;$++){let c=this._nodes[$],nt=e.node[$];if(!nt.input)throw new Error(`missing input for node: ${nt.name}`);for(let at of nt.input){let lt=o.get(at);if(typeof lt>"u"){if(at===""&&(nt.input.length===3||nt.input.length===4)&&nt.opType==="Resize")continue;throw new Error(`unrecognized input '${at}' for node: ${nt.name}`)}c.inputs.push(lt),this._allData[lt]._to.push($)}}return!0}buildGraphFromOrtFormat(e){let o=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];let s=new Map,a=[];for(let $=0;$<e.inputsLength();$++){let c=e.inputs($);if(o.has(c))throw new Error(`duplicated input name: ${c}`);for(let nt=0;nt<e.nodeArgsLength();nt++)if(e.nodeArgs(nt)?.name()===c){let at=new me;if(e.nodeArgs(nt)?.type()?.valueType()!==Qn.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");let lt=e.nodeArgs(nt).type().value(new Qn.TensorTypeAndShape),et=At.tensorDataTypeFromProto(lt.elemType()),it=lt.shape(),st=[];for(let ft=0;ft<it.dimLength();ft++)st.push(Rt.longToNumber(it.dim(ft).value().dimValue()));at.type={shape:{dims:st},tensorType:et};let ct=this._allData.push(at)-1;o.set(c,ct),a.push(c)}}for(let $=0;$<e.initializersLength();$++){let c=e.initializers($),nt=o.get(c.name());if(nt===void 0){let at=new me,lt=At.tensorDimsFromORTFormat(c),et=At.tensorDataTypeFromProto(c.dataType());at.type={shape:{dims:lt},tensorType:et},nt=this._allData.push(at)-1,o.set(c.name(),nt)}this._allData[nt]._from=-1,this._allData[nt].tensor=bt.fromOrtTensor(c)}for(let $=0;$<this._allData.length;$++)this._allData[$].tensor||(this._allInputIndices.push($),this._allInputNames.push(a[$]));for(let $=0;$<e.outputsLength();$++){let c=e.outputs($);if(o.has(c))throw new Error(`duplicated output name: ${c}`);let nt=this._allData.push(new me)-1;o.set(c,nt),this._allOutputIndices.push(nt),this._allOutputNames.push(c)}if(!e.nodes)throw new Error("missing information in graph: node");for(let $=0;$<e.nodesLength();$++){let c=e.nodes($),nt=c.name();if(!nt)for(let lt=0;nt=`unnamed_${c.opType()}_${lt}`,!!s.has(nt);lt++);if(s.has(nt))throw new Error(`duplicated node name: ${nt}`);let at=this._nodes.push(new to(c,nt))-1;s.set(nt,at)}for(let $=0;$<this._nodes.length;$++){let c=this._nodes[$],nt=e.nodes($);if(nt==null)throw new Error(`No node exists at index ${$}`);if(nt?.outputsLength()===0)throw new Error(`missing output for node: ${nt.name}`);for(let at=0;at<nt?.outputsLength();at++){let lt=nt?.outputs(at),et=o.get(lt);if(typeof et>"u"&&(et=this._allData.push(new me)-1,o.set(lt,et)),c.outputs.push(et),this._allData[et]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${et}`);if(this._allData[et]._from=$,nt.opType()==="Constant"){if(nt.attributesLength()!==1||!nt.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(nt.outputsLength()!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");c.outputs.pop(),c.executeNode=!1,this._allData[et]._from=-1,this._allData[et].tensor=bt.fromOrtTensor(nt.attributes(0).t())}}}for(let $=0;$<this._nodes.length;$++){let c=this._nodes[$],nt=e.nodes($);if(nt.inputsLength()===0)throw new Error(`missing input for node: ${nt.name}`);for(let at=0;at<nt.inputsLength();at++){let lt=nt.inputs(at),et=o.get(lt);if(typeof et>"u")throw new Error(`unrecognized input '${lt}' for node: ${nt.name()}`);c.inputs.push(et),this._allData[et]._to.push($)}}}checkIsAcyclic(){let e=new Set;this._allInputIndices.forEach(a=>{this._allData[a]._to.forEach($=>{e.add($)})});let o=Array.from(e),s=new Array(this._nodes.length).fill("white");for(;o.length>0;){let a=o.pop();s[a]==="gray"?s[a]="black":(o.push(a),s[a]="gray",this._nodes[a].outputs.forEach($=>{let c=this._allData[$];if(typeof c.tensor<"u")throw new Error("node outputs should not be initialized");if(c._from!==a)throw new Error("from property of the Value object doesn't match index of Node being processed");c._to.forEach(nt=>{if(s[nt]==="gray")throw new Error("model graph is cyclic");s[nt]==="white"&&o.push(nt)})}))}}transformGraph(e){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),e&&e.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let e=0,o=new Array(this._nodes.length,0),s=0;for(let a=0;a<this._nodes.length;a++)o[a]=s,this._nodes[a].executeNode?(s!==a&&(this._nodes[s]=this._nodes[a]),s++):this._nodes[a].outputs.forEach($=>{this._allData[$]._from=-2});this._nodes.splice(s,this._nodes.length-s);for(let a=0;a<this._allData.length;a++){let $=this._allData[a];$._from!==void 0&&$._from!==-1&&$._from!==-2&&($._from=o[$._from]);for(let c=0;c<$._to.length;c++)if($._to[c]>=0)$._to[c]=o[$._to[c]];else throw new Error("Trying to update a removed node")}e=0;for(let a=0;a<this._allData.length;a++){if(this._allData[a].from===-2&&this._allOutputIndices.indexOf(a+e)===-1){e++,this._allData.splice(a,1),a--;continue}if(e>0){let $=-1;this._allData[a].from!==void 0&&this._allData[a].from!==-1?($=this._nodes[this._allData[a].from].outputs.indexOf(a+e),$!==-1&&(this._nodes[this._allData[a].from].outputs[$]=a)):($=this._allInputIndices.indexOf(a+e),$!==-1&&(this._allInputIndices[$]=a)),this._allData[a].to.forEach(c=>{$=this._nodes[c].inputs.indexOf(a+e),$!==-1&&(this._nodes[c].inputs[$]=a)}),this._allData[a].to.length===0&&($=this._allOutputIndices.indexOf(a+e),$!==-1&&(this._allOutputIndices[$]=a))}}}deleteNode(e){let o=this._nodes[e];if(o.outputs.length>1){for(let nt=1;nt<o.outputs.length;nt++)if(this._allData[o.outputs[nt]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}o.executeNode=!1;let s=o.inputs[0],a=o.outputs[0],$=this._allData[a].to;for(let nt=0;nt<o.inputs.length;nt++){let at=this._allData[o.inputs[nt]].to.indexOf(e);if(at===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[o.inputs[nt]].to.splice(at,1)}this._allData[a]._to=[];let c=this._allOutputIndices.indexOf(a);if(c!==-1&&(this._allOutputIndices[c]=s),$&&$.length>0)for(let nt of $){let at=this._nodes[nt].inputs.indexOf(a);if(at===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[nt].inputs[at]=s,this._allData[s].to.push(nt)}}removeAllDropoutNodes(){let e=0;for(let o of this._nodes){if(o.opType==="Dropout"){if(o.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(o.outputs.length!==1&&o.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(o.outputs.length===2&&this._allData[o.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(e)}e++}}removeAllIdentityNodes(){let e=0;for(let o of this._nodes)o.opType==="Identity"&&this.deleteNode(e),e++}isActivation(e){switch(e.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(let e of this._nodes)if(e.opType==="Conv"){let o=this._allData[e.outputs[0]]._to;if(o.length===1&&this.isActivation(this._nodes[o[0]])){let s=this._nodes[o[0]];if(s.opType==="Clip")if(s.inputs.length===1)try{e.attributes.set("activation_params","floats",[s.attributes.getFloat("min"),s.attributes.getFloat("max")])}catch{e.attributes.set("activation_params","floats",[Ve,ze])}else if(s.inputs.length>=3&&this._allData[s.inputs[1]].tensor!==void 0&&this._allData[s.inputs[2]].tensor!==void 0)e.attributes.set("activation_params","floats",[this._allData[s.inputs[1]].tensor.floatData[0],this._allData[s.inputs[2]].tensor.floatData[0]]);else continue;e.attributes.set("activation","string",s.opType),this.deleteNode(o[0])}}}}}),Dp,vg,eo,Lp=O(()=>{wn(),Ep(),Pr(),Dp=rr(sr()),Y(),vg=F.experimental.fbs,eo=class{constructor(){}load(e,o,s){let a;if(!s)try{this.loadFromOnnxFormat(e,o);return}catch($){if(s!==void 0)throw $;a=$}try{this.loadFromOrtFormat(e,o)}catch($){throw s!==void 0?$:new Error(`Failed to load model as ONNX format: ${a}
as ORT format: ${$}`)}}loadFromOnnxFormat(e,o){let s=Dp.onnx.ModelProto.decode(e);if(Rt.longToNumber(s.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=s.opsetImport.map(a=>({domain:a.domain,version:Rt.longToNumber(a.version)})),this._graph=Wi.from(s.graph,o)}loadFromOrtFormat(e,o){let s=new w.ByteBuffer(e),a=vg.InferenceSession.getRootAsInferenceSession(s).model();if(Rt.longToNumber(a.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let $=0;$<a.opsetImportLength();$++){let c=a.opsetImport($);this._opsets.push({domain:c?.domain(),version:Rt.longToNumber(c.version())})}this._graph=Wi.from(a.graph(),o)}get graph(){return this._graph}get opsets(){return this._opsets}}}),ro,$p=O(()=>{Sp(),Ap(),Ut(),Lp(),ro=class{constructor(e={}){this._initialized=!1,this.backendHint=e.backendHint,this.profiler=xn.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,o,s){await this.profiler.event("session","Session.loadModel",async()=>{let a=await Mi(this.backendHint);if(this.sessionHandler=a.createSessionHandler(this.context),this._model=new eo,typeof e=="string"){let $=e.endsWith(".ort");{let c=await(await fetch(e)).arrayBuffer();this.initialize(new Uint8Array(c),$)}}else if(ArrayBuffer.isView(e))this.initialize(e);else{let $=new Uint8Array(e,o||0,s||e.byteLength);this.initialize($)}})}initialize(e,o){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{let s=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(e,s,o),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new Zn(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()=>{let o=this.normalizeAndValidateInputs(e),s=await this._executionPlan.execute(this.sessionHandler,o);return this.createOutput(s)})}normalizeAndValidateInputs(e){let o=this._model.graph.getInputNames();if(Array.isArray(e)){if(e.length!==o.length)throw new Error(`incorrect input array length: expected ${o.length} but got ${e.length}`)}else{if(e.size!==o.length)throw new Error(`incorrect input map size: expected ${o.length} but got ${e.size}`);let s=new Array(e.size),a=0;for(let $=0;$<o.length;++$){let c=e.get(o[$]);if(!c)throw new Error(`missing input tensor for: '${name}'`);s[a++]=c}e=s}if(!this.context.graphInputTypes||this.context.graphInputTypes.length===0||!this.context.graphInputDims||this.context.graphInputDims.length===0){let s=this._model.graph.getInputIndices(),a=this._model.graph.getValues(),$=new Array(s.length);for(let c=0;c<s.length;++c){let nt=a[s[c]];$[c]=nt.type.shape.dims,this.context.graphInputTypes.push(nt.type.tensorType),this.context.graphInputDims.push(e[c].dims)}this.validateInputTensorDims($,e,!0)}else this.validateInputTensorDims(this.context.graphInputDims,e,!1);return this.validateInputTensorTypes(this.context.graphInputTypes,e),e}validateInputTensorTypes(e,o){for(let s=0;s<o.length;s++){let a=e[s],$=o[s].type;if(a!==$)throw new Error(`input tensor[${s}] check failed: expected type '${a}' but got ${$}`)}}validateInputTensorDims(e,o,s){for(let a=0;a<o.length;a++){let $=e[a],c=o[a].dims;if(!this.compareTensorDims($,c,s))throw new Error(`input tensor[${a}] check failed: expected shape '[${$.join(",")}]' but got [${c.join(",")}]`)}}compareTensorDims(e,o,s){if(e.length!==o.length)return!1;for(let a=0;a<e.length;++a)if(e[a]!==o[a]&&(!s||e[a]!==0))return!1;return!0}createOutput(e){let o=this._model.graph.getOutputNames();if(e.length!==o.length)throw new Error("expected number of outputs do not match number of generated outputs");let s=new Map;for(let a=0;a<o.length;++a)s.set(o[a],e[a]);return s}initializeOps(e){let o=e.getNodes();this._ops=new Array(o.length);for(let s=0;s<o.length;s++)this._ops[s]=this.sessionHandler.resolve(o[s],this._model.opsets,e)}}}),no,kp=O(()=>{Yt(),We(),no=class{constructor(e){this.session=e,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(e,o,s){let a=new Map;for(let nt in e)if(Object.hasOwnProperty.call(e,nt)){let at=e[nt];a.set(nt,new bt(at.dims,at.type,void 0,void 0,at.data))}let $=await this.session.run(a),c={};return $.forEach((nt,at)=>{c[at]=new yt(nt.type,nt.data,nt.dims)}),c}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}}),Bp={};Or(Bp,{onnxjsBackend:()=>Ig});var Hi,Ig,Fp=O(()=>{$p(),kp(),Hi=class{async init(){}async createInferenceSessionHandler(e,o){let s=new ro(o);return typeof e=="string"?await s.loadModel(e):await s.loadModel(e),new no(s)}},Ig=new Hi}),oo=O(()=>{}),Rp={};Or(Rp,{default:()=>_g});var Cp,Np,_g,Gp=O(()=>{qi(),Ke(),Vr(),Cp="ort-wasm-proxy-worker",Np=globalThis.self?.name===Cp,Np&&(self.onmessage=e=>{let{type:o,in:s}=e.data;try{switch(o){case"init-wasm":io(s.wasm).then(()=>{ao(s).then(()=>{postMessage({type:o})},a=>{postMessage({type:o,err:a})})},a=>{postMessage({type:o,err:a})});break;case"init-ep":{let{epName:a,env:$}=s;so($,a).then(()=>{postMessage({type:o})},c=>{postMessage({type:o,err:c})});break}case"copy-from":{let{buffer:a}=s,$=zr(a);postMessage({type:o,out:$});break}case"create":{let{model:a,options:$}=s;uo(a,$).then(c=>{postMessage({type:o,out:c})},c=>{postMessage({type:o,err:c})});break}case"release":lo(s),postMessage({type:o});break;case"run":{let{sessionId:a,inputIndices:$,inputs:c,outputIndices:nt,options:at}=s;fo(a,$,c,nt,new Array(nt.length).fill(null),at).then(lt=>{lt.some(et=>et[3]!=="cpu")?postMessage({type:o,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:o,out:lt},po([...c,...lt]))},lt=>{postMessage({type:o,err:lt})});break}case"end-profiling":co(s),postMessage({type:o});break;default:}}catch(a){postMessage({type:o,err:a})}}),_g=Np?null:e=>new Worker(e??br,{type:"module",name:Cp})}),Up={};Or(Up,{default:()=>Og});var ji,Mp,Og,Vp=O(()=>{Mp=(ji=import.meta.url,async function(e={}){function o(){return tn.buffer!=Ot.buffer&&Ir(),Ot}function s(){return tn.buffer!=Ot.buffer&&Ir(),gr}function a(){return tn.buffer!=Ot.buffer&&Ir(),$o}function $(){return tn.buffer!=Ot.buffer&&Ir(),In}function c(){return tn.buffer!=Ot.buffer&&Ir(),Lr}var nt,at,lt=Object.assign({},e),et=new Promise((Mt,tr)=>{nt=Mt,at=tr}),it=typeof window=="object",st=typeof importScripts=="function",ct=st&&self.name=="em-pthread";lt.mountExternalData=(Mt,tr)=>{Mt.startsWith("./")&&(Mt=Mt.substring(2)),(lt.Ua||(lt.Ua=new Map)).set(Mt,tr)},lt.unmountExternalData=()=>{delete lt.Ua};var ft,pt,gt=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor,wt=Object.assign({},lt),vt="./this.program",_t=(Mt,tr)=>{throw tr},$t="";(it||st)&&(st?$t=self.location.href:typeof document<"u"&&document.currentScript&&($t=document.currentScript.src),ji&&($t=ji),$t=$t.startsWith("blob:")?"":$t.substr(0,$t.replace(/[?#].*/,"").lastIndexOf("/")+1),st&&(pt=Mt=>{var tr=new XMLHttpRequest;return tr.open("GET",Mt,!1),tr.responseType="arraybuffer",tr.send(null),new Uint8Array(tr.response)}),ft=(Mt,tr,Er)=>{var Qr=new XMLHttpRequest;Qr.open("GET",Mt,!0),Qr.responseType="arraybuffer",Qr.onload=()=>{Qr.status==200||Qr.status==0&&Qr.response?tr(Qr.response):Er()},Qr.onerror=Er,Qr.send(null)});var Pt,Nt=console.log.bind(console),Lt=console.error.bind(console),Ft=Nt,Jt=Lt;if(Object.assign(lt,wt),wt=null,ct){let Mt=function(tr){try{var Er=tr.data,Qr=Er.cmd;if(Qr==="load"){let _n=[];self.onmessage=Po=>_n.push(Po),self.startWorker=()=>{postMessage({cmd:"loaded"});for(let Po of _n)Mt(Po);self.onmessage=Mt};for(let Po of Er.handlers)lt[Po]&&!lt[Po].proxy||(lt[Po]=(...qs)=>{postMessage({Za:"callHandler",kb:Po,args:qs})},Po=="print"&&(Ft=lt[Po]),Po=="printErr"&&(Jt=lt[Po]));tn=Er.wasmMemory,Ir(),_r(Er.wasmModule)}else if(Qr==="run"){_d(Er.pthread_ptr,0,0,1,0,0),Cu(Er.pthread_ptr),ba(),Xo(),wr||=!0;try{eu(Er.start_routine,Er.arg)}catch(_n){if(_n!="unwind")throw _n}}else Qr==="cancel"?hu()&&Pu(-1):Er.target!=="setimmediate"&&(Qr==="checkMailbox"?wr&&Ou():Qr&&(Jt(`worker: received unknown command ${Qr}`),Jt(Er)))}catch(_n){throw Ny(),_n}};var _r,wr=!1;Jt=function(...tr){tr=tr.join(" "),console.error(tr)},self.alert=function(...tr){postMessage({Za:"alert",text:tr.join(" "),nb:hu()})},lt.instantiateWasm=(tr,Er)=>new Promise(Qr=>{_r=_n=>{_n=new WebAssembly.Instance(_n,Dt()),Er(_n),Qr()}}),self.onunhandledrejection=tr=>{throw tr.reason||tr},self.onmessage=Mt}lt.wasmBinary&&(Pt=lt.wasmBinary);var tn,Wt,Yr,Ot,gr,$o,In,en,Lr,ko=!1;function Ir(){var Mt=tn.buffer;lt.HEAP8=Ot=new Int8Array(Mt),lt.HEAP16=new Int16Array(Mt),lt.HEAPU8=gr=new Uint8Array(Mt),lt.HEAPU16=new Uint16Array(Mt),lt.HEAP32=$o=new Int32Array(Mt),lt.HEAPU32=In=new Uint32Array(Mt),lt.HEAPF32=new Float32Array(Mt),lt.HEAPF64=Lr=new Float64Array(Mt),lt.HEAP64=en=new BigInt64Array(Mt),lt.HEAPU64=new BigUint64Array(Mt)}if(!ct){if(!((tn=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0})).buffer instanceof gt))throw Jt("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"),Error("bad memory");Ir()}var Dr=[],Zr=[],rn=[],On=0,zo=null;function Yo(){if(--On==0&&zo){var Mt=zo;zo=null,Mt()}}function jo(Mt){throw Jt(Mt="Aborted("+Mt+")"),ko=!0,Yr=1,Mt=new WebAssembly.RuntimeError(Mt+". Build with -sASSERTIONS for more info."),at(Mt),Mt}var Ko,Zo=Mt=>Mt.startsWith("data:application/octet-stream;base64,"),Fo=Mt=>Mt.startsWith("file://");function Js(Mt){if(Mt==Ko&&Pt)return new Uint8Array(Pt);if(pt)return pt(Mt);throw"both async and sync fetching of the wasm failed"}function Ks(Mt,tr,Er){return function(Qr){if(!Pt&&(it||st)){if(typeof fetch=="function"&&!Fo(Qr))return fetch(Qr,{credentials:"same-origin"}).then(_n=>{if(!_n.ok)throw`failed to load wasm binary file at '${Qr}'`;return _n.arrayBuffer()}).catch(()=>Js(Qr));if(ft)return new Promise((_n,Po)=>{ft(Qr,qs=>_n(new Uint8Array(qs)),Po)})}return Promise.resolve().then(()=>Js(Qr))}(Mt).then(Qr=>WebAssembly.instantiate(Qr,tr)).then(Er,Qr=>{Jt(`failed to asynchronously prepare wasm: ${Qr}`),jo(Qr)})}function Dt(){return{a:{j:Jr,b:gu,E:yu,g:iy,V:oy,A:ly,C:uy,W:cy,T:dy,L:fy,S:py,o:hy,B:my,y:gy,U:yy,z:_y,_:Gy,Z:qy,P:Yy,w:Ky,F:Xy,k:Qy,O:Cu,Y:Zy,I:Jy,J:e1,K:t1,G:wy,H:xy,v:r1,q:n1,l:i1,p:o1,e:s1,X:a1,x:l1,d:$y,f:u1,i:d1,u:f1,t:p1,s:h1,Q:Ty,R:ky,D:Bo,h:Oy,n:Iy,M:Ay,m:Py,a:tn,r:Kr,N:Cy,c:y1}}}var Eo={836900:(Mt,tr,Er,Qr,_n)=>{if(lt===void 0||!lt.Ua)return 1;if((Mt=_u(Mt>>>0)).startsWith("./")&&(Mt=Mt.substring(2)),!(Mt=lt.Ua.get(Mt)))return 2;if(Qr>>>=0,(tr>>>=0)+(Er>>>=0)>Mt.byteLength)return 3;try{let Po=Mt.subarray(tr,tr+Er);switch(_n){case 0:s().set(Po,Qr>>>0);break;case 1:lt.mb(Qr,Po);break;default:return 4}return 0}catch{return 4}},837583:()=>typeof wasmOffsetConverter<"u"};function Jr(){return typeof wasmOffsetConverter<"u"}function ar(Mt){this.name="ExitStatus",this.message=`Program terminated with exit(${Mt})`,this.status=Mt}var er=Mt=>{Mt.terminate(),Mt.onmessage=()=>{}},vr=Mt=>{Ao.length==0&&(Jo(),Lo(Ao[0]));var tr=Ao.pop();if(!tr)return 6;Qo.push(tr),vn[Mt.Ra]=tr,tr.Ra=Mt.Ra;var Er={cmd:"run",start_routine:Mt.cb,arg:Mt.ab,pthread_ptr:Mt.Ra};return tr.postMessage(Er,Mt.ib),0},_o=0,nn=(Mt,tr,...Er)=>{for(var Qr=2*Er.length,_n=ty(),Po=ey(8*Qr),qs=Po>>>3,xa=0;xa<Er.length;xa++){var tu=Er[xa];typeof tu=="bigint"?(en[qs+2*xa]=1n,en[qs+2*xa+1]=tu):(en[qs+2*xa]=0n,c()[qs+2*xa+1>>>0]=tu)}return Mt=My(Mt,0,Qr,Po,tr),Ru(_n),Mt};function Kr(Mt){if(ct)return nn(0,1,Mt);if(Yr=Mt,!(0<_o)){for(var tr of Qo)er(tr);for(tr of Ao)er(tr);Ao=[],Qo=[],vn=[],ko=!0}_t(Mt,new ar(Mt))}function Io(Mt){if(ct)return nn(1,0,Mt);Bo(Mt)}var Bo=Mt=>{if(Yr=Mt,ct)throw Io(Mt),"unwind";Kr(Mt)},Ao=[],Qo=[],So=[],vn={},Do=Mt=>{var tr=Mt.Ra;delete vn[tr],Ao.push(Mt),Qo.splice(Qo.indexOf(Mt),1),Mt.Ra=0,Om(tr)};function Xo(){So.forEach(Mt=>Mt())}var Lo=Mt=>new Promise(tr=>{Mt.onmessage=_n=>{var Po=(_n=_n.data).cmd;if(_n.targetThread&&_n.targetThread!=hu()){var qs=vn[_n.targetThread];qs?qs.postMessage(_n,_n.transferList):Jt(`Internal error! Worker sent a message "${Po}" to target pthread ${_n.targetThread}, but that thread no longer exists!`)}else Po==="checkMailbox"?Ou():Po==="spawnThread"?vr(_n):Po==="cleanupThread"?Do(vn[_n.thread]):Po==="killThread"?(_n=_n.thread,Po=vn[_n],delete vn[_n],er(Po),Om(_n),Qo.splice(Qo.indexOf(Po),1),Po.Ra=0):Po==="cancelThread"?vn[_n.thread].postMessage({cmd:"cancel"}):Po==="loaded"?(Mt.loaded=!0,tr(Mt)):Po==="alert"?alert(`Thread ${_n.threadId}: ${_n.text}`):_n.target==="setimmediate"?Mt.postMessage(_n):Po==="callHandler"?lt[_n.handler](..._n.args):Po&&Jt(`worker sent an unknown command ${Po}`)},Mt.onerror=_n=>{throw Jt(`worker sent an error! ${_n.filename}:${_n.lineno}: ${_n.message}`),_n};var Er,Qr=[];for(Er of[])lt.hasOwnProperty(Er)&&Qr.push(Er);Mt.postMessage({cmd:"load",handlers:Qr,wasmMemory:tn,wasmModule:Wt})});function Jo(){var Mt=new Worker(new URL(import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});Ao.push(Mt)}var Xs,na=Mt=>{for(;0<Mt.length;)Mt.shift()(lt)},ba=()=>{var Mt=hu(),tr=$()[Mt+52>>>2>>>0];Mt=$()[Mt+56>>>2>>>0],Ly(tr,tr-Mt),Ru(tr)},ga=[],eu=(Mt,tr)=>{_o=0;var Er=ga[Mt];Er||(Mt>=ga.length&&(ga.length=Mt+1),ga[Mt]=Er=Xs.get(Mt)),Mt=Er(tr),0<_o?Yr=Mt:Pu(Mt)};class mu{constructor(tr){this.Xa=tr-24}}function gu(Mt,tr,Er){var Qr=new mu(Mt>>>=0);throw tr>>>=0,Er>>>=0,$()[Qr.Xa+16>>>2>>>0]=0,$()[Qr.Xa+4>>>2>>>0]=tr,$()[Qr.Xa+8>>>2>>>0]=Er,Mt}function Tu(Mt,tr,Er,Qr){return ct?nn(2,1,Mt,tr,Er,Qr):yu(Mt,tr,Er,Qr)}function yu(Mt,tr,Er,Qr){if(Mt>>>=0,tr>>>=0,Er>>>=0,Qr>>>=0,gt===void 0)return Jt("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var _n=[];return ct&&_n.length===0?Tu(Mt,tr,Er,Qr):(Mt={cb:Er,Ra:Mt,ab:Qr,ib:_n},ct?(Mt.Za="spawnThread",postMessage(Mt,_n),0):vr(Mt))}var iu=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,uu=(Mt,tr,Er)=>{var Qr=(tr>>>=0)+Er;for(Er=tr;Mt[Er]&&!(Er>=Qr);)++Er;if(16<Er-tr&&Mt.buffer&&iu)return iu.decode(Mt.buffer instanceof gt?Mt.slice(tr,Er):Mt.subarray(tr,Er));for(Qr="";tr<Er;){var _n=Mt[tr++];if(128&_n){var Po=63&Mt[tr++];if((224&_n)==192)Qr+=String.fromCharCode((31&_n)<<6|Po);else{var qs=63&Mt[tr++];65536>(_n=(240&_n)==224?(15&_n)<<12|Po<<6|qs:(7&_n)<<18|Po<<12|qs<<6|63&Mt[tr++])?Qr+=String.fromCharCode(_n):(_n-=65536,Qr+=String.fromCharCode(55296|_n>>10,56320|1023&_n))}}else Qr+=String.fromCharCode(_n)}return Qr},_u=(Mt,tr)=>(Mt>>>=0)?uu(s(),Mt,tr):"";function iy(Mt,tr,Er){return ct?nn(3,1,Mt,tr,Er):0}function oy(Mt,tr){if(ct)return nn(4,1,Mt,tr)}var sy=Mt=>{for(var tr=0,Er=0;Er<Mt.length;++Er){var Qr=Mt.charCodeAt(Er);127>=Qr?tr++:2047>=Qr?tr+=2:55296<=Qr&&57343>=Qr?(tr+=4,++Er):tr+=3}return tr},ay=(Mt,tr,Er,Qr)=>{if(!(0<Qr))return 0;var _n=Er>>>=0;Qr=Er+Qr-1;for(var Po=0;Po<Mt.length;++Po){var qs=Mt.charCodeAt(Po);if(55296<=qs&&57343>=qs&&(qs=65536+((1023&qs)<<10)|1023&Mt.charCodeAt(++Po)),127>=qs){if(Er>=Qr)break;tr[Er++>>>0]=qs}else{if(2047>=qs){if(Er+1>=Qr)break;tr[Er++>>>0]=192|qs>>6}else{if(65535>=qs){if(Er+2>=Qr)break;tr[Er++>>>0]=224|qs>>12}else{if(Er+3>=Qr)break;tr[Er++>>>0]=240|qs>>18,tr[Er++>>>0]=128|qs>>12&63}tr[Er++>>>0]=128|qs>>6&63}tr[Er++>>>0]=128|63&qs}}return tr[Er>>>0]=0,Er-_n},bu=(Mt,tr,Er)=>ay(Mt,s(),tr,Er);function ly(Mt,tr){if(ct)return nn(5,1,Mt,tr)}function uy(Mt,tr,Er){if(ct)return nn(6,1,Mt,tr,Er)}function cy(Mt,tr,Er){return ct?nn(7,1,Mt,tr,Er):0}function dy(Mt,tr){if(ct)return nn(8,1,Mt,tr)}function fy(Mt,tr,Er){if(ct)return nn(9,1,Mt,tr,Er)}function py(Mt,tr,Er,Qr){if(ct)return nn(10,1,Mt,tr,Er,Qr)}function hy(Mt,tr,Er,Qr){if(ct)return nn(11,1,Mt,tr,Er,Qr)}function my(Mt,tr,Er,Qr){if(ct)return nn(12,1,Mt,tr,Er,Qr)}function gy(Mt){if(ct)return nn(13,1,Mt)}function yy(Mt,tr){if(ct)return nn(14,1,Mt,tr)}function _y(Mt,tr,Er){if(ct)return nn(15,1,Mt,tr,Er)}var Gy=()=>{jo("")},qy=()=>1;function Yy(Mt){_d(Mt>>>0,!st,1,!it,131072,!1),Xo()}function Cu(Mt){Mt>>>=0,typeof Atomics.jb=="function"&&(Atomics.jb(a(),Mt>>>2,Mt).value.then(Ou),Mt+=128,Atomics.store(a(),Mt>>>2,1))}var Ou=()=>{var Mt=hu();if(Mt&&(Cu(Mt),Mt=jy,!ko))try{if(Mt(),!(0<_o))try{ct?Pu(Yr):Bo(Yr)}catch(tr){tr instanceof ar||tr=="unwind"||_t(1,tr)}}catch(tr){tr instanceof ar||tr=="unwind"||_t(1,tr)}};function Ky(Mt,tr){(Mt>>>=0)==tr>>>0?setTimeout(Ou):ct?postMessage({targetThread:Mt,cmd:"checkMailbox"}):(Mt=vn[Mt])&&Mt.postMessage({cmd:"checkMailbox"})}var Bu=[];function Xy(Mt,tr,Er,Qr,_n){for(tr>>>=0,Qr/=2,Bu.length=Qr,Er=_n>>>0>>>3,_n=0;_n<Qr;_n++)Bu[_n]=en[Er+2*_n]?en[Er+2*_n+1]:c()[Er+2*_n+1>>>0];return(tr?Eo[tr]:_1[Mt])(...Bu)}function Qy(Mt){Mt>>>=0,ct?postMessage({cmd:"cleanupThread",thread:Mt}):Do(vn[Mt])}function Zy(Mt){}function Jy(Mt,tr){Mt=-9007199254740992>Mt||9007199254740992<Mt?NaN:Number(Mt),tr>>>=0,Mt=new Date(1e3*Mt),a()[tr>>>2>>>0]=Mt.getUTCSeconds(),a()[tr+4>>>2>>>0]=Mt.getUTCMinutes(),a()[tr+8>>>2>>>0]=Mt.getUTCHours(),a()[tr+12>>>2>>>0]=Mt.getUTCDate(),a()[tr+16>>>2>>>0]=Mt.getUTCMonth(),a()[tr+20>>>2>>>0]=Mt.getUTCFullYear()-1900,a()[tr+24>>>2>>>0]=Mt.getUTCDay(),Mt=(Mt.getTime()-Date.UTC(Mt.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[tr+28>>>2>>>0]=Mt}var pu=Mt=>Mt%4==0&&(Mt%100!=0||Mt%400==0),by=[0,31,60,91,121,152,182,213,244,274,305,335],vy=[0,31,59,90,120,151,181,212,243,273,304,334];function e1(Mt,tr){Mt=-9007199254740992>Mt||9007199254740992<Mt?NaN:Number(Mt),tr>>>=0,Mt=new Date(1e3*Mt),a()[tr>>>2>>>0]=Mt.getSeconds(),a()[tr+4>>>2>>>0]=Mt.getMinutes(),a()[tr+8>>>2>>>0]=Mt.getHours(),a()[tr+12>>>2>>>0]=Mt.getDate(),a()[tr+16>>>2>>>0]=Mt.getMonth(),a()[tr+20>>>2>>>0]=Mt.getFullYear()-1900,a()[tr+24>>>2>>>0]=Mt.getDay();var Er=(pu(Mt.getFullYear())?by:vy)[Mt.getMonth()]+Mt.getDate()-1|0;a()[tr+28>>>2>>>0]=Er,a()[tr+36>>>2>>>0]=-60*Mt.getTimezoneOffset(),Er=new Date(Mt.getFullYear(),6,1).getTimezoneOffset();var Qr=new Date(Mt.getFullYear(),0,1).getTimezoneOffset();Mt=0|(Er!=Qr&&Mt.getTimezoneOffset()==Math.min(Qr,Er)),a()[tr+32>>>2>>>0]=Mt}function t1(Mt){Mt>>>=0;var tr=new Date(a()[Mt+20>>>2>>>0]+1900,a()[Mt+16>>>2>>>0],a()[Mt+12>>>2>>>0],a()[Mt+8>>>2>>>0],a()[Mt+4>>>2>>>0],a()[Mt>>>2>>>0],0),Er=a()[Mt+32>>>2>>>0],Qr=tr.getTimezoneOffset(),_n=new Date(tr.getFullYear(),6,1).getTimezoneOffset(),Po=new Date(tr.getFullYear(),0,1).getTimezoneOffset(),qs=Math.min(Po,_n);return 0>Er?a()[Mt+32>>>2>>>0]=+(_n!=Po&&qs==Qr):0<Er!=(qs==Qr)&&(_n=Math.max(Po,_n),tr.setTime(tr.getTime()+6e4*((0<Er?qs:_n)-Qr))),a()[Mt+24>>>2>>>0]=tr.getDay(),Er=(pu(tr.getFullYear())?by:vy)[tr.getMonth()]+tr.getDate()-1|0,a()[Mt+28>>>2>>>0]=Er,a()[Mt>>>2>>>0]=tr.getSeconds(),a()[Mt+4>>>2>>>0]=tr.getMinutes(),a()[Mt+8>>>2>>>0]=tr.getHours(),a()[Mt+12>>>2>>>0]=tr.getDate(),a()[Mt+16>>>2>>>0]=tr.getMonth(),a()[Mt+20>>>2>>>0]=tr.getYear(),Mt=tr.getTime(),BigInt(isNaN(Mt)?-1:Mt/1e3)}function wy(Mt,tr,Er,Qr,_n,Po,qs){return ct?nn(16,1,Mt,tr,Er,Qr,_n,Po,qs):-52}function xy(Mt,tr,Er,Qr,_n,Po){if(ct)return nn(17,1,Mt,tr,Er,Qr,_n,Po)}function r1(Mt,tr,Er,Qr){Mt>>>=0,tr>>>=0,Er>>>=0,Qr>>>=0;var _n=new Date().getFullYear(),Po=new Date(_n,0,1),qs=new Date(_n,6,1);_n=Po.getTimezoneOffset();var xa=qs.getTimezoneOffset(),tu=Math.max(_n,xa);$()[Mt>>>2>>>0]=60*tu,a()[tr>>>2>>>0]=+(_n!=xa),Po=(Mt=ru=>ru.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1])(Po),qs=Mt(qs),xa<_n?(bu(Po,Er,17),bu(qs,Qr,17)):(bu(Po,Qr,17),bu(qs,Er,17))}var Uu=[];function n1(Mt,tr,Er){Mt>>>=0,tr>>>=0,Er>>>=0,Uu.length=0;for(var Qr;Qr=s()[tr++>>>0];){var _n=Qr!=105;Er+=(_n&=Qr!=112)&&Er%8?4:0,Uu.push(Qr==112?$()[Er>>>2>>>0]:Qr==106?en[Er>>>3]:Qr==105?a()[Er>>>2>>>0]:c()[Er>>>3>>>0]),Er+=_n?8:4}return Eo[Mt](...Uu)}var i1=()=>{},o1=()=>Date.now();function s1(Mt,tr){return Jt(_u(Mt>>>0,tr>>>0))}var $y,a1=()=>{throw _o+=1,"unwind"};function l1(){return 4294901760}$y=()=>performance.timeOrigin+performance.now();var u1=()=>navigator.hardwareConcurrency;function d1(){return jo("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function f1(Mt){Mt>>>=0;var tr=s().length;if(Mt<=tr||4294901760<Mt)return!1;for(var Er=1;4>=Er;Er*=2){var Qr=tr*(1+.2/Er);Qr=Math.min(Qr,Mt+100663296);var _n=Math;Qr=Math.max(Mt,Qr);e:{_n=(_n.min.call(_n,4294901760,Qr+(65536-Qr%65536)%65536)-tn.buffer.byteLength+65535)/65536;try{tn.grow(_n),Ir();var Po=1;break e}catch{}Po=void 0}if(Po)return!0}return!1}var Iu=()=>(jo("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),wu={},Ey=Mt=>{Mt.forEach(tr=>{Iu()})};function p1(){var Mt=Error().stack.toString().split(`
`);return Mt[0]=="Error"&&Mt.shift(),Ey(Mt),wu.$a=Iu(),wu.bb=Mt,wu.$a}function h1(Mt,tr,Er){if(Mt>>>=0,tr>>>=0,wu.$a==Mt)var Qr=wu.bb;else(Qr=Error().stack.toString().split(`
`))[0]=="Error"&&Qr.shift(),Ey(Qr);for(var _n=3;Qr[_n]&&Iu()!=Mt;)++_n;for(Mt=0;Mt<Er&&Qr[Mt+_n];++Mt)a()[tr+4*Mt>>>2>>>0]=Iu();return Mt}var zu,Gu={},Sy=()=>{if(!zu){var Mt,tr={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:vt};for(Mt in Gu)Gu[Mt]===void 0?delete tr[Mt]:tr[Mt]=Gu[Mt];var Er=[];for(Mt in tr)Er.push(`${Mt}=${tr[Mt]}`);zu=Er}return zu};function Ty(Mt,tr){if(ct)return nn(18,1,Mt,tr);Mt>>>=0,tr>>>=0;var Er=0;return Sy().forEach((Qr,_n)=>{var Po=tr+Er;for(_n=$()[Mt+4*_n>>>2>>>0]=Po,Po=0;Po<Qr.length;++Po)o()[_n++>>>0]=Qr.charCodeAt(Po);o()[_n>>>0]=0,Er+=Qr.length+1}),0}function ky(Mt,tr){if(ct)return nn(19,1,Mt,tr);Mt>>>=0,tr>>>=0;var Er=Sy();$()[Mt>>>2>>>0]=Er.length;var Qr=0;return Er.forEach(_n=>Qr+=_n.length+1),$()[tr>>>2>>>0]=Qr,0}function Oy(Mt){return ct?nn(20,1,Mt):52}function Iy(Mt,tr,Er,Qr){return ct?nn(21,1,Mt,tr,Er,Qr):52}function Ay(Mt,tr,Er,Qr){return ct?nn(22,1,Mt,tr,Er,Qr):70}var m1=[null,[],[]];function Py(Mt,tr,Er,Qr){if(ct)return nn(23,1,Mt,tr,Er,Qr);tr>>>=0,Er>>>=0,Qr>>>=0;for(var _n=0,Po=0;Po<Er;Po++){var qs=$()[tr>>>2>>>0],xa=$()[tr+4>>>2>>>0];tr+=8;for(var tu=0;tu<xa;tu++){var ru=s()[qs+tu>>>0],nu=m1[Mt];ru===0||ru===10?((Mt===1?Ft:Jt)(uu(nu,0)),nu.length=0):nu.push(ru)}_n+=xa}return $()[Qr>>>2>>>0]=_n,0}var Ry=[31,29,31,30,31,30,31,31,30,31,30,31],Dy=[31,28,31,30,31,30,31,31,30,31,30,31],g1=(Mt,tr)=>{o().set(Mt,tr>>>0)};function Cy(Mt,tr,Er,Qr){function _n(Oo,_a,$a){for(Oo=typeof Oo=="number"?Oo.toString():Oo||"";Oo.length<_a;)Oo=$a[0]+Oo;return Oo}function Po(Oo,_a){return _n(Oo,_a,"0")}function qs(Oo,_a){function $a(zy){return 0>zy?-1:0<zy?1:0}var fu;return(fu=$a(Oo.getFullYear()-_a.getFullYear()))===0&&(fu=$a(Oo.getMonth()-_a.getMonth()))===0&&(fu=$a(Oo.getDate()-_a.getDate())),fu}function xa(Oo){switch(Oo.getDay()){case 0:return new Date(Oo.getFullYear()-1,11,29);case 1:return Oo;case 2:return new Date(Oo.getFullYear(),0,3);case 3:return new Date(Oo.getFullYear(),0,2);case 4:return new Date(Oo.getFullYear(),0,1);case 5:return new Date(Oo.getFullYear()-1,11,31);case 6:return new Date(Oo.getFullYear()-1,11,30)}}function tu(Oo){var _a=Oo.Sa;for(Oo=new Date(new Date(Oo.Ta+1900,0,1).getTime());0<_a;){var $a=Oo.getMonth(),fu=(pu(Oo.getFullYear())?Ry:Dy)[$a];if(!(_a>fu-Oo.getDate())){Oo.setDate(Oo.getDate()+_a);break}_a-=fu-Oo.getDate()+1,Oo.setDate(1),11>$a?Oo.setMonth($a+1):(Oo.setMonth(0),Oo.setFullYear(Oo.getFullYear()+1))}return $a=new Date(Oo.getFullYear()+1,0,4),_a=xa(new Date(Oo.getFullYear(),0,4)),$a=xa($a),0>=qs(_a,Oo)?0>=qs($a,Oo)?Oo.getFullYear()+1:Oo.getFullYear():Oo.getFullYear()-1}Mt>>>=0,tr>>>=0,Er>>>=0,Qr>>>=0;var ru=$()[Qr+40>>>2>>>0];for(var nu in Qr={gb:a()[Qr>>>2>>>0],fb:a()[Qr+4>>>2>>>0],Va:a()[Qr+8>>>2>>>0],Ya:a()[Qr+12>>>2>>>0],Wa:a()[Qr+16>>>2>>>0],Ta:a()[Qr+20>>>2>>>0],Qa:a()[Qr+24>>>2>>>0],Sa:a()[Qr+28>>>2>>>0],ob:a()[Qr+32>>>2>>>0],eb:a()[Qr+36>>>2>>>0],hb:ru?_u(ru):""},Er=_u(Er),ru={"%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"})Er=Er.replace(new RegExp(nu,"g"),ru[nu]);var By="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Uy="January February March April May June July August September October November December".split(" ");for(nu in ru={"%a":Oo=>By[Oo.Qa].substring(0,3),"%A":Oo=>By[Oo.Qa],"%b":Oo=>Uy[Oo.Wa].substring(0,3),"%B":Oo=>Uy[Oo.Wa],"%C":Oo=>Po((Oo.Ta+1900)/100|0,2),"%d":Oo=>Po(Oo.Ya,2),"%e":Oo=>_n(Oo.Ya,2," "),"%g":Oo=>tu(Oo).toString().substring(2),"%G":tu,"%H":Oo=>Po(Oo.Va,2),"%I":Oo=>((Oo=Oo.Va)==0?Oo=12:12<Oo&&(Oo-=12),Po(Oo,2)),"%j":Oo=>{for(var _a=0,$a=0;$a<=Oo.Wa-1;_a+=(pu(Oo.Ta+1900)?Ry:Dy)[$a++]);return Po(Oo.Ya+_a,3)},"%m":Oo=>Po(Oo.Wa+1,2),"%M":Oo=>Po(Oo.fb,2),"%n":()=>`
`,"%p":Oo=>0<=Oo.Va&&12>Oo.Va?"AM":"PM","%S":Oo=>Po(Oo.gb,2),"%t":()=>" ","%u":Oo=>Oo.Qa||7,"%U":Oo=>Po(Math.floor((Oo.Sa+7-Oo.Qa)/7),2),"%V":Oo=>{var _a=Math.floor((Oo.Sa+7-(Oo.Qa+6)%7)/7);if(2>=(Oo.Qa+371-Oo.Sa-2)%7&&_a++,_a)_a==53&&(($a=(Oo.Qa+371-Oo.Sa)%7)==4||$a==3&&pu(Oo.Ta)||(_a=1));else{_a=52;var $a=(Oo.Qa+7-Oo.Sa-1)%7;($a==4||$a==5&&pu(Oo.Ta%400-1))&&_a++}return Po(_a,2)},"%w":Oo=>Oo.Qa,"%W":Oo=>Po(Math.floor((Oo.Sa+7-(Oo.Qa+6)%7)/7),2),"%y":Oo=>(Oo.Ta+1900).toString().substring(2),"%Y":Oo=>Oo.Ta+1900,"%z":Oo=>{var _a=0<=(Oo=Oo.eb);return Oo=Math.abs(Oo)/60,(_a?"+":"-")+("0000"+(Oo/60*100+Oo%60)).slice(-4)},"%Z":Oo=>Oo.hb,"%%":()=>"%"},Er=Er.replace(/%%/g,"\0\0"),ru)Er.includes(nu)&&(Er=Er.replace(new RegExp(nu,"g"),ru[nu](Qr)));return nu=function(Oo){var _a=Array(sy(Oo)+1);return ay(Oo,_a,0,_a.length),_a}(Er=Er.replace(/\0\0/g,"%")),nu.length>tr?0:(g1(nu,Mt),nu.length-1)}function y1(Mt,tr,Er,Qr){return Cy(Mt>>>0,tr>>>0,Er>>>0,Qr>>>0)}ct||function(){for(var Mt=lt.numThreads-1;Mt--;)Jo();Dr.unshift(()=>{On++,function(tr){ct?tr():Promise.all(Ao.map(Lo)).then(tr)}(()=>Yo())})}();var _1=[Kr,Io,Tu,iy,oy,ly,uy,cy,dy,fy,py,hy,my,gy,yy,_y,wy,xy,Ty,ky,Oy,Iy,Ay,Py],Zs=function(){function Mt(Er,Qr){return Zs=Er.exports,Zs=function(){var _n=Zs,Po=xa=>()=>xa()>>>0,qs=xa=>tu=>xa(tu)>>>0;return(_n=Object.assign({},_n)).Ba=Po(_n.Ba),_n.Ca=qs(_n.Ca),_n.emscripten_main_runtime_thread_id=Po(_n.emscripten_main_runtime_thread_id),_n.Oa=qs(_n.Oa),_n.Pa=Po(_n.Pa),_n}(),So.push(Zs.Ea),Xs=Zs.Fa,Zr.unshift(Zs.$),Wt=Qr,Yo(),Zs}var tr=Dt();if(On++,lt.instantiateWasm)try{return lt.instantiateWasm(tr,Mt)}catch(Er){Jt(`Module.instantiateWasm callback failed with error: ${Er}`),at(Er)}return Ko||=lt.locateFile?Zo("ort-wasm-simd-threaded.wasm")?"ort-wasm-simd-threaded.wasm":lt.locateFile?lt.locateFile("ort-wasm-simd-threaded.wasm",$t):$t+"ort-wasm-simd-threaded.wasm":new URL("/appstore_panel/dist/assets/ort-wasm-simd-threaded.wasm",import.meta.url).href,function(Er,Qr){var _n=Ko;return Pt||typeof WebAssembly.instantiateStreaming!="function"||Zo(_n)||Fo(_n)||typeof fetch!="function"?Ks(_n,Er,Qr):fetch(_n,{credentials:"same-origin"}).then(Po=>WebAssembly.instantiateStreaming(Po,Er).then(Qr,function(qs){return Jt(`wasm streaming compile failed: ${qs}`),Jt("falling back to ArrayBuffer instantiation"),Ks(_n,Er,Qr)}))}(tr,function(Er){Mt(Er.instance,Er.module)}).catch(at),{}}();lt._OrtInit=(Mt,tr)=>(lt._OrtInit=Zs.aa)(Mt,tr),lt._OrtGetLastError=(Mt,tr)=>(lt._OrtGetLastError=Zs.ba)(Mt,tr),lt._OrtCreateSessionOptions=(Mt,tr,Er,Qr,_n,Po,qs,xa,tu,ru)=>(lt._OrtCreateSessionOptions=Zs.ca)(Mt,tr,Er,Qr,_n,Po,qs,xa,tu,ru),lt._OrtAppendExecutionProvider=(Mt,tr)=>(lt._OrtAppendExecutionProvider=Zs.da)(Mt,tr),lt._OrtAddFreeDimensionOverride=(Mt,tr,Er)=>(lt._OrtAddFreeDimensionOverride=Zs.ea)(Mt,tr,Er),lt._OrtAddSessionConfigEntry=(Mt,tr,Er)=>(lt._OrtAddSessionConfigEntry=Zs.fa)(Mt,tr,Er),lt._OrtReleaseSessionOptions=Mt=>(lt._OrtReleaseSessionOptions=Zs.ga)(Mt),lt._OrtCreateSession=(Mt,tr,Er)=>(lt._OrtCreateSession=Zs.ha)(Mt,tr,Er),lt._OrtReleaseSession=Mt=>(lt._OrtReleaseSession=Zs.ia)(Mt),lt._OrtGetInputOutputCount=(Mt,tr,Er)=>(lt._OrtGetInputOutputCount=Zs.ja)(Mt,tr,Er),lt._OrtGetInputName=(Mt,tr)=>(lt._OrtGetInputName=Zs.ka)(Mt,tr),lt._OrtGetOutputName=(Mt,tr)=>(lt._OrtGetOutputName=Zs.la)(Mt,tr),lt._OrtFree=Mt=>(lt._OrtFree=Zs.ma)(Mt),lt._OrtCreateTensor=(Mt,tr,Er,Qr,_n,Po)=>(lt._OrtCreateTensor=Zs.na)(Mt,tr,Er,Qr,_n,Po),lt._OrtGetTensorData=(Mt,tr,Er,Qr,_n)=>(lt._OrtGetTensorData=Zs.oa)(Mt,tr,Er,Qr,_n),lt._OrtReleaseTensor=Mt=>(lt._OrtReleaseTensor=Zs.pa)(Mt),lt._OrtCreateRunOptions=(Mt,tr,Er,Qr)=>(lt._OrtCreateRunOptions=Zs.qa)(Mt,tr,Er,Qr),lt._OrtAddRunConfigEntry=(Mt,tr,Er)=>(lt._OrtAddRunConfigEntry=Zs.ra)(Mt,tr,Er),lt._OrtReleaseRunOptions=Mt=>(lt._OrtReleaseRunOptions=Zs.sa)(Mt),lt._OrtCreateBinding=Mt=>(lt._OrtCreateBinding=Zs.ta)(Mt),lt._OrtBindInput=(Mt,tr,Er)=>(lt._OrtBindInput=Zs.ua)(Mt,tr,Er),lt._OrtBindOutput=(Mt,tr,Er,Qr)=>(lt._OrtBindOutput=Zs.va)(Mt,tr,Er,Qr),lt._OrtClearBoundOutputs=Mt=>(lt._OrtClearBoundOutputs=Zs.wa)(Mt),lt._OrtReleaseBinding=Mt=>(lt._OrtReleaseBinding=Zs.xa)(Mt),lt._OrtRunWithBinding=(Mt,tr,Er,Qr,_n)=>(lt._OrtRunWithBinding=Zs.ya)(Mt,tr,Er,Qr,_n),lt._OrtRun=(Mt,tr,Er,Qr,_n,Po,qs,xa)=>(lt._OrtRun=Zs.za)(Mt,tr,Er,Qr,_n,Po,qs,xa),lt._OrtEndProfiling=Mt=>(lt._OrtEndProfiling=Zs.Aa)(Mt);var hu=()=>(hu=Zs.Ba)();lt._malloc=Mt=>(lt._malloc=Zs.Ca)(Mt),lt._free=Mt=>(lt._free=Zs.Da)(Mt);var Au,_d=(Mt,tr,Er,Qr,_n,Po)=>(_d=Zs.Ga)(Mt,tr,Er,Qr,_n,Po),Ny=()=>(Ny=Zs.Ha)(),My=(Mt,tr,Er,Qr,_n)=>(My=Zs.Ia)(Mt,tr,Er,Qr,_n),Om=Mt=>(Om=Zs.Ja)(Mt),Pu=Mt=>(Pu=Zs.Ka)(Mt),jy=()=>(jy=Zs.La)(),Ly=(Mt,tr)=>(Ly=Zs.Ma)(Mt,tr),Ru=Mt=>(Ru=Zs.Na)(Mt),ey=Mt=>(ey=Zs.Oa)(Mt),ty=()=>(ty=Zs.Pa)();function Fy(){0<On||(ct?(nt(lt),ct||na(Zr),startWorker(lt)):(na(Dr),0<On||Au||(Au=!0,lt.calledRun=!0,ko||(ct||na(Zr),nt(lt),ct||na(rn)))))}return lt.___start_em_js=837640,lt.___stop_em_js=837701,lt.stackSave=()=>ty(),lt.stackRestore=Mt=>Ru(Mt),lt.stackAlloc=Mt=>ey(Mt),lt.UTF8ToString=_u,lt.stringToUTF8=bu,lt.lengthBytesUTF8=sy,zo=function Mt(){Au||Fy(),Au||(zo=Mt)},Fy(),et}),Og=Mp,globalThis.self?.name==="em-pthread"&&Mp()}),br,Sg,Ag,Pg,zp,Wp,Eg,Hp,Vr=O(()=>{oo(),br=import.meta.url??(typeof document<"u"?document.currentScript?.src:typeof self<"u"?self.location?.href:void 0),Sg=typeof location>"u"?void 0:location.origin,Ag=(e,o)=>{try{let s=o??br;return(s?new URL(e,s):new URL(e)).origin===Sg}catch{return!1}},Pg=async e=>{let o=await(await fetch(e,{credentials:"same-origin"})).blob();return URL.createObjectURL(o)},zp=(Gp(),sn(Rp)).default,Wp=async()=>{if(!br)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(Ag(br))return[void 0,zp()];let e=await Pg(br);return[e,zp(e)]},Eg=(Vp(),sn(Up)).default,Hp=async(e,o,s)=>[void 0,Eg]}),Xi,Ki,ho,qp,Dg,Lg,io,xt,Ke=O(()=>{Vr(),Ki=!1,ho=!1,qp=!1,Dg=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return typeof MessageChannel<"u"&&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{return!1}},Lg=()=>{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{return!1}},io=async e=>{if(Ki)return Promise.resolve();if(ho)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(qp)throw new Error("previous call to 'initializeWebAssembly()' failed.");ho=!0;let o=e.initTimeout,s=e.numThreads;if(!Lg())throw new Error("WebAssembly SIMD is not supported in the current environment.");let a=Dg();s>1&&!a&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+s+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),e.numThreads=s=1);let $=e.wasmPaths,c=typeof $=="string"?$:void 0,nt=$?.mjs,at=nt?.href??nt,lt=$?.wasm,et=lt?.href??lt,it=e.wasmBinary,[st,ct]=await Hp(at,c,s>1),ft=!1,pt=[];if(o>0&&pt.push(new Promise(gt=>{setTimeout(()=>{ft=!0,gt()},o)})),pt.push(new Promise((gt,wt)=>{let vt={numThreads:s};it?vt.wasmBinary=it:(et||c)&&(vt.locateFile=(_t,$t)=>et??(c??$t)+_t),ct(vt).then(_t=>{ho=!1,Ki=!0,Xi=_t,gt(),st&&URL.revokeObjectURL(st)},_t=>{ho=!1,qp=!0,wt(_t)})})),await Promise.race(pt),ft)throw new Error(`WebAssembly backend initializing failed due to timeout: ${o}ms`)},xt=()=>{if(Ki&&Xi)return Xi;throw new Error("WebAssembly is not initialized yet.")}}),Tt,Wr,ht,mo=O(()=>{Ke(),Tt=(e,o)=>{let s=xt(),a=s.lengthBytesUTF8(e)+1,$=s._malloc(a);return s.stringToUTF8(e,$,a),o.push($),$},Wr=(e,o,s,a)=>{if(typeof e=="object"&&e!==null){if(s.has(e))throw new Error("Circular reference in options");s.add(e)}Object.entries(e).forEach(([$,c])=>{let nt=o?o+$:$;if(typeof c=="object")Wr(c,nt+".",s,a);else if(typeof c=="string"||typeof c=="number")a(nt,c.toString());else if(typeof c=="boolean")a(nt,c?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof c}`)})},ht=e=>{let o=xt(),s=o.stackSave();try{let a=o.stackAlloc(8);o._OrtGetLastError(a,a+4);let $=o.HEAP32[a/4],c=o.HEAPU32[a/4+1],nt=c?o.UTF8ToString(c):"";throw new Error(`${e} ERROR_CODE: ${$}, ERROR_MESSAGE: ${nt}`)}finally{o.stackRestore(s)}}}),jp,Xp=O(()=>{Ke(),mo(),jp=e=>{let o=xt(),s=0,a=[],$=e||{};try{if(e?.logSeverityLevel===void 0)$.logSeverityLevel=2;else if(typeof e.logSeverityLevel!="number"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)$.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!="number"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&($.terminate=!1);let c=0;return e?.tag!==void 0&&(c=Tt(e.tag,a)),s=o._OrtCreateRunOptions($.logSeverityLevel,$.logVerbosityLevel,!!$.terminate,c),s===0&&ht("Can't create run options."),e?.extra!==void 0&&Wr(e.extra,"",new WeakSet,(nt,at)=>{let lt=Tt(nt,a),et=Tt(at,a);o._OrtAddRunConfigEntry(s,lt,et)!==0&&ht(`Can't set a run config entry: ${nt} - ${at}.`)}),[s,a]}catch(c){throw s!==0&&o._OrtReleaseRunOptions(s),a.forEach(nt=>o._free(nt)),c}}}),$g,kg,Bg,Fg,Kp,Jp=O(()=>{Ke(),mo(),$g=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}`)}},kg=e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},Bg=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let o=e.extra.session;o.use_ort_model_bytes_directly||(o.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some(s=>(typeof s=="string"?s:s.name)==="webgpu")&&(e.enableMemPattern=!1)},Fg=(e,o,s)=>{for(let a of o){let $=typeof a=="string"?a:a.name;switch($){case"webnn":if($="WEBNN",typeof a!="string"){let nt=a?.deviceType;if(nt){let at=Tt("deviceType",s),lt=Tt(nt,s);xt()._OrtAddSessionConfigEntry(e,at,lt)!==0&&ht(`Can't set a session config entry: 'deviceType' - ${nt}.`)}}break;case"webgpu":if($="JS",typeof a!="string"){let nt=a;if(nt?.preferredLayout){if(nt.preferredLayout!=="NCHW"&&nt.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${nt.preferredLayout}`);let at=Tt("preferredLayout",s),lt=Tt(nt.preferredLayout,s);xt()._OrtAddSessionConfigEntry(e,at,lt)!==0&&ht(`Can't set a session config entry: 'preferredLayout' - ${nt.preferredLayout}.`)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${$}`)}let c=Tt($,s);xt()._OrtAppendExecutionProvider(e,c)!==0&&ht(`Can't append execution provider: ${$}.`)}},Kp=e=>{let o=xt(),s=0,a=[],$=e||{};Bg($);try{let c=$g($.graphOptimizationLevel??"all"),nt=kg($.executionMode??"sequential"),at=typeof $.logId=="string"?Tt($.logId,a):0,lt=$.logSeverityLevel??2;if(!Number.isInteger(lt)||lt<0||lt>4)throw new Error(`log serverity level is not valid: ${lt}`);let et=$.logVerbosityLevel??0;if(!Number.isInteger(et)||et<0||et>4)throw new Error(`log verbosity level is not valid: ${et}`);let it=typeof $.optimizedModelFilePath=="string"?Tt($.optimizedModelFilePath,a):0;if(s=o._OrtCreateSessionOptions(c,!!$.enableCpuMemArena,!!$.enableMemPattern,nt,!!$.enableProfiling,0,at,lt,et,it),s===0&&ht("Can't create session options."),$.executionProviders&&Fg(s,$.executionProviders,a),$.enableGraphCapture!==void 0){if(typeof $.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${$.enableGraphCapture}`);let st=Tt("enableGraphCapture",a),ct=Tt($.enableGraphCapture.toString(),a);o._OrtAddSessionConfigEntry(s,st,ct)!==0&&ht(`Can't set a session config entry: 'enableGraphCapture' - ${$.enableGraphCapture}.`)}if($.freeDimensionOverrides)for(let[st,ct]of Object.entries($.freeDimensionOverrides)){if(typeof st!="string")throw new Error(`free dimension override name must be a string: ${st}`);if(typeof ct!="number"||!Number.isInteger(ct)||ct<0)throw new Error(`free dimension override value must be a non-negative integer: ${ct}`);let ft=Tt(st,a);o._OrtAddFreeDimensionOverride(s,ft,ct)!==0&&ht(`Can't set a free dimension override: ${st} - ${ct}.`)}return $.extra!==void 0&&Wr($.extra,"",new WeakSet,(st,ct)=>{let ft=Tt(st,a),pt=Tt(ct,a);o._OrtAddSessionConfigEntry(s,ft,pt)!==0&&ht(`Can't set a session config entry: ${st} - ${ct}.`)}),[s,a]}catch(c){throw s!==0&&o._OrtReleaseSessionOptions(s),a.forEach(nt=>o._free(nt)),c}}}),Hr,Yp,qr,Zp,Qp,bo,go,td,Ji=O(()=>{Hr=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"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${e}`)}},Yp=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 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${e}`)}},qr=(e,o)=>{let s=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],a=typeof o=="number"?o:o.reduce(($,c)=>$*c,1);return s>0?Math.ceil(a*s):void 0},Zp=e=>{switch(e){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},Qp=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}`)}},bo=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",go=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint64"||e==="int8"||e==="uint8"||e==="bool",td=e=>{switch(e){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${e}`)}}}),jr,Yi=O(()=>{oo(),jr=async e=>{if(typeof e=="string"){let o=await fetch(e);if(!o.ok)throw new Error(`failed to load external data file: ${e}`);let s=o.headers.get("Content-Length"),a=s?parseInt(s,10):0;if(a<1073741824)return new Uint8Array(await o.arrayBuffer());{if(!o.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let $=o.body.getReader(),c;try{c=new ArrayBuffer(a)}catch(at){if(at instanceof RangeError){let lt=Math.ceil(a/65536);c=new WebAssembly.Memory({initial:lt,maximum:lt}).buffer}else throw at}let nt=0;for(;;){let{done:at,value:lt}=await $.read();if(at)break;let et=lt.byteLength;new Uint8Array(c,nt,et).set(lt),nt+=et}return new Uint8Array(c,0,a)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),Cg,ao,so,yr,Ng,zr,uo,lo,ed,fo,co,po,qi=O(()=>{Xp(),Jp(),Ji(),Ke(),mo(),Yi(),Cg=(e,o)=>{xt()._OrtInit(e,o)!==0&&ht("Can't initialize onnxruntime.")},ao=async e=>{Cg(e.wasm.numThreads,Qp(e.logLevel))},so=async(e,o)=>{},yr=new Map,Ng=e=>{let o=xt(),s=o.stackSave();try{let a=o.stackAlloc(8);return o._OrtGetInputOutputCount(e,a,a+4)!==0&&ht("Can't get session input/output count."),[o.HEAP32[a/4],o.HEAP32[a/4+1]]}finally{o.stackRestore(s)}},zr=e=>{let o=xt(),s=o._malloc(e.byteLength);if(s===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return o.HEAPU8.set(e,s),[s,e.byteLength]},uo=async(e,o)=>{let s,a,$=xt();Array.isArray(e)?[s,a]=e:e.buffer===$.HEAPU8.buffer?[s,a]=[e.byteOffset,e.byteLength]:[s,a]=zr(e);let c=0,nt=0,at=[],lt=[],et=[];try{if([nt,at]=Kp(o),o?.externalData&&$.mountExternalData){let vt=[];for(let _t of o.externalData){let $t=typeof _t=="string"?_t:_t.path;vt.push(jr(typeof _t=="string"?_t:_t.data).then(Pt=>{$.mountExternalData($t,Pt)}))}await Promise.all(vt)}for(let vt of o?.executionProviders??[])if((typeof vt=="string"?vt:vt.name)==="webnn"){if($.shouldTransferToMLTensor=!1,$.currentContext)throw new Error("WebNN execution provider is already set.");if(typeof vt!="string"){let _t=vt,$t=_t?.context,Pt=_t?.gpuDevice,Nt=_t?.deviceType,Lt=_t?.numThreads,Ft=_t?.powerPreference;$t?$.currentContext=$t:Pt?$.currentContext=await navigator.ml.createContext(Pt):$.currentContext=await navigator.ml.createContext({deviceType:Nt,numThreads:Lt,powerPreference:Ft})}else $.currentContext=await navigator.ml.createContext();break}c=await $._OrtCreateSession(s,a,nt),c===0&&ht("Can't create a session."),$.currentContext&&($.jsepRegisterMLContext(c,$.currentContext),$.currentContext=void 0,$.shouldTransferToMLTensor=!0);let[it,st]=Ng(c),ct=!!o?.enableGraphCapture,ft=[],pt=[],gt=[];for(let vt=0;vt<it;vt++){let _t=$._OrtGetInputName(c,vt);_t===0&&ht("Can't get an input name."),lt.push(_t),ft.push($.UTF8ToString(_t))}for(let vt=0;vt<st;vt++){let _t=$._OrtGetOutputName(c,vt);_t===0&&ht("Can't get an output name."),et.push(_t);let $t=$.UTF8ToString(_t);pt.push($t)}return yr.set(c,[c,lt,et,null,ct,!1]),[c,ft,pt]}catch(it){throw lt.forEach(st=>$._OrtFree(st)),et.forEach(st=>$._OrtFree(st)),c!==0&&$._OrtReleaseSession(c),it}finally{$._free(s),nt!==0&&$._OrtReleaseSessionOptions(nt),at.forEach(it=>$._free(it)),$.unmountExternalData?.()}},lo=e=>{let o=xt(),s=yr.get(e);if(!s)throw new Error(`cannot release session. invalid session id: ${e}`);let[a,$,c,nt,at]=s;nt&&(at&&o._OrtClearBoundOutputs(nt.handle),o._OrtReleaseBinding(nt.handle)),o.jsepOnReleaseSession?.(e),$.forEach(lt=>o._OrtFree(lt)),c.forEach(lt=>o._OrtFree(lt)),o._OrtReleaseSession(a),yr.delete(e)},ed=(e,o,s,a,$,c=!1)=>{if(!e){o.push(0);return}let nt=xt(),at=e[0],lt=e[1],et=e[3],it,st;if(at==="string"&&(et==="gpu-buffer"||et==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(c&&et!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${$} when enableGraphCapture is true.`);if(et==="gpu-buffer"){let pt=e[2].gpuBuffer;st=qr(Hr(at),lt);let gt=nt.jsepRegisterBuffer;if(!gt)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');it=gt(a,$,pt,st)}else if(et==="ml-tensor"){let pt=e[2].mlTensor;st=qr(Hr(at),lt);let gt=nt.jsepRegisterMLTensor;if(!gt)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');it=gt(pt,Hr(at),lt)}else{let pt=e[2];if(Array.isArray(pt)){st=4*pt.length,it=nt._malloc(st),s.push(it);let gt=it/4;for(let wt=0;wt<pt.length;wt++){if(typeof pt[wt]!="string")throw new TypeError(`tensor data at index ${wt} is not a string`);nt.HEAPU32[gt++]=Tt(pt[wt],s)}}else st=pt.byteLength,it=nt._malloc(st),s.push(it),nt.HEAPU8.set(new Uint8Array(pt.buffer,pt.byteOffset,st),it)}let ct=nt.stackSave(),ft=nt.stackAlloc(4*lt.length);try{let pt=ft/4;lt.forEach(wt=>nt.HEAP32[pt++]=wt);let gt=nt._OrtCreateTensor(Hr(at),it,st,ft,lt.length,td(et));gt===0&&ht(`Can't create tensor for input/output. session=${a}, index=${$}.`),o.push(gt)}finally{nt.stackRestore(ct)}},fo=async(e,o,s,a,$,c)=>{let nt=xt(),at=yr.get(e);if(!at)throw new Error(`cannot run inference. invalid session id: ${e}`);let lt=at[0],et=at[1],it=at[2],st=at[3],ct=at[4];at[5];let ft=o.length,pt=a.length,gt=0,wt=[],vt=[],_t=[],$t=[],Pt=nt.stackSave(),Nt=nt.stackAlloc(ft*4),Lt=nt.stackAlloc(ft*4),Ft=nt.stackAlloc(pt*4),Jt=nt.stackAlloc(pt*4);try{nt.jsepOnRunStart?.(lt),[gt,wt]=jp(c);for(let gr=0;gr<ft;gr++)ed(s[gr],vt,$t,e,o[gr],ct);for(let gr=0;gr<pt;gr++)ed($[gr],_t,$t,e,ft+a[gr],ct);let _r=Nt/4,wr=Lt/4,tn=Ft/4,Wt=Jt/4;for(let gr=0;gr<ft;gr++)nt.HEAPU32[_r++]=vt[gr],nt.HEAPU32[wr++]=et[o[gr]];for(let gr=0;gr<pt;gr++)nt.HEAPU32[tn++]=_t[gr],nt.HEAPU32[Wt++]=it[a[gr]];let Yr;Yr=await nt._OrtRun(lt,Lt,Nt,ft,Jt,pt,Ft,gt),Yr!==0&&ht("failed to call OrtRun().");let Ot=[];for(let gr=0;gr<pt;gr++){let $o=nt.HEAPU32[Ft/4+gr];if($o===_t[gr]){Ot.push($[gr]);continue}let In=nt.stackSave(),en=nt.stackAlloc(4*4),Lr=!1,ko,Ir=0;try{nt._OrtGetTensorData($o,en,en+4,en+8,en+12)!==0&&ht(`Can't access output tensor data on index ${gr}.`);let Dr=en/4,Zr=nt.HEAPU32[Dr++];Ir=nt.HEAPU32[Dr++];let rn=nt.HEAPU32[Dr++],On=nt.HEAPU32[Dr++],zo=[];for(let Ko=0;Ko<On;Ko++)zo.push(nt.HEAPU32[rn/4+Ko]);nt._OrtFree(rn);let Yo=zo.reduce((Ko,Zo)=>Ko*Zo,1);ko=Yp(Zr);let jo=st?.outputPreferredLocations[a[gr]];if(ko==="string"){if(jo==="gpu-buffer"||jo==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let Ko=[],Zo=Ir/4;for(let Fo=0;Fo<Yo;Fo++){let Js=nt.HEAPU32[Zo++],Ks=Fo===Yo-1?void 0:nt.HEAPU32[Zo]-Js;Ko.push(nt.UTF8ToString(Js,Ks))}Ot.push([ko,zo,Ko,"cpu"])}else if(jo==="gpu-buffer"&&Yo>0){let Ko=nt.jsepGetBuffer;if(!Ko)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let Zo=Ko(Ir),Fo=qr(Zr,Yo);if(Fo===void 0||!bo(ko))throw new Error(`Unsupported data type: ${ko}`);Lr=!0,Ot.push([ko,zo,{gpuBuffer:Zo,download:nt.jsepCreateDownloader(Zo,Fo,ko),dispose:()=>{nt._OrtReleaseTensor($o)}},"gpu-buffer"])}else if(jo==="ml-tensor"&&Yo>0){let Ko=nt.jsepEnsureTensor;if(!Ko)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(qr(Zr,Yo)===void 0||!go(ko))throw new Error(`Unsupported data type: ${ko}`);let Zo=await Ko(Ir,Zr,zo,!1);Lr=!0,Ot.push([ko,zo,{mlTensor:Zo,download:nt.jsepCreateMLTensorDownloader(Ir,ko),dispose:()=>{nt.jsepReleaseTensorId(Ir),nt._OrtReleaseTensor($o)}},"ml-tensor"])}else{let Ko=Zp(ko),Zo=new Ko(Yo);new Uint8Array(Zo.buffer,Zo.byteOffset,Zo.byteLength).set(nt.HEAPU8.subarray(Ir,Ir+Zo.byteLength)),Ot.push([ko,zo,Zo,"cpu"])}}finally{nt.stackRestore(In),ko==="string"&&Ir&&nt._free(Ir),Lr||nt._OrtReleaseTensor($o)}}return st&&!ct&&(nt._OrtClearBoundOutputs(st.handle),yr.set(e,[lt,et,it,st,ct,!1])),Ot}finally{nt.stackRestore(Pt),vt.forEach(_r=>nt._OrtReleaseTensor(_r)),_t.forEach(_r=>nt._OrtReleaseTensor(_r)),$t.forEach(_r=>nt._free(_r)),gt!==0&&nt._OrtReleaseRunOptions(gt),wt.forEach(_r=>nt._free(_r))}},co=e=>{let o=xt(),s=yr.get(e);if(!s)throw new Error("invalid session id");let a=s[0],$=o._OrtEndProfiling(a);$===0&&ht("Can't get an profile file name."),o._OrtFree($)},po=e=>{let o=[];for(let s of e){let a=s[2];!Array.isArray(a)&&"buffer"in a&&o.push(a.buffer)}return o}}),Je,Kt,Xr,xo,To,yo,Zi,Qi,xr,Tr,Gg,rd,nd,od,id,ad,sd,ud,ta=O(()=>{Yt(),qi(),Ke(),Vr(),Je=()=>!!z.wasm.proxy&&typeof document<"u",Xr=!1,xo=!1,To=!1,Qi=new Map,xr=(e,o)=>{let s=Qi.get(e);s?s.push(o):Qi.set(e,[o])},Tr=()=>{if(Xr||!xo||To||!Kt)throw new Error("worker not ready")},Gg=e=>{switch(e.data.type){case"init-wasm":Xr=!1,e.data.err?(To=!0,Zi[1](e.data.err)):(xo=!0,Zi[0]()),yo&&(URL.revokeObjectURL(yo),yo=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let o=Qi.get(e.data.type);e.data.err?o.shift()[1](e.data.err):o.shift()[0](e.data.out);break}}},rd=async()=>{if(!xo){if(Xr)throw new Error("multiple calls to 'initWasm()' detected.");if(To)throw new Error("previous call to 'initWasm()' failed.");if(Xr=!0,Je())return new Promise((e,o)=>{Kt?.terminate(),Wp().then(([s,a])=>{try{Kt=a,Kt.onerror=c=>o(c),Kt.onmessage=Gg,Zi=[e,o];let $={type:"init-wasm",in:z};Kt.postMessage($),yo=s}catch($){o($)}},o)});try{await io(z.wasm),await ao(z),xo=!0}catch(e){throw To=!0,e}finally{Xr=!1}}},nd=async e=>{if(Je())return Tr(),new Promise((o,s)=>{xr("init-ep",[o,s]);let a={type:"init-ep",in:{epName:e,env:z}};Kt.postMessage(a)});await so(z,e)},od=async e=>Je()?(Tr(),new Promise((o,s)=>{xr("copy-from",[o,s]);let a={type:"copy-from",in:{buffer:e}};Kt.postMessage(a,[e.buffer])})):zr(e),id=async(e,o)=>{if(Je()){if(o?.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return Tr(),new Promise((s,a)=>{xr("create",[s,a]);let $={type:"create",in:{model:e,options:{...o}}},c=[];e instanceof Uint8Array&&c.push(e.buffer),Kt.postMessage($,c)})}else return uo(e,o)},ad=async e=>{if(Je())return Tr(),new Promise((o,s)=>{xr("release",[o,s]);let a={type:"release",in:e};Kt.postMessage(a)});lo(e)},sd=async(e,o,s,a,$,c)=>{if(Je()){if(s.some(nt=>nt[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if($.some(nt=>nt))throw new Error("pre-allocated output tensor is not supported for proxy.");return Tr(),new Promise((nt,at)=>{xr("run",[nt,at]);let lt=s,et={type:"run",in:{sessionId:e,inputIndices:o,inputs:lt,outputIndices:a,options:c}};Kt.postMessage(et,po(lt))})}else return fo(e,o,s,a,$,c)},ud=async e=>{if(Je())return Tr(),new Promise((o,s)=>{xr("end-profiling",[o,s]);let a={type:"end-profiling",in:e};Kt.postMessage(a)});co(e)}}),ld,Mg,wo,fd=O(()=>{Yt(),ta(),Ji(),oo(),Yi(),ld=(e,o)=>{switch(e.location){case"cpu":return[e.type,e.dims,e.data,"cpu"];case"gpu-buffer":return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[e.type,e.dims,{mlTensor:e.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${e.location} for ${o()}`)}},Mg=e=>{switch(e[3]){case"cpu":return new yt(e[0],e[2],e[1]);case"gpu-buffer":{let o=e[0];if(!bo(o))throw new Error(`not supported data type: ${o} for deserializing GPU tensor`);let{gpuBuffer:s,download:a,dispose:$}=e[2];return yt.fromGpuBuffer(s,{dataType:o,dims:e[1],download:a,dispose:$})}case"ml-tensor":{let o=e[0];if(!go(o))throw new Error(`not supported data type: ${o} for deserializing MLTensor tensor`);let{mlTensor:s,download:a,dispose:$}=e[2];return yt.fromMLTensor(s,{dataType:o,dims:e[1],download:a,dispose:$})}default:throw new Error(`invalid data location: ${e[3]}`)}},wo=class{async fetchModelAndCopyToWasmMemory(e){return od(await jr(e))}async loadModel(e,o){Fe();let s;typeof e=="string"?s=await this.fetchModelAndCopyToWasmMemory(e):s=e,[this.sessionId,this.inputNames,this.outputNames]=await id(s,o),Ce()}async dispose(){return ad(this.sessionId)}async run(e,o,s){Fe();let a=[],$=[];Object.entries(e).forEach(st=>{let ct=st[0],ft=st[1],pt=this.inputNames.indexOf(ct);if(pt===-1)throw new Error(`invalid input '${ct}'`);a.push(ft),$.push(pt)});let c=[],nt=[];Object.entries(o).forEach(st=>{let ct=st[0],ft=st[1],pt=this.outputNames.indexOf(ct);if(pt===-1)throw new Error(`invalid output '${ct}'`);c.push(ft),nt.push(pt)});let at=a.map((st,ct)=>ld(st,()=>`input "${this.inputNames[$[ct]]}"`)),lt=c.map((st,ct)=>st?ld(st,()=>`output "${this.outputNames[nt[ct]]}"`):null),et=await sd(this.sessionId,$,at,nt,lt,s),it={};for(let st=0;st<et.length;st++)it[this.outputNames[nt[st]]]=c[st]??Mg(et[st]);return Ce(),it}startProfiling(){}endProfiling(){ud(this.sessionId)}}}),pd={};Or(pd,{OnnxruntimeWebAssemblyBackend:()=>vo,initializeFlags:()=>cd,wasmBackend:()=>Ug});var cd,vo,Ug,dd=O(()=>{Yt(),ta(),fd(),Vr(),cd=()=>{if((typeof z.wasm.initTimeout!="number"||z.wasm.initTimeout<0)&&(z.wasm.initTimeout=0),z.wasm.simd===!1&&console.warn('Deprecated property "env.wasm.simd" is set to false. non-SIMD build is no longer provided, and this setting will be ignored.'),typeof z.wasm.proxy!="boolean"&&(z.wasm.proxy=!1),typeof z.wasm.trace!="boolean"&&(z.wasm.trace=!1),typeof z.wasm.numThreads!="number"||!Number.isInteger(z.wasm.numThreads)||z.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)z.wasm.numThreads=1;else{let e=typeof navigator>"u"?Co("node:os").cpus().length:navigator.hardwareConcurrency;z.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},vo=class{async init(e){cd(),await rd(),await nd(e)}async createInferenceSessionHandler(e,o){let s=new wo;return await s.loadModel(e,o),Promise.resolve(s)}},Ug=new vo});Yt();Yt();Yt();var Ds="1.20.0";{let e=(Fp(),sn(Bp)).onnxjsBackend;nr("webgl",e,-10)}{let e=(dd(),sn(pd)).wasmBackend;nr("cpu",e,10),nr("wasm",e,10)}Object.defineProperty(z.versions,"web",{value:Ds,enumerable:!0});/*! Bundled license information:
long/index.js:
(**
* @license
* Copyright 2009 The Closure Library Authors
* Copyright 2020 Daniel Wirtz / The long.js Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*)
*/const modelData=({clicks:e,tensor:o,modelScale:s})=>{const a=o;let $,c,nt,at;if(e){let st=e.length;$=new Float32Array(2*(st+1)),c=new Float32Array(st+1);for(let ct=0;ct<st;ct++)$[2*ct]=e[ct].x*s.samScale,$[2*ct+1]=e[ct].y*s.samScale,c[ct]=e[ct].clickType;$[2*st]=0,$[2*st+1]=0,c[st]=-1,nt=new yt("float32",$,[1,st+1,2]),at=new yt("float32",c,[1,st+1])}const lt=new yt("float32",[s.height,s.width]);if(nt===void 0||at===void 0)return;const et=new yt("float32",new Float32Array(256*256),[1,1,256,256]),it=new yt("float32",[0]);return{image_embeddings:a,point_coords:nt,point_labels:at,orig_im_size:lt,mask_input:et,has_mask_input:it}},GlobalContext=reactExports.createContext();z.wasm.wasmPaths={"ort-wasm.wasm":"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/ort-wasm.wasm","ort-wasm-simd.wasm":"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/ort-wasm-simd.wasm","ort-wasm-threaded.wasm":"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/ort-wasm-threaded.wasm"};const MODEL_DIR=WEB_SITE+"/assets/data/sam_onnx_example.onnx",useModel=()=>reactExports.useContext(GlobalContext),GlobalProvider=({children:e})=>{const[o,s]=reactExports.useState(null);return reactExports.useEffect(()=>{(async()=>{try{if(MODEL_DIR===void 0)return;const $=MODEL_DIR,c=await Yd.create(MODEL_DIR);s(c)}catch($){console.log($)}})()},[]),jsxRuntimeExports.jsx(GlobalContext.Provider,{value:o,children:e})};var browserPonyfill={exports:{}};(function(e,o){var s=typeof self<"u"?self:commonjsGlobal,a=function(){function c(){this.fetch=!1,this.DOMException=s.DOMException}return c.prototype=s,new c}();(function(c){(function(nt){var at={searchParams:"URLSearchParams"in c,iterable:"Symbol"in c&&"iterator"in Symbol,blob:"FileReader"in c&&"Blob"in c&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in c,arrayBuffer:"ArrayBuffer"in c};function lt(Ot){return Ot&&DataView.prototype.isPrototypeOf(Ot)}if(at.arrayBuffer)var et=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],it=ArrayBuffer.isView||function(Ot){return Ot&&et.indexOf(Object.prototype.toString.call(Ot))>-1};function st(Ot){if(typeof Ot!="string"&&(Ot=String(Ot)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(Ot))throw new TypeError("Invalid character in header field name");return Ot.toLowerCase()}function ct(Ot){return typeof Ot!="string"&&(Ot=String(Ot)),Ot}function ft(Ot){var gr={next:function(){var $o=Ot.shift();return{done:$o===void 0,value:$o}}};return at.iterable&&(gr[Symbol.iterator]=function(){return gr}),gr}function pt(Ot){this.map={},Ot instanceof pt?Ot.forEach(function(gr,$o){this.append($o,gr)},this):Array.isArray(Ot)?Ot.forEach(function(gr){this.append(gr[0],gr[1])},this):Ot&&Object.getOwnPropertyNames(Ot).forEach(function(gr){this.append(gr,Ot[gr])},this)}pt.prototype.append=function(Ot,gr){Ot=st(Ot),gr=ct(gr);var $o=this.map[Ot];this.map[Ot]=$o?$o+", "+gr:gr},pt.prototype.delete=function(Ot){delete this.map[st(Ot)]},pt.prototype.get=function(Ot){return Ot=st(Ot),this.has(Ot)?this.map[Ot]:null},pt.prototype.has=function(Ot){return this.map.hasOwnProperty(st(Ot))},pt.prototype.set=function(Ot,gr){this.map[st(Ot)]=ct(gr)},pt.prototype.forEach=function(Ot,gr){for(var $o in this.map)this.map.hasOwnProperty($o)&&Ot.call(gr,this.map[$o],$o,this)},pt.prototype.keys=function(){var Ot=[];return this.forEach(function(gr,$o){Ot.push($o)}),ft(Ot)},pt.prototype.values=function(){var Ot=[];return this.forEach(function(gr){Ot.push(gr)}),ft(Ot)},pt.prototype.entries=function(){var Ot=[];return this.forEach(function(gr,$o){Ot.push([$o,gr])}),ft(Ot)},at.iterable&&(pt.prototype[Symbol.iterator]=pt.prototype.entries);function gt(Ot){if(Ot.bodyUsed)return Promise.reject(new TypeError("Already read"));Ot.bodyUsed=!0}function wt(Ot){return new Promise(function(gr,$o){Ot.onload=function(){gr(Ot.result)},Ot.onerror=function(){$o(Ot.error)}})}function vt(Ot){var gr=new FileReader,$o=wt(gr);return gr.readAsArrayBuffer(Ot),$o}function _t(Ot){var gr=new FileReader,$o=wt(gr);return gr.readAsText(Ot),$o}function $t(Ot){for(var gr=new Uint8Array(Ot),$o=new Array(gr.length),In=0;In<gr.length;In++)$o[In]=String.fromCharCode(gr[In]);return $o.join("")}function Pt(Ot){if(Ot.slice)return Ot.slice(0);var gr=new Uint8Array(Ot.byteLength);return gr.set(new Uint8Array(Ot)),gr.buffer}function Nt(){return this.bodyUsed=!1,this._initBody=function(Ot){this._bodyInit=Ot,Ot?typeof Ot=="string"?this._bodyText=Ot:at.blob&&Blob.prototype.isPrototypeOf(Ot)?this._bodyBlob=Ot:at.formData&&FormData.prototype.isPrototypeOf(Ot)?this._bodyFormData=Ot:at.searchParams&&URLSearchParams.prototype.isPrototypeOf(Ot)?this._bodyText=Ot.toString():at.arrayBuffer&&at.blob&&lt(Ot)?(this._bodyArrayBuffer=Pt(Ot.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):at.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Ot)||it(Ot))?this._bodyArrayBuffer=Pt(Ot):this._bodyText=Ot=Object.prototype.toString.call(Ot):this._bodyText="",this.headers.get("content-type")||(typeof Ot=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):at.searchParams&&URLSearchParams.prototype.isPrototypeOf(Ot)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},at.blob&&(this.blob=function(){var Ot=gt(this);if(Ot)return Ot;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?gt(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(vt)}),this.text=function(){var Ot=gt(this);if(Ot)return Ot;if(this._bodyBlob)return _t(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve($t(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},at.formData&&(this.formData=function(){return this.text().then(_r)}),this.json=function(){return this.text().then(JSON.parse)},this}var Lt=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ft(Ot){var gr=Ot.toUpperCase();return Lt.indexOf(gr)>-1?gr:Ot}function Jt(Ot,gr){gr=gr||{};var $o=gr.body;if(Ot instanceof Jt){if(Ot.bodyUsed)throw new TypeError("Already read");this.url=Ot.url,this.credentials=Ot.credentials,gr.headers||(this.headers=new pt(Ot.headers)),this.method=Ot.method,this.mode=Ot.mode,this.signal=Ot.signal,!$o&&Ot._bodyInit!=null&&($o=Ot._bodyInit,Ot.bodyUsed=!0)}else this.url=String(Ot);if(this.credentials=gr.credentials||this.credentials||"same-origin",(gr.headers||!this.headers)&&(this.headers=new pt(gr.headers)),this.method=Ft(gr.method||this.method||"GET"),this.mode=gr.mode||this.mode||null,this.signal=gr.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&$o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody($o)}Jt.prototype.clone=function(){return new Jt(this,{body:this._bodyInit})};function _r(Ot){var gr=new FormData;return Ot.trim().split("&").forEach(function($o){if($o){var In=$o.split("="),en=In.shift().replace(/\+/g," "),Lr=In.join("=").replace(/\+/g," ");gr.append(decodeURIComponent(en),decodeURIComponent(Lr))}}),gr}function wr(Ot){var gr=new pt,$o=Ot.replace(/\r?\n[\t ]+/g," ");return $o.split(/\r?\n/).forEach(function(In){var en=In.split(":"),Lr=en.shift().trim();if(Lr){var ko=en.join(":").trim();gr.append(Lr,ko)}}),gr}Nt.call(Jt.prototype);function tn(Ot,gr){gr||(gr={}),this.type="default",this.status=gr.status===void 0?200:gr.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in gr?gr.statusText:"OK",this.headers=new pt(gr.headers),this.url=gr.url||"",this._initBody(Ot)}Nt.call(tn.prototype),tn.prototype.clone=function(){return new tn(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new pt(this.headers),url:this.url})},tn.error=function(){var Ot=new tn(null,{status:0,statusText:""});return Ot.type="error",Ot};var Wt=[301,302,303,307,308];tn.redirect=function(Ot,gr){if(Wt.indexOf(gr)===-1)throw new RangeError("Invalid status code");return new tn(null,{status:gr,headers:{location:Ot}})},nt.DOMException=c.DOMException;try{new nt.DOMException}catch{nt.DOMException=function(gr,$o){this.message=gr,this.name=$o;var In=Error(gr);this.stack=In.stack},nt.DOMException.prototype=Object.create(Error.prototype),nt.DOMException.prototype.constructor=nt.DOMException}function Yr(Ot,gr){return new Promise(function($o,In){var en=new Jt(Ot,gr);if(en.signal&&en.signal.aborted)return In(new nt.DOMException("Aborted","AbortError"));var Lr=new XMLHttpRequest;function ko(){Lr.abort()}Lr.onload=function(){var Ir={status:Lr.status,statusText:Lr.statusText,headers:wr(Lr.getAllResponseHeaders()||"")};Ir.url="responseURL"in Lr?Lr.responseURL:Ir.headers.get("X-Request-URL");var Dr="response"in Lr?Lr.response:Lr.responseText;$o(new tn(Dr,Ir))},Lr.onerror=function(){In(new TypeError("Network request failed"))},Lr.ontimeout=function(){In(new TypeError("Network request failed"))},Lr.onabort=function(){In(new nt.DOMException("Aborted","AbortError"))},Lr.open(en.method,en.url,!0),en.credentials==="include"?Lr.withCredentials=!0:en.credentials==="omit"&&(Lr.withCredentials=!1),"responseType"in Lr&&at.blob&&(Lr.responseType="blob"),en.headers.forEach(function(Ir,Dr){Lr.setRequestHeader(Dr,Ir)}),en.signal&&(en.signal.addEventListener("abort",ko),Lr.onreadystatechange=function(){Lr.readyState===4&&en.signal.removeEventListener("abort",ko)}),Lr.send(typeof en._bodyInit>"u"?null:en._bodyInit)})}return Yr.polyfill=!0,c.fetch||(c.fetch=Yr,c.Headers=pt,c.Request=Jt,c.Response=tn),nt.Headers=pt,nt.Request=Jt,nt.Response=tn,nt.fetch=Yr,Object.defineProperty(nt,"__esModule",{value:!0}),nt})({})})(a),a.fetch.ponyfill=!0,delete a.fetch.polyfill;var $=a;o=$.fetch,o.default=$.fetch,o.fetch=$.fetch,o.Headers=$.Headers,o.Request=$.Request,o.Response=$.Response,e.exports=o})(browserPonyfill,browserPonyfill.exports);var browserPonyfillExports=browserPonyfill.exports;const fetch$1=getDefaultExportFromCjs(browserPonyfillExports);class npyjs{constructor(o){o&&console.error(["No arguments accepted to npyjs constructor.","For usage, go to https://github.com/jhuapl-boss/npyjs."].join(" ")),this.dtypes={"<u1":{name:"uint8",size:8,arrayConstructor:Uint8Array},"|u1":{name:"uint8",size:8,arrayConstructor:Uint8Array},"<u2":{name:"uint16",size:16,arrayConstructor:Uint16Array},"|i1":{name:"int8",size:8,arrayConstructor:Int8Array},"<i2":{name:"int16",size:16,arrayConstructor:Int16Array},"<u4":{name:"uint32",size:32,arrayConstructor:Int32Array},"<i4":{name:"int32",size:32,arrayConstructor:Int32Array},"<u8":{name:"uint64",size:64,arrayConstructor:BigUint64Array},"<i8":{name:"int64",size:64,arrayConstructor:BigInt64Array},"<f4":{name:"float32",size:32,arrayConstructor:Float32Array},"<f8":{name:"float64",size:64,arrayConstructor:Float64Array}}}parse(o){const s=new DataView(o.slice(8,10)).getUint8(0),a=10+s,$=new TextDecoder("utf-8").decode(new Uint8Array(o.slice(10,10+s))),c=JSON.parse($.toLowerCase().replace(/'/g,'"').replace("(","[").replace(/,*\),*/g,"]")),nt=c.shape,at=this.dtypes[c.descr],lt=new at.arrayConstructor(o,a);return{dtype:at.name,data:lt,shape:nt,fortranOrder:c.fortran_order}}async load(o,s,a){a=a||{};let $;o instanceof ArrayBuffer?$=o:$=await(await fetch$1(o,{...a})).arrayBuffer();const c=this.parse($);return s?s(c):c}}var VERSION="1.13.7",root$1=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},ArrayProto=Array.prototype,ObjProto=Object.prototype,SymbolProto=typeof Symbol<"u"?Symbol.prototype:null,push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,supportsArrayBuffer=typeof ArrayBuffer<"u",supportsDataView=typeof DataView<"u",nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeCreate=Object.create,nativeIsView=supportsArrayBuffer&&ArrayBuffer.isView,_isNaN=isNaN,_isFinite=isFinite,hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MAX_ARRAY_INDEX=Math.pow(2,53)-1;function restArguments(e,o){return o=o==null?e.length-1:+o,function(){for(var s=Math.max(arguments.length-o,0),a=Array(s),$=0;$<s;$++)a[$]=arguments[$+o];switch(o){case 0:return e.call(this,a);case 1:return e.call(this,arguments[0],a);case 2:return e.call(this,arguments[0],arguments[1],a)}var c=Array(o+1);for($=0;$<o;$++)c[$]=arguments[$];return c[o]=a,e.apply(this,c)}}function isObject(e){var o=typeof e;return o==="function"||o==="object"&&!!e}function isNull(e){return e===null}function isUndefined(e){return e===void 0}function isBoolean(e){return e===!0||e===!1||toString.call(e)==="[object Boolean]"}function isElement(e){return!!(e&&e.nodeType===1)}function tagTester(e){var o="[object "+e+"]";return function(s){return toString.call(s)===o}}const isString=tagTester("String"),isNumber=tagTester("Number"),isDate=tagTester("Date"),isRegExp=tagTester("RegExp"),isError=tagTester("Error"),isSymbol=tagTester("Symbol"),isArrayBuffer=tagTester("ArrayBuffer");var isFunction=tagTester("Function"),nodelist=root$1.document&&root$1.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof nodelist!="function"&&(isFunction=function(e){return typeof e=="function"||!1});const isFunction$1=isFunction,hasObjectTag=tagTester("Object");var hasDataViewBug=supportsDataView&&(!/\[native code\]/.test(String(DataView))||hasObjectTag(new DataView(new ArrayBuffer(8)))),isIE11=typeof Map<"u"&&hasObjectTag(new Map),isDataView=tagTester("DataView");function alternateIsDataView(e){return e!=null&&isFunction$1(e.getInt8)&&isArrayBuffer(e.buffer)}const isDataView$1=hasDataViewBug?alternateIsDataView:isDataView,isArray=nativeIsArray||tagTester("Array");function has$1(e,o){return e!=null&&hasOwnProperty.call(e,o)}var isArguments=tagTester("Arguments");(function(){isArguments(arguments)||(isArguments=function(e){return has$1(e,"callee")})})();const isArguments$1=isArguments;function isFinite$1(e){return!isSymbol(e)&&_isFinite(e)&&!isNaN(parseFloat(e))}function isNaN$1(e){return isNumber(e)&&_isNaN(e)}function constant(e){return function(){return e}}function createSizePropertyCheck(e){return function(o){var s=e(o);return typeof s=="number"&&s>=0&&s<=MAX_ARRAY_INDEX}}function shallowProperty(e){return function(o){return o?.[e]}}const getByteLength=shallowProperty("byteLength"),isBufferLike=createSizePropertyCheck(getByteLength);var typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function isTypedArray(e){return nativeIsView?nativeIsView(e)&&!isDataView$1(e):isBufferLike(e)&&typedArrayPattern.test(toString.call(e))}const isTypedArray$1=supportsArrayBuffer?isTypedArray:constant(!1),getLength=shallowProperty("length");function emulatedSet(e){for(var o={},s=e.length,a=0;a<s;++a)o[e[a]]=!0;return{contains:function($){return o[$]===!0},push:function($){return o[$]=!0,e.push($)}}}function collectNonEnumProps(e,o){o=emulatedSet(o);var s=nonEnumerableProps.length,a=e.constructor,$=isFunction$1(a)&&a.prototype||ObjProto,c="constructor";for(has$1(e,c)&&!o.contains(c)&&o.push(c);s--;)c=nonEnumerableProps[s],c in e&&e[c]!==$[c]&&!o.contains(c)&&o.push(c)}function keys(e){if(!isObject(e))return[];if(nativeKeys)return nativeKeys(e);var o=[];for(var s in e)has$1(e,s)&&o.push(s);return hasEnumBug&&collectNonEnumProps(e,o),o}function isEmpty(e){if(e==null)return!0;var o=getLength(e);return typeof o=="number"&&(isArray(e)||isString(e)||isArguments$1(e))?o===0:getLength(keys(e))===0}function isMatch(e,o){var s=keys(o),a=s.length;if(e==null)return!a;for(var $=Object(e),c=0;c<a;c++){var nt=s[c];if(o[nt]!==$[nt]||!(nt in $))return!1}return!0}function _$1(e){if(e instanceof _$1)return e;if(!(this instanceof _$1))return new _$1(e);this._wrapped=e}_$1.VERSION=VERSION;_$1.prototype.value=function(){return this._wrapped};_$1.prototype.valueOf=_$1.prototype.toJSON=_$1.prototype.value;_$1.prototype.toString=function(){return String(this._wrapped)};function toBufferView(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,getByteLength(e))}var tagDataView="[object DataView]";function eq(e,o,s,a){if(e===o)return e!==0||1/e===1/o;if(e==null||o==null)return!1;if(e!==e)return o!==o;var $=typeof e;return $!=="function"&&$!=="object"&&typeof o!="object"?!1:deepEq(e,o,s,a)}function deepEq(e,o,s,a){e instanceof _$1&&(e=e._wrapped),o instanceof _$1&&(o=o._wrapped);var $=toString.call(e);if($!==toString.call(o))return!1;if(hasDataViewBug&&$=="[object Object]"&&isDataView$1(e)){if(!isDataView$1(o))return!1;$=tagDataView}switch($){case"[object RegExp]":case"[object String]":return""+e==""+o;case"[object Number]":return+e!=+e?+o!=+o:+e==0?1/+e===1/o:+e==+o;case"[object Date]":case"[object Boolean]":return+e==+o;case"[object Symbol]":return SymbolProto.valueOf.call(e)===SymbolProto.valueOf.call(o);case"[object ArrayBuffer]":case tagDataView:return deepEq(toBufferView(e),toBufferView(o),s,a)}var c=$==="[object Array]";if(!c&&isTypedArray$1(e)){var nt=getByteLength(e);if(nt!==getByteLength(o))return!1;if(e.buffer===o.buffer&&e.byteOffset===o.byteOffset)return!0;c=!0}if(!c){if(typeof e!="object"||typeof o!="object")return!1;var at=e.constructor,lt=o.constructor;if(at!==lt&&!(isFunction$1(at)&&at instanceof at&&isFunction$1(lt)&&lt instanceof lt)&&"constructor"in e&&"constructor"in o)return!1}s=s||[],a=a||[];for(var et=s.length;et--;)if(s[et]===e)return a[et]===o;if(s.push(e),a.push(o),c){if(et=e.length,et!==o.length)return!1;for(;et--;)if(!eq(e[et],o[et],s,a))return!1}else{var it=keys(e),st;if(et=it.length,keys(o).length!==et)return!1;for(;et--;)if(st=it[et],!(has$1(o,st)&&eq(e[st],o[st],s,a)))return!1}return s.pop(),a.pop(),!0}function isEqual(e,o){return eq(e,o)}function allKeys(e){if(!isObject(e))return[];var o=[];for(var s in e)o.push(s);return hasEnumBug&&collectNonEnumProps(e,o),o}function ie11fingerprint(e){var o=getLength(e);return function(s){if(s==null)return!1;var a=allKeys(s);if(getLength(a))return!1;for(var $=0;$<o;$++)if(!isFunction$1(s[e[$]]))return!1;return e!==weakMapMethods||!isFunction$1(s[forEachName])}}var forEachName="forEach",hasName="has",commonInit=["clear","delete"],mapTail=["get",hasName,"set"],mapMethods=commonInit.concat(forEachName,mapTail),weakMapMethods=commonInit.concat(mapTail),setMethods=["add"].concat(commonInit,forEachName,hasName);const isMap=isIE11?ie11fingerprint(mapMethods):tagTester("Map"),isWeakMap=isIE11?ie11fingerprint(weakMapMethods):tagTester("WeakMap"),isSet=isIE11?ie11fingerprint(setMethods):tagTester("Set"),isWeakSet=tagTester("WeakSet");function values(e){for(var o=keys(e),s=o.length,a=Array(s),$=0;$<s;$++)a[$]=e[o[$]];return a}function pairs(e){for(var o=keys(e),s=o.length,a=Array(s),$=0;$<s;$++)a[$]=[o[$],e[o[$]]];return a}function invert(e){for(var o={},s=keys(e),a=0,$=s.length;a<$;a++)o[e[s[a]]]=s[a];return o}function functions(e){var o=[];for(var s in e)isFunction$1(e[s])&&o.push(s);return o.sort()}function createAssigner(e,o){return function(s){var a=arguments.length;if(o&&(s=Object(s)),a<2||s==null)return s;for(var $=1;$<a;$++)for(var c=arguments[$],nt=e(c),at=nt.length,lt=0;lt<at;lt++){var et=nt[lt];(!o||s[et]===void 0)&&(s[et]=c[et])}return s}}const extend=createAssigner(allKeys),extendOwn=createAssigner(keys),defaults=createAssigner(allKeys,!0);function ctor(){return function(){}}function baseCreate(e){if(!isObject(e))return{};if(nativeCreate)return nativeCreate(e);var o=ctor();o.prototype=e;var s=new o;return o.prototype=null,s}function create(e,o){var s=baseCreate(e);return o&&extendOwn(s,o),s}function clone(e){return isObject(e)?isArray(e)?e.slice():extend({},e):e}function tap(e,o){return o(e),e}function toPath$1(e){return isArray(e)?e:[e]}_$1.toPath=toPath$1;function toPath(e){return _$1.toPath(e)}function deepGet(e,o){for(var s=o.length,a=0;a<s;a++){if(e==null)return;e=e[o[a]]}return s?e:void 0}function get(e,o,s){var a=deepGet(e,toPath(o));return isUndefined(a)?s:a}function has(e,o){o=toPath(o);for(var s=o.length,a=0;a<s;a++){var $=o[a];if(!has$1(e,$))return!1;e=e[$]}return!!s}function identity(e){return e}function matcher(e){return e=extendOwn({},e),function(o){return isMatch(o,e)}}function property(e){return e=toPath(e),function(o){return deepGet(o,e)}}function optimizeCb(e,o,s){if(o===void 0)return e;switch(s??3){case 1:return function(a){return e.call(o,a)};case 3:return function(a,$,c){return e.call(o,a,$,c)};case 4:return function(a,$,c,nt){return e.call(o,a,$,c,nt)}}return function(){return e.apply(o,arguments)}}function baseIteratee(e,o,s){return e==null?identity:isFunction$1(e)?optimizeCb(e,o,s):isObject(e)&&!isArray(e)?matcher(e):property(e)}function iteratee(e,o){return baseIteratee(e,o,1/0)}_$1.iteratee=iteratee;function cb(e,o,s){return _$1.iteratee!==iteratee?_$1.iteratee(e,o):baseIteratee(e,o,s)}function mapObject(e,o,s){o=cb(o,s);for(var a=keys(e),$=a.length,c={},nt=0;nt<$;nt++){var at=a[nt];c[at]=o(e[at],at,e)}return c}function noop(){}function propertyOf(e){return e==null?noop:function(o){return get(e,o)}}function times(e,o,s){var a=Array(Math.max(0,e));o=optimizeCb(o,s,1);for(var $=0;$<e;$++)a[$]=o($);return a}function random(e,o){return o==null&&(o=e,e=0),e+Math.floor(Math.random()*(o-e+1))}const now=Date.now||function(){return new Date().getTime()};function createEscaper(e){var o=function(c){return e[c]},s="(?:"+keys(e).join("|")+")",a=RegExp(s),$=RegExp(s,"g");return function(c){return c=c==null?"":""+c,a.test(c)?c.replace($,o):c}}const escapeMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},escape$1=createEscaper(escapeMap),unescapeMap=invert(escapeMap),unescape$1=createEscaper(unescapeMap),templateSettings=_$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(e){return"\\"+escapes[e]}var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(e,o,s){!o&&s&&(o=s),o=defaults({},o,_$1.templateSettings);var a=RegExp([(o.escape||noMatch).source,(o.interpolate||noMatch).source,(o.evaluate||noMatch).source].join("|")+"|$","g"),$=0,c="__p+='";e.replace(a,function(et,it,st,ct,ft){return c+=e.slice($,ft).replace(escapeRegExp,escapeChar),$=ft+et.length,it?c+=`'+
((__t=(`+it+`))==null?'':_.escape(__t))+
'`:st?c+=`'+
((__t=(`+st+`))==null?'':__t)+
'`:ct&&(c+=`';
`+ct+`
__p+='`),et}),c+=`';
`;var nt=o.variable;if(nt){if(!bareIdentifier.test(nt))throw new Error("variable is not a bare identifier: "+nt)}else c=`with(obj||{}){
`+c+`}
`,nt="obj";c=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
`+c+`return __p;
`;var at;try{at=new Function(nt,"_",c)}catch(et){throw et.source=c,et}var lt=function(et){return at.call(this,et,_$1)};return lt.source="function("+nt+`){
`+c+"}",lt}function result(e,o,s){o=toPath(o);var a=o.length;if(!a)return isFunction$1(s)?s.call(e):s;for(var $=0;$<a;$++){var c=e?.[o[$]];c===void 0&&(c=s,$=a),e=isFunction$1(c)?c.call(e):c}return e}var idCounter=0;function uniqueId(e){var o=++idCounter+"";return e?e+o:o}function chain(e){var o=_$1(e);return o._chain=!0,o}function executeBound(e,o,s,a,$){if(!(a instanceof o))return e.apply(s,$);var c=baseCreate(e.prototype),nt=e.apply(c,$);return isObject(nt)?nt:c}var partial=restArguments(function(e,o){var s=partial.placeholder,a=function(){for(var $=0,c=o.length,nt=Array(c),at=0;at<c;at++)nt[at]=o[at]===s?arguments[$++]:o[at];for(;$<arguments.length;)nt.push(arguments[$++]);return executeBound(e,a,this,this,nt)};return a});partial.placeholder=_$1;const bind=restArguments(function(e,o,s){if(!isFunction$1(e))throw new TypeError("Bind must be called on a function");var a=restArguments(function($){return executeBound(e,a,o,this,s.concat($))});return a}),isArrayLike=createSizePropertyCheck(getLength);function flatten$1(e,o,s,a){if(a=a||[],!o&&o!==0)o=1/0;else if(o<=0)return a.concat(e);for(var $=a.length,c=0,nt=getLength(e);c<nt;c++){var at=e[c];if(isArrayLike(at)&&(isArray(at)||isArguments$1(at)))if(o>1)flatten$1(at,o-1,s,a),$=a.length;else for(var lt=0,et=at.length;lt<et;)a[$++]=at[lt++];else s||(a[$++]=at)}return a}const bindAll=restArguments(function(e,o){o=flatten$1(o,!1,!1);var s=o.length;if(s<1)throw new Error("bindAll must be passed function names");for(;s--;){var a=o[s];e[a]=bind(e[a],e)}return e});function memoize(e,o){var s=function(a){var $=s.cache,c=""+(o?o.apply(this,arguments):a);return has$1($,c)||($[c]=e.apply(this,arguments)),$[c]};return s.cache={},s}const delay=restArguments(function(e,o,s){return setTimeout(function(){return e.apply(null,s)},o)}),defer=partial(delay,_$1,1);function throttle(e,o,s){var a,$,c,nt,at=0;s||(s={});var lt=function(){at=s.leading===!1?0:now(),a=null,nt=e.apply($,c),a||($=c=null)},et=function(){var it=now();!at&&s.leading===!1&&(at=it);var st=o-(it-at);return $=this,c=arguments,st<=0||st>o?(a&&(clearTimeout(a),a=null),at=it,nt=e.apply($,c),a||($=c=null)):!a&&s.trailing!==!1&&(a=setTimeout(lt,st)),nt};return et.cancel=function(){clearTimeout(a),at=0,a=$=c=null},et}function debounce(e,o,s){var a,$,c,nt,at,lt=function(){var it=now()-$;o>it?a=setTimeout(lt,o-it):(a=null,s||(nt=e.apply(at,c)),a||(c=at=null))},et=restArguments(function(it){return at=this,c=it,$=now(),a||(a=setTimeout(lt,o),s&&(nt=e.apply(at,c))),nt});return et.cancel=function(){clearTimeout(a),a=c=at=null},et}function wrap(e,o){return partial(o,e)}function negate(e){return function(){return!e.apply(this,arguments)}}function compose(){var e=arguments,o=e.length-1;return function(){for(var s=o,a=e[o].apply(this,arguments);s--;)a=e[s].call(this,a);return a}}function after(e,o){return function(){if(--e<1)return o.apply(this,arguments)}}function before(e,o){var s;return function(){return--e>0&&(s=o.apply(this,arguments)),e<=1&&(o=null),s}}const once=partial(before,2);function findKey(e,o,s){o=cb(o,s);for(var a=keys(e),$,c=0,nt=a.length;c<nt;c++)if($=a[c],o(e[$],$,e))return $}function createPredicateIndexFinder(e){return function(o,s,a){s=cb(s,a);for(var $=getLength(o),c=e>0?0:$-1;c>=0&&c<$;c+=e)if(s(o[c],c,o))return c;return-1}}const findIndex=createPredicateIndexFinder(1),findLastIndex=createPredicateIndexFinder(-1);function sortedIndex(e,o,s,a){s=cb(s,a,1);for(var $=s(o),c=0,nt=getLength(e);c<nt;){var at=Math.floor((c+nt)/2);s(e[at])<$?c=at+1:nt=at}return c}function createIndexFinder(e,o,s){return function(a,$,c){var nt=0,at=getLength(a);if(typeof c=="number")e>0?nt=c>=0?c:Math.max(c+at,nt):at=c>=0?Math.min(c+1,at):c+at+1;else if(s&&c&&at)return c=s(a,$),a[c]===$?c:-1;if($!==$)return c=o(slice.call(a,nt,at),isNaN$1),c>=0?c+nt:-1;for(c=e>0?nt:at-1;c>=0&&c<at;c+=e)if(a[c]===$)return c;return-1}}const indexOf=createIndexFinder(1,findIndex,sortedIndex),lastIndexOf=createIndexFinder(-1,findLastIndex);function find(e,o,s){var a=isArrayLike(e)?findIndex:findKey,$=a(e,o,s);if($!==void 0&&$!==-1)return e[$]}function findWhere(e,o){return find(e,matcher(o))}function each(e,o,s){o=optimizeCb(o,s);var a,$;if(isArrayLike(e))for(a=0,$=e.length;a<$;a++)o(e[a],a,e);else{var c=keys(e);for(a=0,$=c.length;a<$;a++)o(e[c[a]],c[a],e)}return e}function map(e,o,s){o=cb(o,s);for(var a=!isArrayLike(e)&&keys(e),$=(a||e).length,c=Array($),nt=0;nt<$;nt++){var at=a?a[nt]:nt;c[nt]=o(e[at],at,e)}return c}function createReduce(e){var o=function(s,a,$,c){var nt=!isArrayLike(s)&&keys(s),at=(nt||s).length,lt=e>0?0:at-1;for(c||($=s[nt?nt[lt]:lt],lt+=e);lt>=0&&lt<at;lt+=e){var et=nt?nt[lt]:lt;$=a($,s[et],et,s)}return $};return function(s,a,$,c){var nt=arguments.length>=3;return o(s,optimizeCb(a,c,4),$,nt)}}const reduce=createReduce(1),reduceRight=createReduce(-1);function filter(e,o,s){var a=[];return o=cb(o,s),each(e,function($,c,nt){o($,c,nt)&&a.push($)}),a}function reject(e,o,s){return filter(e,negate(cb(o)),s)}function every(e,o,s){o=cb(o,s);for(var a=!isArrayLike(e)&&keys(e),$=(a||e).length,c=0;c<$;c++){var nt=a?a[c]:c;if(!o(e[nt],nt,e))return!1}return!0}function some(e,o,s){o=cb(o,s);for(var a=!isArrayLike(e)&&keys(e),$=(a||e).length,c=0;c<$;c++){var nt=a?a[c]:c;if(o(e[nt],nt,e))return!0}return!1}function contains(e,o,s,a){return isArrayLike(e)||(e=values(e)),(typeof s!="number"||a)&&(s=0),indexOf(e,o,s)>=0}const invoke=restArguments(function(e,o,s){var a,$;return isFunction$1(o)?$=o:(o=toPath(o),a=o.slice(0,-1),o=o[o.length-1]),map(e,function(c){var nt=$;if(!nt){if(a&&a.length&&(c=deepGet(c,a)),c==null)return;nt=c[o]}return nt==null?nt:nt.apply(c,s)})});function pluck(e,o){return map(e,property(o))}function where(e,o){return filter(e,matcher(o))}function max(e,o,s){var a=-1/0,$=-1/0,c,nt;if(o==null||typeof o=="number"&&typeof e[0]!="object"&&e!=null){e=isArrayLike(e)?e:values(e);for(var at=0,lt=e.length;at<lt;at++)c=e[at],c!=null&&c>a&&(a=c)}else o=cb(o,s),each(e,function(et,it,st){nt=o(et,it,st),(nt>$||nt===-1/0&&a===-1/0)&&(a=et,$=nt)});return a}function min(e,o,s){var a=1/0,$=1/0,c,nt;if(o==null||typeof o=="number"&&typeof e[0]!="object"&&e!=null){e=isArrayLike(e)?e:values(e);for(var at=0,lt=e.length;at<lt;at++)c=e[at],c!=null&&c<a&&(a=c)}else o=cb(o,s),each(e,function(et,it,st){nt=o(et,it,st),(nt<$||nt===1/0&&a===1/0)&&(a=et,$=nt)});return a}var reStrSymbol=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function toArray(e){return e?isArray(e)?slice.call(e):isString(e)?e.match(reStrSymbol):isArrayLike(e)?map(e,identity):values(e):[]}function sample(e,o,s){if(o==null||s)return isArrayLike(e)||(e=values(e)),e[random(e.length-1)];var a=toArray(e),$=getLength(a);o=Math.max(Math.min(o,$),0);for(var c=$-1,nt=0;nt<o;nt++){var at=random(nt,c),lt=a[nt];a[nt]=a[at],a[at]=lt}return a.slice(0,o)}function shuffle(e){return sample(e,1/0)}function sortBy(e,o,s){var a=0;return o=cb(o,s),pluck(map(e,function($,c,nt){return{value:$,index:a++,criteria:o($,c,nt)}}).sort(function($,c){var nt=$.criteria,at=c.criteria;if(nt!==at){if(nt>at||nt===void 0)return 1;if(nt<at||at===void 0)return-1}return $.index-c.index}),"value")}function group(e,o){return function(s,a,$){var c=o?[[],[]]:{};return a=cb(a,$),each(s,function(nt,at){var lt=a(nt,at,s);e(c,nt,lt)}),c}}const groupBy=group(function(e,o,s){has$1(e,s)?e[s].push(o):e[s]=[o]}),indexBy=group(function(e,o,s){e[s]=o}),countBy=group(function(e,o,s){has$1(e,s)?e[s]++:e[s]=1}),partition=group(function(e,o,s){e[s?0:1].push(o)},!0);function size(e){return e==null?0:isArrayLike(e)?e.length:keys(e).length}function keyInObj(e,o,s){return o in s}const pick=restArguments(function(e,o){var s={},a=o[0];if(e==null)return s;isFunction$1(a)?(o.length>1&&(a=optimizeCb(a,o[1])),o=allKeys(e)):(a=keyInObj,o=flatten$1(o,!1,!1),e=Object(e));for(var $=0,c=o.length;$<c;$++){var nt=o[$],at=e[nt];a(at,nt,e)&&(s[nt]=at)}return s}),omit=restArguments(function(e,o){var s=o[0],a;return isFunction$1(s)?(s=negate(s),o.length>1&&(a=o[1])):(o=map(flatten$1(o,!1,!1),String),s=function($,c){return!contains(o,c)}),pick(e,s,a)});function initial(e,o,s){return slice.call(e,0,Math.max(0,e.length-(o==null||s?1:o)))}function first(e,o,s){return e==null||e.length<1?o==null||s?void 0:[]:o==null||s?e[0]:initial(e,e.length-o)}function rest(e,o,s){return slice.call(e,o==null||s?1:o)}function last(e,o,s){return e==null||e.length<1?o==null||s?void 0:[]:o==null||s?e[e.length-1]:rest(e,Math.max(0,e.length-o))}function compact(e){return filter(e,Boolean)}function flatten(e,o){return flatten$1(e,o,!1)}const difference=restArguments(function(e,o){return o=flatten$1(o,!0,!0),filter(e,function(s){return!contains(o,s)})}),without=restArguments(function(e,o){return difference(e,o)});function uniq(e,o,s,a){isBoolean(o)||(a=s,s=o,o=!1),s!=null&&(s=cb(s,a));for(var $=[],c=[],nt=0,at=getLength(e);nt<at;nt++){var lt=e[nt],et=s?s(lt,nt,e):lt;o&&!s?((!nt||c!==et)&&$.push(lt),c=et):s?contains(c,et)||(c.push(et),$.push(lt)):contains($,lt)||$.push(lt)}return $}const union=restArguments(function(e){return uniq(flatten$1(e,!0,!0))});function intersection(e){for(var o=[],s=arguments.length,a=0,$=getLength(e);a<$;a++){var c=e[a];if(!contains(o,c)){var nt;for(nt=1;nt<s&&contains(arguments[nt],c);nt++);nt===s&&o.push(c)}}return o}function unzip(e){for(var o=e&&max(e,getLength).length||0,s=Array(o),a=0;a<o;a++)s[a]=pluck(e,a);return s}const zip=restArguments(unzip);function object(e,o){for(var s={},a=0,$=getLength(e);a<$;a++)o?s[e[a]]=o[a]:s[e[a][0]]=e[a][1];return s}function range(e,o,s){o==null&&(o=e||0,e=0),s||(s=o<e?-1:1);for(var a=Math.max(Math.ceil((o-e)/s),0),$=Array(a),c=0;c<a;c++,e+=s)$[c]=e;return $}function chunk(e,o){if(o==null||o<1)return[];for(var s=[],a=0,$=e.length;a<$;)s.push(slice.call(e,a,a+=o));return s}function chainResult(e,o){return e._chain?_$1(o).chain():o}function mixin(e){return each(functions(e),function(o){var s=_$1[o]=e[o];_$1.prototype[o]=function(){var a=[this._wrapped];return push.apply(a,arguments),chainResult(this,s.apply(_$1,a))}}),_$1}each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var o=ArrayProto[e];_$1.prototype[e]=function(){var s=this._wrapped;return s!=null&&(o.apply(s,arguments),(e==="shift"||e==="splice")&&s.length===0&&delete s[0]),chainResult(this,s)}});each(["concat","join","slice"],function(e){var o=ArrayProto[e];_$1.prototype[e]=function(){var s=this._wrapped;return s!=null&&(s=o.apply(s,arguments)),chainResult(this,s)}});const allExports=Object.freeze(Object.defineProperty({__proto__:null,VERSION,after,all:every,allKeys,any:some,assign:extendOwn,before,bind,bindAll,chain,chunk,clone,collect:map,compact,compose,constant,contains,countBy,create,debounce,default:_$1,defaults,defer,delay,detect:find,difference,drop:rest,each,escape:escape$1,every,extend,extendOwn,filter,find,findIndex,findKey,findLastIndex,findWhere,first,flatten,foldl:reduce,foldr:reduceRight,forEach:each,functions,get,groupBy,has,head:first,identity,include:contains,includes:contains,indexBy,indexOf,initial,inject:reduce,intersection,invert,invoke,isArguments:isArguments$1,isArray,isArrayBuffer,isBoolean,isDataView:isDataView$1,isDate,isElement,isEmpty,isEqual,isError,isFinite:isFinite$1,isFunction:isFunction$1,isMap,isMatch,isNaN:isNaN$1,isNull,isNumber,isObject,isRegExp,isSet,isString,isSymbol,isTypedArray:isTypedArray$1,isUndefined,isWeakMap,isWeakSet,iteratee,keys,last,lastIndexOf,map,mapObject,matcher,matches:matcher,max,memoize,methods:functions,min,mixin,negate,noop,now,object,omit,once,pairs,partial,partition,pick,pluck,property,propertyOf,random,range,reduce,reduceRight,reject,rest,restArguments,result,sample,select:filter,shuffle,size,some,sortBy,sortedIndex,tail:rest,take:first,tap,template,templateSettings,throttle,times,toArray,toPath:toPath$1,transpose:unzip,unescape:unescape$1,union,uniq,unique:uniq,uniqueId,unzip,values,where,without,wrap,zip},Symbol.toStringTag,{value:"Module"}));var _=mixin(allExports);_._=_;var FileSaver_min={exports:{}};(function(e,o){(function(s,a){a()})(commonjsGlobal,function(){function s(et,it){return typeof it>"u"?it={autoBom:!1}:typeof it!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),it={autoBom:!it}),it.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(et.type)?new Blob(["\uFEFF",et],{type:et.type}):et}function a(et,it,st){var ct=new XMLHttpRequest;ct.open("GET",et),ct.responseType="blob",ct.onload=function(){lt(ct.response,it,st)},ct.onerror=function(){console.error("could not download file")},ct.send()}function $(et){var it=new XMLHttpRequest;it.open("HEAD",et,!1);try{it.send()}catch{}return 200<=it.status&&299>=it.status}function c(et){try{et.dispatchEvent(new MouseEvent("click"))}catch{var it=document.createEvent("MouseEvents");it.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),et.dispatchEvent(it)}}var nt=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof commonjsGlobal=="object"&&commonjsGlobal.global===commonjsGlobal?commonjsGlobal:void 0,at=nt.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),lt=nt.saveAs||(typeof window!="object"||window!==nt?function(){}:"download"in HTMLAnchorElement.prototype&&!at?function(et,it,st){var ct=nt.URL||nt.webkitURL,ft=document.createElement("a");it=it||et.name||"download",ft.download=it,ft.rel="noopener",typeof et=="string"?(ft.href=et,ft.origin===location.origin?c(ft):$(ft.href)?a(et,it,st):c(ft,ft.target="_blank")):(ft.href=ct.createObjectURL(et),setTimeout(function(){ct.revokeObjectURL(ft.href)},4e4),setTimeout(function(){c(ft)},0))}:"msSaveOrOpenBlob"in navigator?function(et,it,st){if(it=it||et.name||"download",typeof et!="string")navigator.msSaveOrOpenBlob(s(et,st),it);else if($(et))a(et,it,st);else{var ct=document.createElement("a");ct.href=et,ct.target="_blank",setTimeout(function(){c(ct)})}}:function(et,it,st,ct){if(ct=ct||open("","_blank"),ct&&(ct.document.title=ct.document.body.innerText="downloading..."),typeof et=="string")return a(et,it,st);var ft=et.type==="application/octet-stream",pt=/constructor/i.test(nt.HTMLElement)||nt.safari,gt=/CriOS\/[\d]+/.test(navigator.userAgent);if((gt||ft&&pt||at)&&typeof FileReader<"u"){var wt=new FileReader;wt.onloadend=function(){var $t=wt.result;$t=gt?$t:$t.replace(/^data:[^;]*;/,"data:attachment/file;"),ct?ct.location.href=$t:location=$t,ct=null},wt.readAsDataURL(et)}else{var vt=nt.URL||nt.webkitURL,_t=vt.createObjectURL(et);ct?ct.location=_t:location.href=_t,ct=null,setTimeout(function(){vt.revokeObjectURL(_t)},4e4)}});nt.saveAs=lt.saveAs=lt,e.exports=lt})})(FileSaver_min);var FileSaver_minExports=FileSaver_min.exports;const Segment=({param:e,index:o,handleInputChange:s,sourceImageID:a,template_id:$=null})=>{const[c,nt]=reactExports.useState([]),[at,lt]=reactExports.useState(null),[et,it]=reactExports.useState(null),[st,ct]=reactExports.useState(null),[ft,pt]=reactExports.useState(null),gt=useModel(),[wt,vt]=reactExports.useState(null),[_t,$t]=reactExports.useState(null),[Pt,Nt]=reactExports.useState({});reactExports.useState(null),reactExports.useState(null);const[Lt,Ft]=reactExports.useState(null),[Jt,_r]=reactExports.useState(null),[wr,tn]=reactExports.useState(null),[Wt,Yr]=reactExports.useState(null),[Ot,gr]=reactExports.useState(null),[$o,In]=reactExports.useState(null),en=reactExports.useRef(null),Lr=reactExports.useRef(null),[ko,Ir]=reactExports.useState("/api/resources/proxyurl/shangxiaobao.com:9001"),Dr=reactExports.useRef(null),Zr=reactExports.useRef(null);reactExports.useEffect(()=>{(()=>{const vn=document.createElement("script");vn.src=`${WEB_SITE}/assets/opencv.js`,vn.async=!0,vn.onload=()=>{console.log("OpenCV.js loaded")},document.body.appendChild(vn)})()},[]),reactExports.useEffect(()=>{},[]),reactExports.useEffect(()=>{console.log("new source iamge id",a);const So={};Dr.current=So,(!a||et)&&(Yr(generateUniqueFilename("_embeddings.npy")),gr(generateUniqueFilename("_mask.png")),it(null),ct(null),$t(null),nt([]),Nt({}),pt(null),lt(null),vt(null),_r(null)),a&&getLocalResourceURL(a,$).then(vn=>{if(Dr.current!=So){console.log("cancel executions.",a);return}if(tn(vn.url),On(vn.url),(!e.value||!e.value[1]||!e.value[1].name||$o)&&Zo(new URL(vn.url),So),Dr.current!=So){console.log("cancel executions.",a);return}In(a)})},[a]),reactExports.useEffect(()=>{const So={};Zr.current=So,(async Do=>{if(!Lt&&!Jt&&e&&e.value&&Array.isArray(e.value)&&e.value.length>0&&e.value[1]){let Xo={url:null,file:null},Lo={url:null,file:null};if(Zr.current!==Do){console.log("quit1");return}if(e.value[0]&&e.value[0].name){if(Xo=await getLocalResourceURL(`${e.value[0].name}_${e.value[0].type}_${e.value[0].size}`,$),Zr.current!==Do){console.log("quit1");return}zo(Xo.url),Ft(Xo.file)}if(Zr.current!==Do){console.log("quit2");return}if(e.value[1]&&e.value[1].name){if(Lo=await getLocalResourceURL(`${e.value[1].name}_${e.value[1].type}_${e.value[1].size}`,$),Zr.current!==Do){console.log("quit1");return}_r(Lo.file),rn(Lo.file)}if(Zr.current!==Do){console.log("quit3");return}s(o,{target:{name:Xo.file&&Xo.file.name?Xo.file.name:"mask.file",files:[Xo?.file,Lo.file]}})}else console.log("legacy flow.")})(So)},[e]),reactExports.useEffect(()=>{const So=()=>{et&&et.width/et.height},vn=new ResizeObserver(Do=>{for(const Xo of Do)Xo.target===document.body&&So()});return So(),vn.observe(document.body),()=>{vn.unobserve(document.body)}},[et]);const rn=async So=>{if(So)try{const vn=await Yo(So),Do=await Js(vn,"float32");vt(Do)}catch(vn){alert("internal error"),console.error("Failed to load tensor:",vn)}},On=async So=>{try{if(!So)return;const vn=new Image;vn.src=new URL(So).href,vn.onload=()=>{const{height:Do,width:Xo,samScale:Lo}=Fo(vn);$t({height:Do,width:Xo,samScale:Lo}),vn.width=Xo,vn.height=Do,it(vn)}}catch(vn){console.log(vn)}},zo=async So=>{try{if(!So){ct(null);return}const vn=new Image;vn.src=new URL(So).href,vn.onload=()=>{ct(vn)}}catch(vn){console.log(vn)}};function Yo(So){return new Promise((vn,Do)=>{const Xo=new FileReader;Xo.onload=Lo=>{vn(Lo.target.result)},Xo.onerror=Lo=>{Do(Lo)},Xo.readAsArrayBuffer(So)})}async function jo(So,vn){try{const Do=new Blob([So],{type:"application/octet-stream"}),Xo=Wt,Lo=new File([Do],Xo,{type:"application/octet-stream"});if(Dr.current!==vn){console.log("canceld:",Lo);return}if(_r(Lo),rn(Lo),Dr.current!==vn){console.log("canceld:",Lo);return}console.log("seding param change :",Lo),s(o,{target:{name:Ot,files:[null,Lo]}}),ct(null)}catch(Do){console.error("Error saving ArrayBuffer:",Do)}}const Ko=async So=>{const vn=await fetch(So).then(Lo=>Lo.blob()),Do=new File([vn],"mask.png",{type:"image/png"}),Xo=new FormData;return Xo.append("file",vn),Xo.append("name",Do.name),Xo.append("size",Do.size),Xo.append("type",Do.type),Xo},Zo=async(So,vn)=>{const Do=await Ko(So);let Xo=0;for(;Xo<3;){try{if(Dr.current!==vn)return;let Lo=await fetch(`${MARKETPLACE_SITE}${ko}/getembeddings_refined`,{method:"POST",body:Do});if(Lo.ok){const Jo=await Lo.arrayBuffer();jo(Jo,vn);break}else alert("网络阻塞,重试一下就好 ..."),console.error("Failed to get embeddings:",Lo.statusText)}catch(Lo){alert("网络阻塞,重试一下就好 ..."),console.error("Error loading image tensor:",Lo)}Xo+=1}},Fo=So=>{let Do=So.naturalWidth,Xo=So.naturalHeight;const Lo=1024/Math.max(Xo,Do);return{height:Xo,width:Do,samScale:Lo}},Js=async(So,vn)=>{const Xo=await new npyjs().load(So);return new yt(vn,Xo.data,Xo.shape)};reactExports.useEffect(()=>{if(c){const So=_o();if(So){const vn=nn(So);vn.onload=()=>{const Do=document.createElement("canvas"),Xo=Do.getContext("2d");Do.width=So.width,Do.height=So.height,Xo.fillStyle="white",Xo.fillRect(0,0,Do.width,Do.height),Xo.drawImage(vn,0,0);try{if(window.cv&&window.cv.imread){const Lo=window.cv.imread(Do);if(Lo.empty())console.error("The source matrix is empty.");else{const Jo=new window.cv.Mat;window.cv.cvtColor(Lo,Jo,window.cv.COLOR_RGBA2GRAY,0);const Xs=new window.cv.Mat,na=new window.cv.Size(5,5);window.cv.GaussianBlur(Jo,Xs,na,0,0,window.cv.BORDER_DEFAULT);const ba=window.cv.Mat.ones(5,5,window.cv.CV_8U),ga=new window.cv.Mat;window.cv.morphologyEx(Xs,ga,window.cv.MORPH_CLOSE,ba);const eu=new window.cv.Mat;window.cv.threshold(ga,eu,127,255,window.cv.THRESH_BINARY),window.cv.imshow(Do,eu),Lo.delete(),Jo.delete(),Xs.delete(),ga.delete(),eu.delete(),ba.delete()}}else console.error("OpenCV.js is not loaded properly.")}catch(Lo){console.error("OPENCV ERROR:",Lo)}Do.toBlob(Lo=>{if(Lo){const Jo=Ot,Xs=new File([Lo],Jo,{type:"image/png"});Ft(Xs),s(o,{target:{name:Ot,files:[Xs,Jt]}})}},"image/png")},ct(vn)}else ct(null)}},[c]),reactExports.useEffect(()=>{if(!at){pt(null);return}if(gt===null||wt===null||_t===null)return;(async()=>{const vn=await ar({x:at.x,y:at.y}),Do=nn(vn);pt(Do)})()},[at]),reactExports.useEffect(()=>{if(!st)return;const So=new window.Image;So.src=st.src,So.onload=()=>{const vn=en.current;if(!vn)return;const Do=vn.getContext("2d");vn.width=So.width,vn.height=So.height,Do.drawImage(So,0,0);const Xo=Do.getImageData(0,0,vn.width,vn.height),Lo=Xo.data;for(let Jo=0;Jo<Lo.length;Jo+=4){const Xs=Lo[Jo],na=Lo[Jo+1],ba=Lo[Jo+2],ga=Lo[Jo+3];Xs<10&&na<10&&ba<10&&ga===255?(Lo[Jo]=255,Lo[Jo+1]=0,Lo[Jo+2]=0,Lo[Jo+3]=255):Lo[Jo+3]=0}Do.putImageData(Xo,0,0)}},[st]);const Ks=So=>{if(So.preventDefault(),!st)return;const vn=document.createElement("canvas");vn.width=st.width,vn.height=st.height;const Do=vn.getContext("2d");Do.drawImage(st,0,0);const Xo=Do.getImageData(0,0,st.width,st.height).data,Lo=document.createElement("canvas");Lo.width=st.width,Lo.height=st.height;const Jo=Lo.getContext("2d");Jo.drawImage(et,0,0,st.width,st.height);const Xs=Jo.getImageData(0,0,st.width,st.height).data;for(let na=0;na<Xo.length;na+=4)Xo[na+3]!==0?(Jo.clearRect(na/4%st.width,Math.floor(na/4/st.width),1,1),Jo.fillStyle=`rgba(${Xs[na]}, ${Xs[na+1]}, ${Xs[na+2]}, ${Xs[na+3]})`,Jo.fillRect(na/4%st.width,Math.floor(na/4/st.width),1,1)):Jo.clearRect(na/4%st.width,Math.floor(na/4/st.width),1,1);Lo.toBlob(na=>{const ba=URL.createObjectURL(na),ga=document.createElement("a");ga.download="extracted_areas.png",ga.href=ba,ga.click()},"image/png")},Dt=async So=>{if(gt===null||wt===null||_t===null)return;So.preventDefault();const vn=So.currentTarget.getBoundingClientRect(),Do=(So.clientX-vn.left)*(_t.width/vn.width),Xo=(So.clientY-vn.top)*(_t.height/vn.height);if(So.button===0){const Lo=[...c,Jr(Do,Xo)];let Jo=await ar({x:Do,y:Xo});Nt({...Pt,[`${Do},${Xo},1`]:Jo}),nt(Lo)}else if(So.button===2){const Lo=[...c,Jr(Do,Xo,-1)];let Jo=await ar({x:Do,y:Xo});Nt({...Pt,[`${Do},${Xo},-1`]:Jo}),nt(Lo)}},Eo=So=>{So.preventDefault()},Jr=(So,vn,Do=1)=>({x:So,y:vn,clickType:Do}),ar=async({x:So,y:vn})=>{try{if(gt===null||wt===null||_t===null)return;const Do=[Jr(So,vn)],Xo=modelData({clicks:Do,tensor:wt,modelScale:_t});if(Xo===void 0)return;const Jo=(await gt.run(Xo))[gt.outputNames[0]];return er(Jo.data,Jo.dims[2],Jo.dims[3])}catch(Do){console.log(Do)}return null};function er(So,vn,Do){const[Xo,Lo,Jo,Xs]=[0,114,189,255],na=new Uint8ClampedArray(4*vn*Do).fill(0);for(let ba=0;ba<So.length;ba++)So[ba]>0&&(na[4*ba+0]=Xo,na[4*ba+1]=Lo,na[4*ba+2]=Jo,na[4*ba+3]=Xs);return new ImageData(na,Do,vn)}function vr(So){const vn=document.createElement("canvas");return vn.width=So.width,vn.height=So.height,vn.getContext("2d").putImageData(So,0,0),vn}const _o=()=>{if(Object.keys(Pt).length===0)return null;if(gt===null||wt===null||_t===null)return;Pt[Object.keys(Pt)[0]];const So=et.width,vn=et.height,Do=document.createElement("canvas");Do.getContext("2d"),Do.width=So,Do.height=vn;const Xo=new Uint8ClampedArray(4*So*vn).fill(0);return Object.entries(Pt).forEach(([Jo,Xs])=>{const ba=vr(Xs).getContext("2d").getImageData(0,0,So,vn).data,ga=parseInt(Jo.split(",")[2]);if(ga===-1)for(let eu=0;eu<ba.length;eu+=4)ba[eu+3]>0&&(Xo[eu+3]=0);else if(ga===1)for(let eu=0;eu<ba.length;eu+=4)ba[eu+3]>0&&(Xo[eu+3]=255)}),new ImageData(Xo,So,vn)};function nn(So){const vn=vr(So),Do=new Image;return Do.src=vn.toDataURL(),Do}const Kr=So=>{if(So.preventDefault(),!st)return;const vn=document.createElement("canvas"),Do=vn.getContext("2d");if(vn.width=st.width,vn.height=st.height,Do.fillStyle="white",Do.fillRect(0,0,vn.width,vn.height),Do.drawImage(st,0,0),window.cv)try{const Xo=window.cv.imread(vn),Lo=new window.cv.Mat;window.cv.cvtColor(Xo,Lo,window.cv.COLOR_RGBA2GRAY,0);const Jo=new window.cv.Mat,Xs=new window.cv.Size(5,5);window.cv.GaussianBlur(Lo,Jo,Xs,0,0,window.cv.BORDER_DEFAULT);const na=window.cv.Mat.ones(5,5,window.cv.CV_8U),ba=new window.cv.Mat;window.cv.morphologyEx(Jo,ba,window.cv.MORPH_CLOSE,na);const ga=new window.cv.Mat;window.cv.threshold(ba,ga,127,255,window.cv.THRESH_BINARY),window.cv.imshow(vn,ga);const eu=vn.toDataURL("image/png");Xo.delete(),Lo.delete(),Jo.delete(),ba.delete(),ga.delete(),na.delete();const mu=Io(eu);let gu=generateUniqueFilename("mask.png");FileSaver_minExports.saveAs(mu,gu)}catch(Xo){console.error("OPENCV ERROR:",Xo),vn.toBlob(Lo=>{let Jo=generateUniqueFilename("mask.png");FileSaver_minExports.saveAs(Lo,Jo)},"image/png")}};function Io(So){const vn=atob(So.split(",")[1]),Do=new Array(vn.length);for(let Lo=0;Lo<vn.length;Lo++)Do[Lo]=vn.charCodeAt(Lo);const Xo=new Uint8Array(Do);return new Blob([Xo],{type:"image/png"})}const Bo=So=>{So.preventDefault(),ct(null),nt([]),Nt({}),pt(null),lt(null),Ft(null),s(o,{target:{name:Ot,files:[null,Jt]}})},Ao=_.throttle(So=>{if(gt===null||wt===null||_t===null)return;let vn=So.nativeEvent.target;const Do=vn.getBoundingClientRect();let Xo=So.clientX-Do.left,Lo=So.clientY-Do.top;const Jo=et?et.width/vn.offsetWidth:1;Xo*=Jo,Lo*=Jo;const Xs=Jr(Xo,Lo);Xs&&lt(Xs)},15),Qo=So=>{console.log("out"),lt(null),pt(null)};return reactExports.useState(null),reactExports.useState(500),jsxRuntimeExports.jsxs("div",{className:"my-file-drop-area",children:[(!wt||!gt||!_t)&&jsxRuntimeExports.jsx("div",{style:{fontSize:"14px",textAlign:"center",padding:"20px",zIndex:999,backgroundColor:"rgba(255, 255, 255, 0.9)"},children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{style:{width:"20px",height:"20px"},loading:"lazy",className:"mix_blend_mode",src:`${WEB_SITE}/images/loading.gif`,alt:"active-icon"}),window.innerWidth>1e3?"蒙版加载中,大概需要10-20秒,然后移动鼠标,稍作等待后,蓝色区域为备选区域(左键是加选,右键是减选),红色是已选区域(即:在结果中保留的部分)":"红色已选,点击选择"]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:window.innerWidth>1e3?"这里是左边的原图的蒙版选择区域,红色选中的区域在结果图中不会变。 ":"蒙版"})}),wt&&gt&&_t&&at==null&&window.innerWidth>1e3&&jsxRuntimeExports.jsx("div",{style:{fontSize:"14px",textAlign:"center",padding:"20px",zIndex:999,backgroundColor:"rgba(255, 255, 255, 0.4)"},children:et?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:window.innerWidth>1e3?"挪动鼠标,蓝色为待选区域,红色为结果图中不变的区域,左键➕,右键➖":"点击选择蒙版"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:window.innerWidth>1e3?"这里是左边的原图的蒙版选择区域,红色选中的区域在结果图中不会变。 ":"蒙版"})}),!1,st&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("button",{onClick:Kr,style:{position:"absolute",top:"20px",left:0,background:"#31BE4B",border:"none",borderRadius:"4px",color:"#FFFFFF",margin:window.innerWidth>1e3?"10px":"0px",fontSize:"10px",zIndex:999},children:"下载"}),jsxRuntimeExports.jsx("button",{onClick:Ks,style:{position:"absolute",top:"50px",left:0,background:"#2C5ECE",border:"none",borderRadius:"4px",color:"#ffffff",margin:window.innerWidth>1e3?"10px":"0px",fontSize:"10px",zIndex:999},children:"剪裁"}),jsxRuntimeExports.jsx("button",{onClick:Bo,style:{position:"absolute",top:"80px",left:0,background:"#E6E6E6",border:"none",borderRadius:"4px",color:"#787878",margin:window.innerWidth>1e3?"10px":"0px",fontSize:"10px",zIndex:999},children:"清空"})]}),et&&jsxRuntimeExports.jsx("img",{src:et.src,name:"sourceimage",style:{position:"absolute",height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),st&&jsxRuntimeExports.jsx("canvas",{ref:en,style:{position:"absolute",height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),ft&&jsxRuntimeExports.jsx("img",{src:ft.src,style:{position:"absolute",height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%",opacity:"0.5",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),et&&jsxRuntimeExports.jsx("img",{ref:Lr,src:et.src,name:"sourceimage",style:{position:"absolute",height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%",top:"50%",left:"50%",opacity:"0.2",zIndex:"990",transform:"translate(-50%, -50%)"},onMouseDown:Dt,onMouseMove:Ao,onMouseLeave:Qo,onContextMenu:Eo})]})};function ImageEditor({param:e,canvasWidth:o,canvasHeight:s,url:a,handleChanged:$}){const c=reactExports.useRef(null),[nt,at]=reactExports.useState({x:0,y:0,width:0,height:0,scale:1}),[lt,et]=reactExports.useState(!1),[it,st]=reactExports.useState({x:0,y:0,width:0,height:0}),[ct,ft]=reactExports.useState(!1),[pt,gt]=reactExports.useState(null),[wt,vt]=reactExports.useState(!1),[_t,$t]=reactExports.useState(null),[Pt,Nt]=reactExports.useState(1),Lt=reactExports.useRef(null),[Ft,Jt]=reactExports.useState(null),_r=Zr=>{if(Zr){const rn=e.accept.split(","),On=Zr.name.split(".").pop().toLowerCase();if(rn==""||rn.includes(`.${On}`)){const zo={target:{name:e.name,files:[Zr]}};$(zo)}else alert("文件类型暂不支持,请上传如下类型文件:"+e.accept)}},wr=Zr=>{Zr.preventDefault(),Zr.stopPropagation(),Zr.target.files[0]&&$(Zr)};reactExports.useEffect(()=>{const Zr=new Image;Zr.src=a,Zr.onload=()=>{const rn=o/1.5/Zr.width,On=s/1.5/Zr.height,zo=Math.min(On,rn),Yo={image:Zr,x:(c.current.width-Zr.width*zo)/2,y:(c.current.height-Zr.height*zo)/2,width:Zr.width*zo,height:Zr.height*zo,scale:zo};at(Yo),st({x:Yo.x,y:Yo.y,width:Yo.width,height:Yo.height}),Jt(Yo),Nt(zo),et(!0),$t(Zr)}},[o,s,a]);const tn=Zr=>{Zr.preventDefault(),Ft&&(at(Ft),st({x:Ft.x,y:Ft.y,width:Ft.width,height:Ft.height}))},Wt=(Zr,rn)=>{const zo=rn.height/15,Yo=rn.width/15;for(let jo=0;jo<zo;jo++)for(let Ko=0;Ko<Yo;Ko++)Zr.fillStyle=(jo+Ko)%2===0?"#FFF":"#DDD",Zr.fillRect(Ko*15,jo*15,15,15)},Yr=Zr=>{const rn=o/_t.width,On=s/_t.height,zo=_t.width*rn,Yo=_t.height*On;Zr.font="16px Arial",Zr.fillStyle="black",Zr.textAlign="right",Zr.font="12px Arial",Zr.fillText(`最大宽度: ${Math.round(zo/Pt)}px, 最大高度: ${Math.round(Yo/Pt)}px`,c.current.width-10,c.current.height-10)};reactExports.useEffect(()=>{const Zr=c.current,rn=Zr.getContext("2d");Zr.width=o,Zr.height=s,Wt(rn,Zr)},[]);const Ot=Zr=>{Zr.preventDefault(),Zr.stopPropagation();const On=.01*(1024/_t.width),zo=Zr.clientX-c.current.getBoundingClientRect().left,Yo=Zr.clientY-c.current.getBoundingClientRect().top,jo=Zr.deltaY>0?-On:On;at(Ko=>{const Zo=Math.max(.02,Math.min(8,Ko.scale+jo)),Fo=_t.width*Zo,Js=_t.height*Zo,Ks=zo-(zo-Ko.x)*(Zo/Ko.scale),Dt=Yo-(Yo-Ko.y)*(Zo/Ko.scale);return{...Ko,x:Ks,y:Dt,width:Fo,height:Js,scale:Zo}})},gr=Zr=>{Zr.preventDefault();const rn={x:Zr.clientX-c.current.getBoundingClientRect().left,y:Zr.clientY-c.current.getBoundingClientRect().top},On=8;if(Math.abs(rn.x-it.x)<On&&Math.abs(rn.y-it.y)<On){ft(!0),gt({x:rn.x-it.x,y:rn.y-it.y,corner:"topLeft"});return}else if(Math.abs(rn.x-(it.x+it.width))<On&&Math.abs(rn.y-it.y)<On){ft(!0),gt({x:rn.x-(it.x+it.width),y:rn.y-it.y,corner:"topRight"});return}else if(Math.abs(rn.x-it.x)<On&&Math.abs(rn.y-(it.y+it.height))<On){ft(!0),gt({x:rn.x-it.x,y:rn.y-(it.y+it.height),corner:"bottomLeft"});return}else if(Math.abs(rn.x-(it.x+it.width))<On&&Math.abs(rn.y-(it.y+it.height))<On){ft(!0),gt({x:rn.x-(it.x+it.width),y:rn.y-(it.y+it.height),corner:"bottomRight"});return}vt(!0),gt({x:rn.x-nt.x,y:rn.y-nt.y})},$o=Zr=>{if(Zr.preventDefault(),wt){const jo=Zr.clientX-c.current.getBoundingClientRect().left,Ko=Zr.clientY-c.current.getBoundingClientRect().top;at(Zo=>({...Zo,x:jo-pt.x,y:Ko-pt.y}));return}if(!ct)return;const rn=Zr.clientX-c.current.getBoundingClientRect().left,On=Zr.clientY-c.current.getBoundingClientRect().top,zo=rn+pt.x,Yo=On+pt.y;st(jo=>{switch(pt.corner){case"topLeft":return{...jo,x:zo,y:Yo,width:jo.width+(jo.x-zo),height:jo.height+(jo.y-Yo)};case"topRight":return{...jo,y:Yo,width:zo-jo.x,height:jo.height+(jo.y-Yo)};case"bottomLeft":return{...jo,x:zo,width:jo.width+(jo.x-zo),height:Yo-jo.y};case"bottomRight":return{...jo,width:zo-jo.x,height:Yo-jo.y};default:return jo}})},In=()=>{ft(!1),vt(!1)};reactExports.useEffect(()=>{if(lt&&nt){const Zr=c.current,rn=Zr.getContext("2d");rn.clearRect(0,0,Zr.width,Zr.height),Wt(rn,Zr),rn.drawImage(nt.image,nt.x,nt.y,nt.width,nt.height),en(rn),Yr(rn)}},[nt,lt,it]);const en=Zr=>{const rn=c.current;Zr.clearRect(0,0,rn.width,rn.height),Wt(Zr,rn),Zr.drawImage(_t,nt.x,nt.y,nt.width,nt.height),Zr.strokeStyle="grey",Zr.lineWidth=2,Zr.strokeRect(it.x,it.y,it.width,it.height);const On=8;Zr.fillStyle="blue",Zr.fillRect(it.x-On/2,it.y-On/2,On,On),Zr.fillRect(it.x+it.width-On/2,it.y-On/2,On,On),Zr.fillRect(it.x-On/2,it.y+it.height-On/2,On,On),Zr.fillRect(it.x+it.width-On/2,it.y+it.height-On/2,On,On)};function Lr(Zr,rn){const On=document.createElement("canvas"),zo=On.getContext("2d");return On.width=Zr.width/rn,On.height=Zr.height/rn,zo.drawImage(Zr,0,0,On.width,On.height),On}const ko=Zr=>{Zr.preventDefault();const rn=document.createElement("canvas"),On=rn.getContext("2d");rn.width=Math.round(it.width/Pt),rn.height=Math.round(it.height/Pt);const zo=Ft.width/nt.width,Yo=Lr(Ft.image,zo),jo=Yo.width,Ko=Yo.height,Zo=(nt.x-it.x)/Pt,Fo=(nt.y-it.y)/Pt;On.drawImage(Yo,0,0,jo,Ko,Zo,Fo,jo,Ko),rn.toBlob(Js=>{const Ks=URL.createObjectURL(Js),Dt=document.createElement("a");Dt.href=Ks,Dt.download="saved-image.png",document.body.appendChild(Dt),Dt.click(),document.body.removeChild(Dt),URL.revokeObjectURL(Ks)},"image/png")},Ir=Zr=>{Zr.preventDefault();const rn=document.createElement("canvas"),On=rn.getContext("2d");rn.width=Math.round(it.width/Pt),rn.height=Math.round(it.height/Pt);const zo=Ft.width/nt.width,Yo=Lr(Ft.image,zo),jo=Yo.width,Ko=Yo.height,Zo=(nt.x-it.x)/Pt,Fo=(nt.y-it.y)/Pt;On.drawImage(Yo,0,0,jo,Ko,Zo,Fo,jo,Ko),rn.toBlob(Js=>{URL.createObjectURL(Js),document.createElement("a");const Ks=Dr("edited_.png"),Dt=new File([Js],Ks,{type:"image/png"});_r(Dt)},"image/png")};function Dr(Zr){const rn=new Date,On=rn.getFullYear()+("0"+(rn.getMonth()+1)).slice(-2)+("0"+rn.getDate()).slice(-2)+"_"+("0"+rn.getHours()).slice(-2)+("0"+rn.getMinutes()).slice(-2)+("0"+rn.getSeconds()).slice(-2),zo=v4().replace(/-/g,""),Yo=`${On}_${zo}_`,jo=Zr.split("/").pop();return`${Yo}${jo}`}return jsxRuntimeExports.jsxs("div",{style:{position:"relative",width:"canvasWidthpx",height:"canvasHeightpx",border:"1px solid black"},children:[jsxRuntimeExports.jsx("canvas",{ref:c,onWheel:Ot,onMouseDown:gr,onMouseMove:$o,onMouseUp:In}),jsxRuntimeExports.jsxs("div",{style:{position:"absolute",top:"5px",left:"0px",fontSize:"10px",color:"#787878"},children:[jsxRuntimeExports.jsx("span",{style:{display:"inline-block",padding:"0 10px"},children:"拖动四个角改变结果图大小,滚轮缩放原始图像,拖动图像改变位置,"}),jsxRuntimeExports.jsxs("div",{style:{fontSize:"10px",padding:"0 10px"},children:["宽: ",Math.round(it.width/Pt),"px, 高: ",Math.round(it.height/Pt),"px; 原图在新图中坐标:( ",Math.round((nt.x-it.x)/Pt),", ",Math.round((nt.y-it.y)/Pt)," )"]}),jsxRuntimeExports.jsx("input",{type:"file",ref:Lt,style:{display:"none"},onChange:Zr=>{wr(Zr)}})]}),jsxRuntimeExports.jsx("div",{className:"newfileInput",children:jsxRuntimeExports.jsx("button",{onClick:Zr=>{Zr.preventDefault(),Lt.current.click()},children:"新建上传"})}),jsxRuntimeExports.jsxs("div",{className:"newfileInputCon",children:[jsxRuntimeExports.jsx("button",{onClick:Zr=>tn(Zr),style:{color:"#2C5ECE"},children:"复原"}),jsxRuntimeExports.jsx("button",{onClick:Zr=>ko(Zr),style:{color:"#31BE4B"},children:"下载"}),jsxRuntimeExports.jsx("button",{onClick:Zr=>Ir(Zr),style:{color:"#787878"},children:"确认"})]})]})}function EditableImage({index:e,param:o,handleInputChange:s,previewUrl:a}){const[$,c]=reactExports.useState(!1),nt=reactExports.useRef(null),at=ft=>{ft.preventDefault(),c(!0)},lt=ft=>{ft.preventDefault(),c(!1)},et=ft=>{ft.preventDefault()},it=ft=>{ft.preventDefault(),c(!1);const pt=ft.dataTransfer.files[0];if(pt){const gt=o.accept.split(","),wt=pt.name.split(".").pop().toLowerCase();if(gt==""||gt.includes(`.${wt}`)){const vt={target:{name:o.name,files:[pt]}};s(e,vt)}else alert("文件类型暂不支持,请上传如下类型文件:"+o.accept)}},st=ft=>async pt=>{await s(ft,pt)},ct=ft=>{ft.preventDefault(),ft.target.files[0]&&s(e,ft)};return jsxRuntimeExports.jsxs("div",{className:`my-file-drop-area ${$?"dragging":""}`,onDragEnter:at,onDragLeave:lt,onDragOver:et,onDrop:it,onClick:()=>{a||nt.current.click()},style:{position:"relative",minHeight:window.innerWidth>1e3?"500px":"320px",maxWidth:"100%",maxHeight:"100%"},children:[jsxRuntimeExports.jsx("input",{type:"file",ref:nt,style:{display:"none"},name:o.name,accept:o.accept,onChange:ft=>ct(ft)}),a?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ImageEditor,{param:o,canvasHeight:window.innerWidth>1e3?480:300,canvasWidth:window.innerWidth>1e3?320:200,url:a,handleChanged:st(e)}),jsxRuntimeExports.jsx("button",{type:"button",className:"cancel",onClick:ft=>{ft.stopPropagation(),nt.current.value="",s(e,null)},style:{position:"absolute",top:"10px",right:"10px",padding:"2px",fontSize:"10px",borderRadius:"5%",backgroundColor:"#ccc",border:"none",cursor:"pointer"},children:"X"})]}):jsxRuntimeExports.jsx("p",{style:{textAlign:"center",margin:0,fontSize:"13px"},children:"+"})]})}const DynamicParameterRender=({params:e,setParamFunc:o,template_id:s=null,is_author:a=!1})=>{const $=api$1.get("userType"),[c,nt]=reactExports.useState([]),[at,lt]=reactExports.useState({}),et=reactExports.useRef(null);reactExports.useState(!0);let it=new AbortController;reactExports.useEffect(()=>{it=new AbortController;const _t=it.signal;return pt(e,_t).then($t=>{if(_t.aborted)throw new Error("Fetch aborted");JSON.stringify(e)!==JSON.stringify($t)&&o&&o($t)}).catch($t=>{console.error("Failed to update parameters:",$t)}),()=>{it.abort()}},[e]);const st=async(_t,$t)=>{const Pt={};et.current=Pt;const Nt=e.findIndex(Jt=>Jt.maskSourceUrl===e[_t].name);let Lt=null;Nt>=0&&(Lt=null);const Ft=await Promise.all(e.map(async(Jt,_r)=>{try{if(_t===_r||_r==Nt)if(Jt.type==="file"||Jt.type==="combo_image_selection"||Jt.type==="image_editer"){if($t===void 0||$t==null){const{value:wr,...tn}=Jt;Jt=tn}else if($t.target.files[0])try{let wr=$t.target.files[0];const tn=URL.createObjectURL(wr);if(wr.type.startsWith("image/")){const Wt=await loadImage(tn),{height:Yr,width:Ot,samScale:gr}=handleImageScale(Wt);wr=await resizeImage(Wt,Ot,Yr,wr),saveFile(wr.file,`${wr.name}_${wr.type}_${wr.size}`)}else wr={file:wr,name:wr.name,size:wr.size,type:wr.type},saveFile(wr.file,`${wr.name}_${wr.type}_${wr.size}`);URL.revokeObjectURL(tn),Jt={...Jt,value:wr}}catch(wr){throw console.error("Error processing image:",wr),URL.revokeObjectURL(objectURL),wr}return Jt}else if(Jt.type==="mask")if(_r==Nt&&($t=Lt),$t)if($t.target.files.length>0){let wr=[];for(let tn=0;tn<$t.target.files.length;tn++){const Wt=$t.target.files[tn];if(Wt){const Yr={file:Wt,name:Wt.name,size:Wt.size,type:Wt.type},Ot=`${Yr.name}_${Yr.type}_${Yr.size}`;await saveFile(Yr.file,Ot),wr.push(Yr)}else Wt==""?wr.push(Jt.value?.[tn]):wr.push(null)}return Jt={...Jt,value:wr},Jt}else return Jt;else return Jt={...Jt,value:[null,null]},Jt;else if(Jt.type==="workflow"){if(_r==Nt)if($t)try{$t=await ct($t.target.files[0])}catch(wr){console.error("workflow is error:",wr),$t=[]}else $t=[];return Jt={...Jt,value:$t},Jt}else return Jt={...Jt,value:$t},Jt;return Jt}catch(wr){console.error("Error handling input change:",wr)}}));et.current!=Pt&&console.log("canceld input change: params are ",Ft),o&&o(Ft)},ct=async _t=>{try{if(!_t)return[];let $t=await transformNodesFromFile(_t);return console.log("Returned transformed nodes:",$t),$t}catch($t){throw console.error("Error:",$t),alert($t),$t}},ft=async(_t,$t,Pt)=>{if(Pt.aborted)throw new Error("Fetch aborted");if((_t.type==="file"||_t.type==="combo_image_selection"||_t.type==="image_editer")&&_t.value){let Nt=`${_t.value.name}_${_t.value.type}_${_t.value.size}`,Lt=_t.value.name?(await getLocalResourceURL(`${_t.value.name}_${_t.value.type}_${_t.value.size}`,s)).url:null;if(Nt!=`${_t.value.name}_${_t.value.type}_${_t.value.size}`)throw console.error("changed "+Nt),new Error("Fetch aborted already changed. ");if(Pt.aborted)throw new Error("Fetch aborted");if(Lt){const Ft=e.findIndex(Jt=>Jt.maskSourceUrl===_t.name);nt(Jt=>{const _r=[...Jt];return _r[$t]=Lt,Ft>=0&&(_r[Ft]=`${_t.value.name}_${_t.value.type}_${_t.value.size}`),_r})}}else(_t.type==="file"||_t.type==="combo_image_selection"||_t.type==="mask"||_t.type==="image_editer")&&!_t.value&&nt(Nt=>{const Lt=[...Nt];Lt[$t]=null;const Ft=e.findIndex(Jt=>Jt.maskSourceUrl===_t.name);return Ft>=0&&(Lt[Ft]=null),Lt});return _t},pt=async(_t,$t)=>{const Pt=_t.map(async(Nt,Lt)=>{if($t.aborted)throw new Error("Fetch aborted");if((Nt.type==="selection"||Nt.type==="image_selection")&&!Nt.value)try{const Ft=JSON.parse(Nt.options||Nt.default);if(Array.isArray(Ft))return{...Nt,value:Ft[0].value}}catch{const Jt=(Nt.options||Nt.default||"").split(",")[0].trim();return{...Nt,value:Jt}}else{if(Nt.type==="text"&&(Nt.value===void 0||Nt.value==null))return{...Nt,value:Nt.default};if(Nt.type==="file"||Nt.type==="combo_image_selection"||Nt.type==="mask"||Nt.type==="image_editer")return await ft(Nt,Lt,$t)}return Nt});if($t.aborted)throw new Error("Fetch aborted");return Promise.all(Pt)},gt=_t=>async $t=>{await st(_t,$t)},wt=(_t,$t)=>{const Pt={...at,[_t]:$t};lt(Pt);const Nt=e.map((Lt,Ft)=>_t===Ft&&(Lt.type==="image_selection"||Lt.type==="combo_image_selection")?{...Lt,value:$t}:Lt);o&&o(Nt)},vt=()=>{const _t=e.map((Lt,Ft)=>{switch(Lt.type){case"text":return jsxRuntimeExports.jsxs("div",{style:{height:($=="user"||$=="guest")&&Lt.visibleToUser==0?"0px":"fit-content"},children:[jsxRuntimeExports.jsx("div",{className:styles.form_label_con,children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,style:{fontSize:"12px"},children:[Lt.name,": "]})}),jsxRuntimeExports.jsx("textarea",{rows:1,className:"parameter_input_medium",style:{display:"block",marginLeft:"20px"},type:"text",name:Lt.name,placeholder:"请输入文字,地方不够,请拖动右下角",defaultValue:Lt.value||Lt.default||Lt.accept||"",onBlur:Jt=>st(Ft,Jt.target.value),onInput:Jt=>{Jt.target.style.height="auto",Jt.target.style.height=Jt.target.scrollHeight+"px"},onFocus:Jt=>{Jt.target.style.height="auto",Jt.target.style.height=Jt.target.scrollHeight+"px"}})]},Ft+JSON.stringify(Lt));case"selection":return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:styles.form_label_con,style:{marginTop:"20px"},children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,children:[Lt.name,": "]})]}),jsxRuntimeExports.jsx("select",{name:Lt.name,className:"dropdown_container_search",value:Lt.value,onChange:Jt=>st(Ft,Jt.target.value),children:(()=>{try{const Jt=JSON.parse(Lt.options||Lt.default);if(console.log(1),Array.isArray(Jt))return Jt.map((_r,wr)=>jsxRuntimeExports.jsx("option",{value:_r.value,children:_r.option},wr))}catch{return(Lt.options||Lt.default||"").split(",").map((_r,wr)=>jsxRuntimeExports.jsx("option",{value:_r.trim(),children:_r.trim()},wr))}})()})]},Ft+JSON.stringify(Lt));case"image_selection":return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:styles.item_title_area,style:{padding:"5px 10px"},children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,children:[Lt.name,": "]})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(()=>{try{const Jt=JSON.parse(Lt.options||Lt.default||"{}");if(Array.isArray(Jt))return jsxRuntimeExports.jsx(ImageList,{optionsObject:Jt,param:Lt,handleImageSelect:wt,paramIndex:Ft})}catch{return(Lt.options||Lt.default||"").split(",").map((_r,wr)=>jsxRuntimeExports.jsx("div",{className:styles.image_option,children:jsxRuntimeExports.jsx("img",{src:_r.trim(),alt:`Option ${wr+1}`,onClick:()=>wt(Ft,_r.trim()),className:Lt.value===_r.trim()?styles.image_selected:""},wr)},wr))}})()})]},Ft+JSON.stringify(Lt));case"combo_image_selection":return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:styles.form_label_con,style:{marginTop:"20px"},children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,children:[Lt.name,": "]})]}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ComboImageList,{optionsObject:Lt.options||Lt.default||"[]",param:Lt,paramIndex:Ft,handleImageSelect:wt,handleInputChange:st,uploadPreviewUrl:c[Ft]},Ft)})]},Ft+JSON.stringify(Lt));case"file":return jsxRuntimeExports.jsxs("div",{style:{minHeight:window.innerWidth>1e3?Lt.name=="图标"||Lt.accept.includes("json")?"100px":"550px":Lt.name=="图标"||Lt.accept&&Lt.accept.includes("json")?"30px":"350px",height:$!="admin"&&Lt.visibleToUser==0&&!a?"0px":"fit-content"},children:[($=="admin"||Lt.visibleToUser!==0||a)&&Lt.name!="图标"&&jsxRuntimeExports.jsx("div",{className:styles.item_title_area,style:{padding:"20px"},children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,children:[Lt.name,": "]})}),jsxRuntimeExports.jsx("div",{style:{height:window.innerWidth>1e3?$!="admin"&&Lt.visibleToUser==0&&!a?"0px":Lt.name=="图标"||Lt.accept&&Lt.accept.includes("json")?"60px":"500px":$!="admin"&&Lt.visibleToUser==0&&!a?"0px":Lt.name=="图标"||Lt.accept.includes("json")?"60px":"300px"},children:o&&jsxRuntimeExports.jsx(FileUpload,{index:Ft,param:Lt,handleInputChange:st,previewUrl:c[Ft],visible:$=="admin"||Lt.visibleToUser!=0||a,verbose:!0},Ft)})]},Ft+JSON.stringify(Lt));case"image_editer":return jsxRuntimeExports.jsxs("div",{style:{minHeight:window.innerWidth>1e3?"550px":"350px",height:"fit-content",width:"100%",minWidth:"fit-content"},id:"dddd",children:[jsxRuntimeExports.jsx("div",{className:styles.item_title_area,style:{padding:"10px 10px 0 10px"},children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,children:[Lt.name,": "]})}),o&&jsxRuntimeExports.jsx(EditableImage,{index:Ft,param:Lt,handleInputChange:st,previewUrl:c[Ft]},Ft)]},Ft+JSON.stringify(Lt));case"mask":return jsxRuntimeExports.jsxs("div",{style:{minHeight:window.innerWidth>1e3?"550px":"350px",height:"fit-content"},children:[jsxRuntimeExports.jsx("div",{className:styles.item_title_area,style:{padding:"10px 10px 0 10px"},children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,children:[Lt.name,": "]})}),jsxRuntimeExports.jsx("div",{style:{height:window.innerWidth>1e3?"500px":"300px"},children:o&&jsxRuntimeExports.jsx(Segment,{param:Lt,index:Ft,handleInputChange:st,sourceImageID:c[Ft],template_id:s},Ft)})]},Ft);case"workflow":return jsxRuntimeExports.jsxs("div",{style:{height:"fit-content"},children:[jsxRuntimeExports.jsxs("div",{className:styles.form_label_con,style:{},children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,htmlFor:Lt.name,children:[Lt.name,": "]})]}),jsxRuntimeExports.jsx("div",{style:{height:"fit-content"},children:o&&jsxRuntimeExports.jsx(DynamicParameterRender,{params:Lt.value,index:Ft,setParamFunc:gt(Ft),template_id:s},Ft+JSON.stringify(Lt)+"workflow")})]},Ft+JSON.stringify(Lt));default:return null}}),$t=[];let Pt=0,Nt=["image_selection","combo_image_selection","workflow"];for(;Pt<_t.length;)Nt.includes(e[Pt].type)?($t.push(jsxRuntimeExports.jsx("div",{style:{marginBottom:"25px",height:"fit-content"},className:"rightItenBottom",children:_t[Pt]},Pt)),Pt++):($=="user"||$=="guest")&&e[Pt].visibleToUser==0||e[Pt].type==="file"&&Pt+1<_t.length&&_t[Pt+1]&&!["file","mask"].includes(e[Pt+1].type)?($t.push(jsxRuntimeExports.jsxs("div",{className:"leftItemTop",children:[jsxRuntimeExports.jsxs("div",{className:styles.form_label_con,children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsxs("label",{className:styles.form_label,children:["参数",jsxRuntimeExports.jsx("span",{style:{fontSize:"9px"},children:" (选填)"})]})]}),jsxRuntimeExports.jsx("div",{className:styles.compileCon,style:{display:"flex",marginBottom:"5px",height:$!="admin"&&e[Pt].visibleToUser==0&&!a?"0px":"fit-content"},children:jsxRuntimeExports.jsx("div",{style:{width:"90%",height:$!="admin"&&e[Pt].visibleToUser==0&&!a?"0px":"fit-content"},children:_t[Pt]})},Pt)]})),Pt++):($t.push(jsxRuntimeExports.jsxs("div",{id:"asasad",className:styles.compileCon,style:{width:"90%",marginBottom:"5px",height:"fit-content",marginTop:e[Pt].name==="图标"?"30px":"0",boxShadow:e[Pt].name==="图标"?"none":"0px 2px 4px 0px rgba(0,0,0,0.16)",border:e[Pt].name==="图标"?"1px solid #afafbc":"none",borderRadius:e[Pt].name==="图标"?"10px":"0 0 10px 10px",marginLeft:e[Pt].name==="图标"?"10px":"0"},children:[jsxRuntimeExports.jsx("div",{style:{height:"fit-content"},children:_t[Pt]}),jsxRuntimeExports.jsx("div",{style:{height:"fit-content"},children:Pt+1<_t.length&&_t[Pt+1]})]},Pt)),Pt+=2);return $t};return jsxRuntimeExports.jsx("form",{id:"dynamicForm",style:{width:"100%"},children:vt()})};function ImageDisplayCombo({file:e,watermark:o=!1}){const[s,a]=reactExports.useState(""),[$,c]=reactExports.useState(!1),[nt,at]=reactExports.useState(!0);reactExports.useEffect(()=>(fileDisplayAble(e)?fetchAndSetImage(e).then(it=>a(it)).catch(console.error):at(!1),()=>s&&URL.revokeObjectURL(s)),[e.id,e.type,e.name]);const lt=it=>{it.preventDefault(),c(!0),document.body.style.cursor="zoom-out"},et=()=>{c(!1),document.body.style.cursor="pointer"};return jsxRuntimeExports.jsxs("div",{style:{maxWidth:"100%",height:"auto"},children:[s?jsxRuntimeExports.jsx(MediaDisplay,{url:s,type:e.type,muted:!0,controls:!0,autoplay:!0,watermark:o,onMediaClick:lt}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:nt?jsxRuntimeExports.jsx("div",{children:"加载中..."}):jsxRuntimeExports.jsx("div",{children:"点击下载..."})}),jsxRuntimeExports.jsx(Popup,{visible:$,position:"bottom",style:{zIndex:1e6},bodyStyle:{width:"100%",height:"100%"},destroyOnClose:!0,closeOnMaskClick:!0,showCloseButton:!0,children:jsxRuntimeExports.jsx(ImageModal,{closeModal:et,imageUrl:s,filetype:e.type})})]})}function Files({files:e,downloadFile:o,returnResourceIcon:s,shareContent:a=null}){const $=api$1.get("userType");return jsxRuntimeExports.jsxs("div",{className:"gridContainer_resouce_new",children:[" ",e&&e.filter(c=>!c.name.endsWith(".npy")&&!c.name.endsWith(".json")).map(c=>jsxRuntimeExports.jsxs("div",{children:[" ",jsxRuntimeExports.jsxs("div",{className:styles.history_box,children:[" ",jsxRuntimeExports.jsx(ImageDisplayCombo,{file:c,watermark:$=="guest"}),jsxRuntimeExports.jsx("div",{style:{display:"flex",cursor:"pointer"},children:jsxRuntimeExports.jsxs("div",{className:styles.picListBot,children:[jsxRuntimeExports.jsx("div",{style:{fontSize:"10px",color:"#787878"},className:styles.single_line_block,onClick:()=>o(c.id,c.name),children:c.name}),jsxRuntimeExports.jsxs("div",{style:{fontSize:"9px",textAlign:"right"},onClick:()=>o(c.id,c.name),className:styles.downBth,children:[c.type.split("/")[1],c.size!==""?` • ${formatBytes(c.size)}`:"",jsxRuntimeExports.jsxs("span",{children:["点击下载",$=="user"||$=="guest"?"(含水印)":""]})]}),($=="user"||$=="guest")&&jsxRuntimeExports.jsxs("div",{style:{fontSize:"9px",textAlign:"right"},onClick:()=>o(c.id,c.name),className:styles.downBth,children:[c.type.split("/")[1],c.size!==""?` • ${formatBytes(c.size)}`:"",jsxRuntimeExports.jsx("span",{children:"注册去水印下载"})]}),a&&jsxRuntimeExports.jsx("div",{style:{fontSize:"9px",padding:"5px"},children:jsxRuntimeExports.jsx("button",{onClick:()=>a(c.id),style:{background:"#4591ee",width:"100%",border:"none",color:"#fff",borderRadius:"8px",padding:"7px 25px",fontSize:"12px"},children:"发布"})})]})})]})]},c.id))]})}function ResourceList({files:e,channel:o,runs:s,runid:a,selectedRunStatus:$,share:c=!0}){const[nt,at]=reactExports.useState(null),lt=reactExports.useMemo(()=>s.map(st=>{const ct=e.filter(ft=>ft.agent_execution_id===st.id);return ct.length!==0&&{run:st,files:ct}}).filter(Boolean),[e,s]),et=(st,ct)=>{const ft=e.filter(pt=>pt.agent_execution_id===st);ft.length!==0&&downloadAllFiles(ft,ct)},it=e.some(st=>st.agent_execution_id!==null);return jsxRuntimeExports.jsxs("div",{id:"resource-list",children:[o==="output"&&(!it||e.length<=0?jsxRuntimeExports.jsx("div",{className:"horizontal_space_between flex_wrap",children:$!=="ERROR_PAUSED"&&$!=="COMPLETED"&&$!=="TERMINATED"&&$!=="ITERATION_LIMIT_EXCEEDED"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("span",{className:"feed_title mt_8",children:"尚未执行完毕.或者没有输出文件."})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("img",{style:{width:"34px",height:"34px"},loading:"lazy",className:"mix_blend_mode",src:`${WEB_SITE}/images/loading.gif`,alt:"active-icon",tyle:{float:"left"}})})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("span",{className:"feed_title mt_8",children:"已经结束!"})})})}):jsxRuntimeExports.jsx("div",{id:"division_by_runs",className:"horizontal_space_between flex_wrap",children:lt.map((st,ct)=>jsxRuntimeExports.jsx("div",{style:{width:"100%"},children:st.run.id===a&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"horizontal_container justify_space_between cursor_pointer padding_8_6",onClick:()=>at(st.run.id===a?null:st.run.id),children:[jsxRuntimeExports.jsx("div",{className:"horizontal_container",children:jsxRuntimeExports.jsx("img",{src:a===st.run.id?`${WEB_SITE}/images/arrow_downward_dropdown.svg`:`${WEB_SITE}/images/arrow_forward.svg`,alt:"arrow",style:{width:"14px",height:"14px"}})}),jsxRuntimeExports.jsx("img",{src:`${WEB_SITE}/images/download.svg`,alt:"download_icon",style:{width:"20px",height:"21px"},onClick:()=>et(st.run.id,st.run.name)})]}),jsxRuntimeExports.jsx(Files,{files:st.files,downloadFile,returnResourceIcon,shareContent:c?shareContent:null})]})},lt.length-ct-1))})),o==="input"&&e&&jsxRuntimeExports.jsx(Files,{files:e,downloadFile,returnResourceIcon})]})}function ResourceManager({agentId:e,runs:o,runid:s,selectedRunStatus:a,share:$=!0}){const[c,nt]=reactExports.useState([]),[at,lt]=reactExports.useState([]);reactExports.useState("input"),reactExports.useState(!1),reactExports.useRef(null),reactExports.useEffect(()=>{const it=window.setInterval(function(){a!=="ERROR_PAUSED"&&a!=="COMPLETED"&&a!=="TERMINATED"&&a!=="ITERATION_LIMIT_EXCEEDED"&&et()},5e3);return()=>clearInterval(it)},[s,a]),reactExports.useEffect(()=>{et()},[e]);function et(){getResources(e).then(it=>{const st=it.data,ct=st.filter(pt=>pt.channel==="INPUT"),ft=st.filter(pt=>pt.channel==="OUTPUT");lt(ct),nt(ft)}).catch(it=>{console.error("Error fetching resources:",it)})}return jsxRuntimeExports.jsxs("div",{className:"sectionCon",children:[jsxRuntimeExports.jsxs("div",{className:"section-area",children:[jsxRuntimeExports.jsx("div",{className:"detail_top mb_10",children:jsxRuntimeExports.jsxs("div",{className:"documentTitle",children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsx("span",{children:"运行结果"})]})}),jsxRuntimeExports.jsx("div",{className:"w_100 mr_10 mb_20",children:jsxRuntimeExports.jsx(ResourceList,{files:c,channel:"output",runs:o,runid:s,selectedRunStatus:a,share:$})})]}),jsxRuntimeExports.jsxs("div",{className:"section-area",children:[jsxRuntimeExports.jsx("div",{className:"detail_top mb_10 width=100%",children:jsxRuntimeExports.jsxs("div",{className:"documentTitle",children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsx("span",{children:"原始文件"})]})}),jsxRuntimeExports.jsx("div",{className:"w_100 mr_10 mb_20",children:jsxRuntimeExports.jsx(ResourceList,{files:at,channel:"input",runs:o,selectedRunStatus:a})})]}),jsxRuntimeExports.jsx(k$1,{})]})}function ActivityFeed({selectedRunId:e,selectedView:o,setFetchedData:s,agent:a,selectedRunStatus:$}){const c=api$1.get("userType"),[nt,at]=reactExports.useState("Thinking"),[lt,et]=reactExports.useState([]),it=reactExports.useRef(null),[st,ct]=reactExports.useState("CREATED"),[ft,pt]=reactExports.useState(0),[gt,wt]=reactExports.useState(null),[vt,_t]=reactExports.useState(null),[$t,Pt]=reactExports.useState(!0),[Nt,Lt]=reactExports.useState(null),[Ft,Jt]=reactExports.useState("");reactExports.useEffect(()=>{const tn=window.setInterval(function(){$!=="ERROR_PAUSED"&&$!=="COMPLETED"&&$!=="TERMINATED"&&$!=="ITERATION_LIMIT_EXCEEDED"&&wr()},5e3);return()=>clearInterval(tn)},[e,$]);function _r(){getDateTime(a.id).then(tn=>{const{start_date:Wt,start_time:Yr}=tn.data;wt(Wt),_t(Yr)}).catch(tn=>{console.error("Error fetching agent data:",tn)})}reactExports.useEffect(()=>{loadingTextEffect("工作中",at,250),a?.is_scheduled&&!a?.is_running&&_r()},[]),reactExports.useEffect(()=>{lt.length!==ft&&it.current&&setTimeout(()=>{it.current!==null&&(it.current.scrollTo({top:it.current.scrollHeight,behavior:"smooth"}),pt(lt.length))},100)},[lt]),reactExports.useEffect(()=>{wr()},[e]),reactExports.useEffect(()=>{EventBus.emit("reFetchAgents",{})},[st]);function wr(){e!==null&&(Pt(!0),getExecutionFeeds(e).then(tn=>{const Wt=tn.data;et(Wt.feeds),Jt(Wt.errors),ct(Wt.status),s(Wt.permissions),Lt(Wt.waiting_period?Wt.waiting_period:null),EventBus.emit("resetRunStatus",{executionId:e,status:Wt.status}),Pt(!1)}).catch(tn=>{console.error("Error fetching execution feeds:",tn),Pt(!1)}))}return reactExports.useEffect(()=>{const tn=Yr=>{Yr.selectedRunId===e&&ct(Yr.status)},Wt=()=>{_r()};return EventBus.on("updateRunStatus",tn),EventBus.on("refreshDate",Wt),()=>{EventBus.off("updateRunStatus",tn),EventBus.off("refreshDate",Wt)}}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{style:{overflowY:"auto",maxHeight:"100%",position:"relative"},ref:it,className:"workingArea",children:jsxRuntimeExports.jsxs("div",{style:{marginBottom:"55px"},children:[a?.is_scheduled&&!a?.is_running&&!e?jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[jsxRuntimeExports.jsx("img",{style:{width:"72px",height:"72px"},src:"/images/eventSchedule.png",alt:"github"}),jsxRuntimeExports.jsxs("div",{style:{color:"white",fontSize:"13px"},children:["This agent is scheduled to start on ",gt,", at ",vt]})]}):jsxRuntimeExports.jsxs("div",{children:[lt&&lt.map((tn,Wt)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(c!=="user"&&c!="guest"||tn.extra_info==="message"||(tn.role==="user"||tn.role==="guest")&&tn.extra_info==="user_interaction")&&jsxRuntimeExports.jsxs("div",{className:styles.history_box,style:{background:"white",padding:"1px",cursor:"default"},children:[jsxRuntimeExports.jsx("div",{style:{display:"flex"},children:jsxRuntimeExports.jsx("div",{className:"feed_title",children:tn?.feed||""})}),jsxRuntimeExports.jsx("div",{className:styles.more_details_wrapper,children:tn.time_difference&&jsxRuntimeExports.jsx("div",{className:styles.more_details,children:jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("img",{style:{width:"12px",height:"12px"},src:`${WEB_SITE}/images/schedule.svg`,alt:"schedule-icon"})}),jsxRuntimeExports.jsx("div",{className:styles.history_info,children:formatTimeDifference(tn.time_difference)})]})})})]},Wt)})),st==="WAIT_STEP"&&jsxRuntimeExports.jsx("div",{className:"history_box padding_20 cursor_default bg_secondary",children:jsxRuntimeExports.jsxs("div",{style:{display:"flex"},children:[jsxRuntimeExports.jsx("div",{className:"fs_20 lh_24",children:"⏳"}),jsxRuntimeExports.jsxs("div",{className:"feed_title",children:["Waiting Block Initiated. The Agent will wait for ",convertWaitingPeriod(Nt)||null]})]})}),st==="RUNNING"&&jsxRuntimeExports.jsx("div",{className:"history_box padding_20 cursor_default bg_secondary",children:jsxRuntimeExports.jsxs("div",{style:{display:"flex"},children:[jsxRuntimeExports.jsx("div",{className:"fs_20",children:"🧠"}),jsxRuntimeExports.jsx("div",{className:"feed_title",children:jsxRuntimeExports.jsx("i",{children:nt})})]})}),st==="COMPLETED"&&jsxRuntimeExports.jsx("div",{className:"history_box padding_20 cursor_default bg_secondary",children:jsxRuntimeExports.jsxs("div",{style:{display:"flex"},children:[jsxRuntimeExports.jsx("div",{className:"fs_20",children:"🏁"}),jsxRuntimeExports.jsx("div",{className:"feed_title",children:jsxRuntimeExports.jsx("i",{children:"恭喜,所有任务已经完成!"})})]})}),st==="ITERATION_LIMIT_EXCEEDED"&&jsxRuntimeExports.jsx("div",{className:"history_box padding_20 cursor_default bg_secondary",children:jsxRuntimeExports.jsxs("div",{style:{display:"flex"},children:[jsxRuntimeExports.jsx("div",{className:"fs_20",children:"⚠️"}),jsxRuntimeExports.jsx("div",{className:"feed_title",children:jsxRuntimeExports.jsx("i",{children:"停止: 超过了最大迭代数!"})})]})}),st==="ERROR_PAUSED"&&jsxRuntimeExports.jsx("div",{className:"history_box padding_20 cursor_default bg_secondary",children:jsxRuntimeExports.jsxs("div",{style:{display:"flex"},children:[jsxRuntimeExports.jsx("div",{className:"fs_20",children:"❗"}),jsxRuntimeExports.jsx("div",{className:"feed_title",children:Ft})]})})]}),lt.length<1&&!a?.is_running&&!a?.is_scheduled&&jsxRuntimeExports.jsx("div",{style:{color:"white",fontSize:"13px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",width:"100%"},children:"任务没有安排运行计划"})]})})})}function AgentExecutionChecker({executionId:e,targetStatus:o,runAction:s,intervalTime:a}){reactExports.useEffect(()=>{const $=window.setInterval(async()=>{try{const c=await getExecution(e);o.includes(c.data.status)&&(s(c.data.status),clearInterval($))}catch(c){console.error("Error fetching execution:",c)}},a);return()=>clearInterval($)},[e,o,s,a])}const WorkerAdmin=({sj_display:e,onUpdateDialog:o,onCloseWorkerAdmin:s,isvisible:a})=>{const[$,c]=reactExports.useState(!1);reactExports.useState("1");const[nt,at]=reactExports.useState(localStorage.getItem("keyHuaxiaobao")=="null"?null:localStorage.getItem("keyHuaxiaobao")),[lt,et]=reactExports.useState(localStorage.getItem("accessTokenHuaxiaobao")=="null"?null:localStorage.getItem("accessTokenHuaxiaobao")),[it,st]=reactExports.useState(null),[ct,ft]=reactExports.useState(null),[pt,gt]=reactExports.useState(null),[wt,vt]=reactExports.useState(null),[_t,$t]=reactExports.useState(null),[Pt,Nt]=reactExports.useState(null),[Lt,Ft]=reactExports.useState(null),[Jt,_r]=reactExports.useState(["百变真我学习趣味爱情节日短视频电商音乐电商跳舞其他","百变真我","学习","趣味","爱情","节日","短视频","电商","音乐","跳舞","其他"]),[wr,tn]=reactExports.useState(!1),[Wt,Yr]=reactExports.useState(!1),Ot=reactExports.useRef(null);reactExports.useRef(null),reactExports.useRef(null),reactExports.useRef(null);const[gr,$o]=reactExports.useState(!1),[In,en]=reactExports.useState(0),[Lr,ko]=reactExports.useState(localStorage.getItem("usernameHuaxiaobao")=="null"?null:localStorage.getItem("usernameHuaxiaobao")),[Ir,Dr]=reactExports.useState(localStorage.getItem("usernameHuaxiaobao")=="null"?null:localStorage.getItem("usernameHuaxiaobao")+"的一件精品"),[Zr,rn]=reactExports.useState("我想为你作一件事.."),[On,zo]=reactExports.useState("百变真我"),[Yo,jo]=reactExports.useState([{name:"图标",type:"file",accept:".png,.jpg,.jpeg,.webp,.gif"}]);reactExports.useEffect(()=>{(async()=>{try{const _o=await getFileObject("newlogo1.png_image/png_70522");if(_o){jo([{name:"图标",type:"file",value:{file:_o,name:_o.name,type:_o.type,size:_o.size},accept:".png,.jpg,.jpeg,.webp,.gif"}]);return}else{const nn=await fetch(`${WEB_SITE}/logo/newlogo1.png`);if(!nn.ok)throw new Error("Failed to fetch logo");const Kr=await nn.blob(),Io=new File([Kr],"newlogo1.png",{type:"image/png"});saveFile(Io,`${Io.name}_${Io.type}_${Io.size}`),jo([{name:"图标",type:"file",value:{file:Io,name:Io.name,type:Io.type,size:Io.size},accept:".png,.jpg,.jpeg,.webp,.gif"}])}}catch(_o){console.error("Error fetching logo:",_o)}})()},[]);const Ko=vr=>{Nt(vr),vr=="COMPLETED"?(document.getElementById("trial").disabled=!1,document.getElementById("trial").innerText="运行完毕,再来一遍",document.getElementById("publish")&&(document.getElementById("publish").disabled=!1,document.getElementById("publish").innerText="运行完毕,可以定价上架啦!")):alert("出现错误:",vr)},Zo=async vr=>{create_order_debug({id:1001,price:0,pre_price:0,amount:1,description:vr}).then(nn=>{nn.data.result.startsWith("SUCCESS"),console.log(nn.data.result)}).catch(nn=>{console.error("Error adding user:",nn)})};reactExports.useEffect(()=>{c(a)},[a]);const Fo=vr=>{ft(vr)},Js=vr=>{jo(vr)},Ks=()=>{if(!it)return alert("请在工作流内部添加参数标记节点,可以看帮助或者咨询客服微信v:aizhaoshulin了解"),!1;if(Ir?.replace(/\s/g,"")==="")return alert("任务名称不能为空"),!1;if(Zr?.replace(/\s/g,"")==="")return alert("任务描述不能为空"),!1;if(!Yo[0].value)return alert("请添加logo"),!1;for(let vr of Yo)if(vr.type==="file"&&vr.value===void 0)return alert(vr.name+":图标(logo)中必须输入合适文件"),!1;return!0};reactExports.useEffect(()=>{const vr=async nn=>{const Kr=await window.comfyui_app.graphToPrompt();console.log("MoneySetting initialized with response:",Kr);let Io=JSON.stringify(Kr.output,null,2);if(Object.values(Kr.output).some(Bo=>Bo.class_type==="ComfyUIAppstoreHost"))alert("请删除您的ComfyUIWebHost节点");else{console.log("No ComfyUIWebHost item found in the output.");const Bo=Math.max(...Object.keys(Kr.output).map(So=>parseInt(So)));Kr.output[Bo+1]={inputs:{"ComfyUI 主机地址":nn+".shangxiaobao.com:7000"},class_type:"ComfyUIAppstoreHost",_meta:{title:"ComfyUI Appstore Host (ComfyUI_Appstore)"}},Io=JSON.stringify(Kr.output,null,2);const Ao=new Blob([Io],{type:"application/json"}),Qo=new File([Ao],"workflow_api.json",{type:"application/octet-stream"});console.log("MoneySetting initialized with response:",Kr);try{const So=await transformNodesFromFile(Ao);ft(So),st(Qo)}catch(So){console.error("workflow not ready:",So)}}};(async()=>{const Kr=await fetch("/manager/asset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!Kr.ok)throw new Error(`HTTP error! status: ${Kr.status}`);const Io=await Kr.json(),Bo=Io.message,Ao=Io.data;Bo=="success"&&(gt(Ao),vr(Ao))})()},[]);const Dt=async vr=>{if(!Ks())return;vr.preventDefault();const _o=[{name:"工作流文件的名称",type:"file",value:{file:it,name:it.name,type:it.type,size:it.size},visibleToUser:0},{maskSourceUrl:"工作流文件的名称",name:"工作流的配置",type:"workflow",value:ct,visibleToUser:1}],nn={token:nt,name:Ir,description:Zr,category:On,host:pt,parameter:_o,logo:Yo||[]};try{const Kr=await fetch(`${API_BASE_URL}agents/create_workflow_agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nn)});if(!Kr.ok)throw new Error(`HTTP error! status: ${Kr.status}`);const Io=await Kr.json();console.log("Form submitted successfully");const Bo=Io.id,Ao=Io.name,Qo=Io.execution_id;vt(Bo),uploadParameterFiles(_o,Bo),uploadLogos(Yo,Bo,!1),updateExecution(Qo,{status:"RUNNING"}).then(So=>{document.getElementById("trial").disabled=!0,document.getElementById("trial").innerText="正在运行",document.getElementById("publish")&&(document.getElementById("publish").disabled=!0,document.getElementById("publish").innerText="等运行完毕后,即可上架"),$t(Qo),Nt(null)}).catch(So=>{alert("失败"),console.error("Error updating execution:",So)}),console.log("Server response:",Io)}catch(Kr){console.error("Error submitting form:",Kr)}},Eo=vr=>{setLocalStorageValue("agent_category",Jt[vr],zo),tn(!1)};reactExports.useEffect(()=>{function vr(_o){Ot.current&&!Ot.current.contains(_o.target)&&tn(!1)}return document.addEventListener("mousedown",vr),()=>{document.removeEventListener("mousedown",vr)}},[]);const Jr=(vr,_o)=>{publishToMarketplace(vr,parseFloat(_o)).then(nn=>{Ft(nn.data.id),$o(!1)}).catch(nn=>{console.error("Error publishing to marketplace:",nn)})},ar=()=>{$o(!1)},er=vr=>{en(vr.target.value)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[gr&&jsxRuntimeExports.jsx("div",{className:"modal",style:{height:"100%",zIndex:1999999999999},children:jsxRuntimeExports.jsxs("div",{className:"modal-content",style:{width:"75%"},onClick:vr=>vr.preventDefault(),children:[jsxRuntimeExports.jsx("div",{className:styles.detail_name,children:"准备好了吗?发布到市场!"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{className:styles.form_label,children:"价格"}),jsxRuntimeExports.jsx("input",{className:"input_medium",type:"text",value:In,onChange:er})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[jsxRuntimeExports.jsx("button",{className:"secondary_button",style:{marginRight:"10px"},onClick:ar,children:"取消"}),jsxRuntimeExports.jsxs("button",{className:styles.run_button,style:{paddingLeft:"15px",paddingRight:"25px"},onClick:()=>Jr(_t,In),children:[jsxRuntimeExports.jsx("img",{style:{width:"14px",height:"14px"},src:`${WEB_SITE}/images/run_icon.svg`,alt:"run-icon"})," 发布"]})]})]})}),jsxRuntimeExports.jsxs(Popup,{visible:$,position:"right",bodyStyle:{direction:"ltl",paddingTop:"10px",zIndex:1999999999998,width:"50vw",height:"100vh",backgroundColor:"white",position:"fixed",right:"0px",top:"0px",overflow:"auto",padding:"10px 10px"},destroyOnClose:!1,children:[Wt&&jsxRuntimeExports.jsx("div",{className:"modal",children:jsxRuntimeExports.jsxs("div",{className:"modal-content",style:{width:"75%"},onClick:vr=>vr.preventDefault(),children:[jsxRuntimeExports.jsx("div",{className:styles.detail_name,children:"在工作流中需要用户输入的节点后面挂一个 ComfyUI Appstore Param 节点,选择丰富的类型,即可变成用户的丰富界面!"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{className:styles.form_label,children:"加VX群了解"}),jsxRuntimeExports.jsx("img",{style:{width:"90%",cursor:"pointer"},src:"https://huaxiaobao.net/logo/dev_wechat.png"}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("label",{className:styles.form_label,children:"或者直接查看文档和帮助视频"}),jsxRuntimeExports.jsx("img",{src:`${WEB_SITE}/help/help.png`,onClick:()=>window.open("https://huaxiaobao.net/?category=help","_blank"),style:{width:"20px",height:"20px",cursor:"pointer"}})]}),jsxRuntimeExports.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:jsxRuntimeExports.jsx("button",{className:styles.run_button,style:{paddingLeft:"15px",paddingRight:"25px"},onClick:()=>Yr(!1),children:"  OK"})})]})}),jsxRuntimeExports.jsx("div",{style:{padding:"10px"},children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{style:{paddingBottom:"20px"},children:[jsxRuntimeExports.jsx("span",{style:{display:"none"}}),jsxRuntimeExports.jsxs("div",{className:"documentTitle",children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsx("span",{children:"画小宝,ComfyUI作者变现的平台"}),jsxRuntimeExports.jsx("img",{src:`${WEB_SITE}/help/help2.png`,onClick:()=>window.open("https://huaxiaobao.net/?category=help","_blank"),style:{marginTop:"5px",width:"20px",height:"20px",cursor:"pointer",borderRadius:"50%"},onMouseOver:vr=>{vr.currentTarget.src=`${WEB_SITE}/logo/dev_qq.png`,vr.currentTarget.style.width="200px",vr.currentTarget.style.borderRadius="10px",vr.currentTarget.style.height="auto"},onMouseOut:vr=>{vr.currentTarget.src=`${WEB_SITE}/help/help2.png`,vr.currentTarget.style.width="20px",vr.currentTarget.style.borderRadius="50%",vr.currentTarget.style.height="auto"}})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[jsxRuntimeExports.jsxs("span",{children:[" ","画小宝 huaxiaobao.net 逛逛,马上入驻开店,开启工作流,开始赚钱"]}),jsxRuntimeExports.jsx("span",{style:{cursor:"pointer",fontStyle:"italic"},onClick:()=>window.open("https://huaxiaobao.net/?category=Help_Page","_blank"),children:"享受万元流量奖励"})]})]}),jsxRuntimeExports.jsxs("div",{className:"documentTitle",children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsx("span",{children:"第一步,游客登录,或者注册用户"})]}),!Lr&&jsxRuntimeExports.jsxs("div",{id:"huaxiaobao_guest",style:{border:"dotted",borderWidth:"thin"},children:[jsxRuntimeExports.jsxs("span",{style:{display:"block"},children:["选项一:游客就可以玩,马上点击即获得价值10元”墨宝“奖励,优点:方便,缺点,只能这台机器玩"," "]}),jsxRuntimeExports.jsx("button",{id:"loginGuestButton",className:"secondary_button",onClick:async()=>{var vr="Guest_"+Math.random().toString(36).substr(2,9);document.getElementById("loginGuestButton").textContent="登录中";const nn=await(await fetch(`${API_BASE_URL}register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:vr,smsCode:"Gues",password:vr})})).json();nn.key?(console.log("Login successful, key:",nn.key),document.querySelector("button").style.display="none",document.getElementById("huaxiaobao_login").style.display="none",document.getElementById("huaxiaobao_guest").style.display="none",document.getElementById("huaxiaobao_token").style.display="block",document.getElementById("huaxiaobao_token").textContent=` 游客已登录,请记录画小宝账号信息:用户名:${vr} 密码:${vr}`,setLocalStorageValue("accessTokenHuaxiaobao",nn.token,et),setLocalStorageValue("usernameHuaxiaobao",vr,ko),setLocalStorageValue("keyHuaxiaobao",nn.key,at),Dr(vr+"的一个精品"),Zo(pt)):console.error("Login failed")},children:"一键登录"})]}),jsxRuntimeExports.jsx("span",{id:"huaxiaobao_token",style:{display:Lr?"block":"none"},children:Lr&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("br",{}),Lr,' + "已经登录"',jsxRuntimeExports.jsx("button",{style:{marginRight:"7px"},className:"secondary_button",onClick:()=>{setLocalStorageValue("usernameHuaxiaobao",null,ko)},children:"登出"})]})}),!Lr&&jsxRuntimeExports.jsxs("div",{id:"huaxiaobao_login",style:{border:"dotted",borderWidth:"thin"},children:[jsxRuntimeExports.jsxs("span",{style:{display:"block"},children:["选项二:画小宝登录,或者注册, 马上获得价值50元“墨宝奖励”"," "]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"row",height:"100%"},children:[jsxRuntimeExports.jsx("label",{children:"手机号:"}),jsxRuntimeExports.jsx("input",{style:{width:"150px",fontSize:"13px"},className:"input_medium",type:"text",id:"username",placeholder:"输入手机号"}),jsxRuntimeExports.jsx("label",{children:"密码:"}),jsxRuntimeExports.jsx("input",{style:{width:"150px",fontSize:"13px"},className:"input_medium",type:"password",id:"password",placeholder:"输入密码"})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"row",height:"100%"},children:[jsxRuntimeExports.jsx("button",{id:"loginButton",className:"secondary_button",onClick:async()=>{const _o=await(await fetch(`${API_BASE_URL}login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:document.getElementById("username").value,password:document.getElementById("password").value})})).json();_o.key?(console.log("Login successful"),document.querySelectorAll("label").forEach(nn=>nn.style.display="none"),document.getElementById("huaxiaobao_login").style.display="none",document.getElementById("huaxiaobao_guest").style.display="none",document.getElementById("huaxiaobao_token").style.display="block",document.getElementById("huaxiaobao_token").textContent=" 正式用户登录",setLocalStorageValue("accessTokenHuaxiaobao",_o.token,et),setLocalStorageValue("usernameHuaxiaobao",document.getElementById("username").value,ko),setLocalStorageValue("keyHuaxiaobao",_o.key,at),Dr(document.getElementById("username").value+"的一个精品"),Zo(pt)):(alert("用户名密码不正确,请重试"),console.error("Login failed"))},children:"登录"}),jsxRuntimeExports.jsx("button",{className:"secondary_button",onClick:()=>window.open("https://huaxiaobao.net/?register","_blank"),children:"注册"})]})]})]})}),Lr&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{style:{padding:"10px"},children:[jsxRuntimeExports.jsxs("div",{className:"documentTitle",children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsx("span",{children:"第二步,修改工作流,标记参数并测试"})]}),jsxRuntimeExports.jsxs("div",{style:{marginTop:"10px",width:"100%",textAlign:"left",fontSize:"12px",height:"100%",background:"#324d61"},className:styles.compileCon,children:[jsxRuntimeExports.jsxs("div",{className:styles.form_label_con,children:[it?jsxRuntimeExports.jsx("span",{style:{cursor:"pointer"},children:"下面是显示给用户的区域:这里是跟着工作流中的appstore节点设定变化的。"}):jsxRuntimeExports.jsx("span",{style:{cursor:"pointer"},children:"请在工作流内部添加参数标记节点Appstore Param节点,可以看帮助或者咨询客服微信v:aizhaoshulin了解"}),jsxRuntimeExports.jsx("img",{src:`${WEB_SITE}/help/help.png`,onClick:()=>window.open("https://huaxiaobao.net/?category=Help_Page","_blank"),style:{width:"20px",height:"20px",cursor:"pointer"}})]}),jsxRuntimeExports.jsx("div",{style:{margin:"5px"},children:ct&&jsxRuntimeExports.jsx(DynamicParameterRender,{params:ct,setParamFunc:Fo})})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%"},children:[jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"row",height:"100%"},children:[jsxRuntimeExports.jsxs("div",{style:{marginTop:"10px",width:"100%",textAlign:"left",fontSize:"12px",height:"100%"},className:styles.compileCon,children:[jsxRuntimeExports.jsx("div",{className:styles.form_label_con,children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,style:{fontSize:"12px"},children:["名称:"," "]})}),jsxRuntimeExports.jsx("input",{className:"input_medium",type:"text",value:Ir,onChange:vr=>Dr(vr.target.value),style:{fontSize:"13px"},placeholder:"简洁的名称,例子,马良的画笔"})]}),jsxRuntimeExports.jsxs("div",{style:{marginTop:"10px",width:"100%",textAlign:"left",fontSize:"12px",height:"100%"},className:styles.compileCon,children:[jsxRuntimeExports.jsx("div",{className:styles.form_label_con,children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,style:{fontSize:"12px"},children:["分类"," "]})}),jsxRuntimeExports.jsxs("div",{className:"dropdown_container_search",style:{width:"90%"},children:[jsxRuntimeExports.jsxs("div",{className:"custom_select_container",onClick:()=>tn(!wr),children:[On,jsxRuntimeExports.jsx("img",{style:{width:"20px",height:"21px"},src:wr?WEB_SITE+"/images/dropdown_up.svg":WEB_SITE+"/images/dropdown_down.svg",alt:"expand-icon"})]}),jsxRuntimeExports.jsx("div",{children:wr&&jsxRuntimeExports.jsx("div",{className:"custom_select_options",ref:Ot,style:{width:"100%"},children:jsxRuntimeExports.jsx("div",{className:"model_options",children:Jt.slice(1).map((vr,_o)=>jsxRuntimeExports.jsx("div",{className:"custom_select_option",onClick:()=>Eo(_o+1),style:{maxWidth:"100%"},children:vr},_o+1))})})})]})]})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"row",height:"100%"},children:[jsxRuntimeExports.jsxs("div",{style:{marginTop:"10px",width:"100%",textAlign:"left",fontSize:"12px",height:"100%"},className:styles.compileCon,children:[jsxRuntimeExports.jsx("div",{className:styles.form_label_con,children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,style:{fontSize:"12px"},children:["简介:"," "]})}),jsxRuntimeExports.jsx("textarea",{value:Zr,className:"textarea_medium",rows:8,style:{fontSize:"13px"},onChange:vr=>rn(vr.target.value),placeholder:"来两句介绍,功能和亮点!更有助于吸引用户"})]}),jsxRuntimeExports.jsxs("div",{style:{marginTop:"10px",width:"100%",textAlign:"left",fontSize:"12px",height:"100%"},className:styles.compileCon,children:[jsxRuntimeExports.jsx("div",{className:styles.form_label_con,children:jsxRuntimeExports.jsxs("label",{className:styles.form_label_text,style:{fontSize:"12px"},children:["Logo"," "]})}),jsxRuntimeExports.jsx(DynamicParameterRender,{params:Yo,setParamFunc:Js,is_author:!0})]})]})]}),jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"row",height:"100%"},children:jsxRuntimeExports.jsx("button",{id:"trial",className:"button_auth",style:{width:"100%"},onClick:vr=>Dt(vr),children:"试运行"})})]})]}),_t&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{style:{height:"150px",position:"relative",width:"100%",overflowY:"scroll",paddingBottom:0,border:"dotted",borderWidth:"1px"},children:jsxRuntimeExports.jsx(ActivityFeed,{selectedRunId:_t||null})}),jsxRuntimeExports.jsx(ResourceManager,{agentId:wt,runs:[{id:_t}],runid:_t,share:!1})]})]}),Lr&&_t&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(AgentExecutionChecker,{executionId:_t,targetStatus:["ERROR_PAUSED","COMPLETED","TERMINATED","ITERATION_LIMIT_EXCEEDED"],runAction:Ko,intervalTime:5e3}),jsxRuntimeExports.jsxs("div",{style:{padding:"10px"},children:[jsxRuntimeExports.jsxs("div",{className:"documentTitle",children:[jsxRuntimeExports.jsx("i",{}),jsxRuntimeExports.jsx("span",{children:"第三步,准备上架和赚钱"})]}),jsxRuntimeExports.jsx("button",{id:"publish",disabled:Pt!="COMPLETED",style:{marginRight:"7px",width:"100%"},className:"button_auth",onClick:()=>{$o(!0)},children:"运行完毕后, 上架售卖!"}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("br",{}),Lt&&jsxRuntimeExports.jsx("button",{style:{marginRight:"7px",width:"100%"},className:"button_auth",onClick:()=>window.open(MARKETPLACE_SITE+"/?category=Create_Agent&targetid="+Lt,"_blank"),children:"已经发布! 查看市场!"}),jsxRuntimeExports.jsx("br",{})]})]}),jsxRuntimeExports.jsx("span",{style:{textAlign:"right"},children:pt})]})]})},App=()=>{const[e,o]=reactExports.useState({right:10,top:120}),[s,a]=reactExports.useState(!1),$=reactExports.useRef(!1),c=reactExports.useRef({x:0,y:0}),nt=(it,st)=>{let ct=0;return(...ft)=>{const pt=new Date().getTime();pt-ct<st||(ct=pt,it(...ft))}},at=it=>{it.button===0&&(it.stopPropagation(),$.current=!0,c.current={x:it.clientX,y:it.clientY})},lt=nt(it=>{$.current&&o(st=>{const ct=st.right-(it.clientX-c.current.x),ft=st.top+(it.clientY-c.current.y);return c.current={x:it.clientX,y:it.clientY},{right:ct,top:ft}})},30),et=()=>{$.current&&($.current=!1,console.log("Mouse Up: Stop Dragging"))};return reactExports.useEffect(()=>(document.addEventListener("mousemove",lt),document.addEventListener("mouseup",et),()=>{document.removeEventListener("mousemove",lt),document.removeEventListener("mouseup",et)}),[]),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(WorkerAdmin,{isvisible:s},s),jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"row",position:"fixed",zIndex:0x71afd498cffff,backgroundColor:"transparent",right:`${e.right}px`,top:`${e.top}px`,height:"60px",cursor:"pointer"},onMouseDown:at,children:[jsxRuntimeExports.jsx("div",{style:{borderRadius:"10px",height:"30px"},children:jsxRuntimeExports.jsx("img",{style:{marginTop:"3px",borderRadius:"10px",height:"100%",pointerEvents:"none"},src:`${WEB_SITE}/logo/simplelogo.png`})}),jsxRuntimeExports.jsx("div",{className:"secondary_button",style:{opacity:"0.4"},onClick:()=>{s?window.confirm("关闭后当前结果将不再保存,确认吗?")&&a(!s):a(!s)},children:s?"收起":"Appstore"}),jsxRuntimeExports.jsx("div",{style:{borderRadius:"50%",height:"30px"},children:jsxRuntimeExports.jsx("img",{src:`${WEB_SITE}/help/help2.png`,onClick:()=>window.open("https://huaxiaobao.net/?category=help","_blank"),style:{marginTop:"5px",width:"20px",height:"20px",cursor:"pointer",borderRadius:"50%"},onMouseOver:it=>{it.currentTarget.src=`${WEB_SITE}/logo/dev_qq.png`,it.currentTarget.style.width="200px",it.currentTarget.style.borderRadius="10px",it.currentTarget.style.height="auto"},onMouseOut:it=>{it.currentTarget.src=`${WEB_SITE}/help/help2.png`,it.currentTarget.style.width="20px",it.currentTarget.style.borderRadius="50%",it.currentTarget.style.height="auto"}})})]})]})},root=client.createRoot(document.getElementById("admin-app-appstore"));root.render(jsxRuntimeExports.jsx(GlobalProvider,{children:jsxRuntimeExports.jsx(App,{})}));