diff --git a/appstore_panel/dist/bundle.js b/appstore_panel/dist/bundle.js index 1c243a3..1cc4fac 100644 --- a/appstore_panel/dist/bundle.js +++ b/appstore_panel/dist/bundle.js @@ -22,7 +22,7 @@ * * 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>>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$(vn,ko))zo$(Yo,vn)?(en[Ir]=Yo,en[zo]=ko,Ir=zo):(en[Ir]=vn,en[tn]=ko,Ir=tn);else if(zo$(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&&On(Pt,Lr.startTime-en)}}function Nt(en,Lr){pt=!1,gt&&(gt=!1,vt(Wt),Wt=-1),ft=!0;var ko=ct;try{for($t(Lr),st=s(lt);st!==null&&(!(st.expirationTime>Lr)||en&&!_o());){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 tn=s(et);tn!==null&&On(Pt,tn.startTime-Lr),Zr=!1}return Zr}finally{st=null,ct=ko,ft=!1}}var Lt=!1,Ft=null,Wt=-1,vr=5,wr=-1;function _o(){return!(e.unstable_now()-wren||125Ir?(en.sortIndex=ko,o(et,en),s(lt)===null&&en===s(et)&&(gt?(vt(Wt),Wt=-1):gt=!0,On(Pt,ko-Ir))):(en.sortIndex=Dr,o(lt,en),pt||ft||(pt=!0,$o(Nt))),en},e.unstable_shouldYield=_o,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;/** + */(function(e){function o(en,Lr){var ko=en.length;en.push(Lr);e:for(;0>>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$(On,ko))zo$(Yo,On)?(en[Ir]=Yo,en[zo]=ko,Ir=zo):(en[Ir]=On,en[rn]=ko,Ir=rn);else if(zo$(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||125Ir?(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 * @@ -34,19 +34,19 @@ `+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&<.includes("")&&(lt=lt.replace("",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;$"+o.valueOf().toString()+"",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>>=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;0s;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=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)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=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"),0Tf$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>=nt,$-=nt,rg$1=1<<32-oc$1(o)+$|s<<$|a,sg$1=c+e}else rg$1=1<Wt?(vr=Ft,Ft=null):vr=Ft.sibling;var wr=ct(vt,Ft,$t[Wt],Pt);if(wr===null){Ft===null&&(Ft=vr);break}e&&Ft&&wr.alternate===null&&o(vt,Ft),_t=c(wr,_t,Wt),Lt===null?Nt=wr:Lt.sibling=wr,Lt=wr,Ft=vr}if(Wt===$t.length)return s(vt,Ft),I$1&&tg$1(vt,Wt),Nt;if(Ft===null){for(;Wt<$t.length;Wt++)Ft=st(vt,$t[Wt],Pt),Ft!==null&&(_t=c(Ft,_t,Wt),Lt===null?Nt=Ft:Lt.sibling=Ft,Lt=Ft);return I$1&&tg$1(vt,Wt),Nt}for(Ft=a(vt,Ft);Wt<$t.length;Wt++)vr=ft(Ft,vt,Wt,$t[Wt],Pt),vr!==null&&(e&&vr.alternate!==null&&Ft.delete(vr.key===null?Wt:vr.key),_t=c(vr,_t,Wt),Lt===null?Nt=vr:Lt.sibling=vr,Lt=vr);return e&&Ft.forEach(function(_o){return o(vt,_o)}),I$1&&tg$1(vt,Wt),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,Wt=_t=0,vr=null,wr=$t.next();Ft!==null&&!wr.done;Wt++,wr=$t.next()){Ft.index>Wt?(vr=Ft,Ft=null):vr=Ft.sibling;var _o=ct(vt,Ft,wr.value,Pt);if(_o===null){Ft===null&&(Ft=vr);break}e&&Ft&&_o.alternate===null&&o(vt,Ft),_t=c(_o,_t,Wt),Lt===null?Nt=_o:Lt.sibling=_o,Lt=_o,Ft=vr}if(wr.done)return s(vt,Ft),I$1&&tg$1(vt,Wt),Nt;if(Ft===null){for(;!wr.done;Wt++,wr=$t.next())wr=st(vt,wr.value,Pt),wr!==null&&(_t=c(wr,_t,Wt),Lt===null?Nt=wr:Lt.sibling=wr,Lt=wr);return I$1&&tg$1(vt,Wt),Nt}for(Ft=a(vt,Ft);!wr.done;Wt++,wr=$t.next())wr=ft(Ft,vt,Wt,wr.value,Pt),wr!==null&&(e&&wr.alternate!==null&&Ft.delete(wr.key===null?Wt:wr.key),_t=c(wr,_t,Wt),Lt===null?Nt=wr:Lt.sibling=wr,Lt=wr);return e&&Ft.forEach(function(Jt){return o(vt,Jt)}),I$1&&tg$1(vt,Wt),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;os?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")&&(lt=lt.replace("",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;$"+o.valueOf().toString()+"",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>>=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;0s;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=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)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=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"),0Tf$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>=nt,$-=nt,rg$1=1<<32-oc$1(o)+$|s<<$|a,sg$1=c+e}else rg$1=1<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;os?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<\/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;$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$&&($=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,10e?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;ltB$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"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{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"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;ato&&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{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;se.forEach(o);function eachProp(e,o,s){if(is$1.arr(e)){for(let a=0;ais$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;s0}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(ets){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=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!!(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;sreactExports.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{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;oe===!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:wtPt,!(!Wt&&(ft=Math.abs(ct-pt)<=$t,ft)));++Jt){Lt&&(vr=pt==ct||pt>ct==Ft,vr&&(_t=-_t*Nt,pt=ct));const Kr=-c.tension*1e-6*(pt-ct),Ot=-c.friction*.001*_t,gr=(Kr+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&<.finished&&!(s&<.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),Wt=!gt&&(!Ft||matchProp(at.immediate||s.immediate,nt));if(pt){const Jt=getAnimatedType(st);if(Jt!==$t.constructor)if(Wt)$t=this._set(Lt);else throw Error(`Cannot animate between ${$t.constructor.name} and ${Jt.name}, as the "to" prop suggests`)}const vr=$t.constructor;let wr=hasFluidValue(st),_o=!1;if(!wr){const Jt=Pt||!hasAnimated(this)&&ft;(pt||Jt)&&(_o=isEqual$1(computeGoal(Nt),Lt),wr=!_o),(!isEqual$1(lt.immediate,Wt)&&!Wt||!isEqual$1(wt.decay,vt)||!isEqual$1(wt.velocity,_t))&&(wr=!0)}if(_o&&isAnimating(this)&&(lt.changed&&!Pt?wr=!0:wr||this._stop(et)),!gt&&((wr||hasFluidValue(et))&&(lt.values=$t.getPayload(),lt.toValues=hasFluidValue(st)?null:vr==AnimatedString?[1]:toArray$3(Lt)),lt.immediate!=Wt&&(lt.immediate=Wt,!Wt&&!Pt&&this._set(et)),wr)){const{onRest:Jt}=lt;each$1(ACTIVE_EVENTS,Ot=>mergeActiveFn(this,s,Ot));const Kr=getFinishedResult(this,checkFinished(this,et));flushCalls(this._pendingCalls,Kr),this._pendingCalls.add(a),lt.changed&&raf.batchedUpdates(()=>{lt.changed=!Pt,Jt?.(Kr,this),Pt?callProp(at.onRest,Kr):lt.onStart==null||lt.onStart(Kr,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=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=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):es?+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{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_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.elapsedTimest&&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=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;$=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&<!==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;a0;)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(` +*/(function(e){(function(){var o={}.hasOwnProperty;function s(){for(var c="",nt=0;nt{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"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;ato&&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{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;se.forEach(o);function eachProp(e,o,s){if(is$1.arr(e)){for(let a=0;ais$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;s0}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(ets){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=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!!(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;sreactExports.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{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;oe===!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:wtPt,!(!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&<.finished&&!(s&<.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=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=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):es?+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{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_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.elapsedTimest&&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=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;$=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&<!==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;a0;)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{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{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,Wt]=progressEventDecorator(wt,progressEventReducer(asyncDecorator(lt)));a=trackStream(Nt.body,DEFAULT_CHUNK_SIZE,Ft,Wt)}}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&>)){const Nt={};["status","statusText","headers"].forEach(vr=>{Nt[vr]=_t[vr]});const Lt=utils$1.toFiniteNumber(_t.headers.get("content-length")),[Ft,Wt]=at&&progressEventDecorator(Lt,progressEventReducer(asyncDecorator(at),!0))||[];_t=new Response(trackStream(_t.body,DEFAULT_CHUNK_SIZE,Ft,()=>{Wt&&Wt(),gt&>()}),Nt)}et=et||"text";let Pt=await resolvers[utils$1.findKey(resolvers,et)||"text"](_t,e);return!$t&>&>(),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&>(),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`adapter ${at} `+(lt===!1?"is not supported by the environment":"is not available in the build"));let nt=o?c.length>1?`since : +`)}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{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{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&>)){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&>()}),Nt)}et=et||"text";let Pt=await resolvers[utils$1.findKey(resolvers,et)||"text"](_t,e);return!$t&>&>(),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&>(),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`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"&>.runWhen(s)===!1||(lt=lt&>.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{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 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:{}};/*! +`+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"&>.runWhen(s)===!1||(lt=lt&>.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{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 @@ -56,8 +56,8 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js 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>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>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>>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>>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>>=8;return wt}function nt(ft,pt,gt,wt,vt,_t){var $t,Pt,Nt=ft.file,Lt=ft.compression,Ft=_t!==et.utf8encode,Wt=at.transformTo("string",_t(Nt.name)),vr=at.transformTo("string",et.utf8encode(Nt.name)),wr=Nt.comment,_o=at.transformTo("string",_t(wr)),Jt=at.transformTo("string",et.utf8encode(wr)),Kr=vr.length!==Nt.name.length,Ot=Jt.length!==wr.length,gr="",$o="",On="",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||!Kr&&!Ot||(Ir|=2048);var Dr=0,Zr=0;en&&(Dr|=16),vt==="UNIX"?(Zr=798,Dr|=function(vn,zo){var Yo=vn;return vn||(Yo=zo?16893:33204),(65535&Yo)<<16}(Nt.unixPermissions,en)):(Zr=20,Dr|=function(vn){return 63&(vn||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(),Kr&&($o=c(1,1)+c(it(Wt),4)+vr,gr+="up"+c($o.length,2)+$o),Ot&&(On=c(1,1)+c(it(_o),4)+Jt,gr+="uc"+c(On.length,2)+On);var tn="";return tn+=` -\0`,tn+=c(Ir,2),tn+=Lt.magic,tn+=c($t,2),tn+=c(Pt,2),tn+=c(ko.crc32,4),tn+=c(ko.compressedSize,4),tn+=c(ko.uncompressedSize,4),tn+=c(Wt.length,2),tn+=c(gr.length,2),{fileRecord:st.LOCAL_FILE_HEADER+tn+Wt+gr,dirRecord:st.CENTRAL_FILE_HEADER+c(Zr,2)+tn+c(_o.length,2)+"\0\0\0\0"+c(Dr,4)+c(wt,4)+Wt+gr+_o}}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.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 "+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&>(Ft)}).on("error",function(Lt){_t=[],vt(Lt)}).on("end",function(){try{var Lt=function(Ft,Wt,vr){switch(Ft){case"blob":return c.newBlob(c.transformTo("arraybuffer",Wt),vr);case"base64":return lt.encode(Wt);default:return c.transformTo(Ft,Wt)}}(Pt,function(Ft,Wt){var vr,wr=0,_o=null,Jt=0;for(vr=0;vr"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>>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&><$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>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>>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>10&1023,_t[pt++]=56320|1023>)}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>>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>>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,Wt=15,vr=3,wr=258,_o=wr+vr+1,Jt=42,Kr=113,Ot=1,gr=2,$o=3,On=4;function en(Dt,Eo){return Dt.msg=it[Eo],Eo}function Lr(Dt){return(Dt<<1)-(4Dt.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 tn(Dt,Eo){Dt.pending_buf[Dt.pending++]=Eo>>>8&255,Dt.pending_buf[Dt.pending++]=255&Eo}function vn(Dt,Eo){var Jr,ar,er=Dt.max_chain_length,_r=Dt.strstart,In=Dt.prev_length,rn=Dt.nice_match,Yr=Dt.strstart>Dt.w_size-_o?Dt.strstart-(Dt.w_size-_o):0,Io=Dt.window,Bo=Dt.w_mask,Ao=Dt.prev,Qo=Dt.strstart+wr,So=Io[_r+In-1],_n=Io[_r+In];Dt.prev_length>=Dt.good_match&&(er>>=2),rn>Dt.lookahead&&(rn=Dt.lookahead);do if(Io[(Jr=Eo)+In]===_n&&Io[Jr+In-1]===So&&Io[Jr]===Io[_r]&&Io[++Jr]===Io[_r+1]){_r+=2,Jr++;do;while(Io[++_r]===Io[++Jr]&&Io[++_r]===Io[++Jr]&&Io[++_r]===Io[++Jr]&&Io[++_r]===Io[++Jr]&&Io[++_r]===Io[++Jr]&&Io[++_r]===Io[++Jr]&&Io[++_r]===Io[++Jr]&&Io[++_r]===Io[++Jr]&&_rYr&&--er!=0);return In<=Dt.lookahead?In:Dt.lookahead}function zo(Dt){var Eo,Jr,ar,er,_r,In,rn,Yr,Io,Bo,Ao=Dt.w_size;do{if(er=Dt.window_size-Dt.lookahead-Dt.strstart,Dt.strstart>=Ao+(Ao-_o)){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(In=Dt.strm,rn=Dt.window,Yr=Dt.strstart+Dt.lookahead,Io=er,Bo=void 0,Bo=In.avail_in,Io=vr)for(_r=Dt.strstart-Dt.insert,Dt.ins_h=Dt.window[_r],Dt.ins_h=(Dt.ins_h<=vr&&(Dt.ins_h=(Dt.ins_h<=vr)if(ar=at._tr_tally(Dt,Dt.strstart-Dt.match_start,Dt.match_length-vr),Dt.lookahead-=Dt.match_length,Dt.match_length<=Dt.max_lazy_match&&Dt.lookahead>=vr){for(Dt.match_length--;Dt.strstart++,Dt.ins_h=(Dt.ins_h<=vr&&(Dt.ins_h=(Dt.ins_h<=vr&&Dt.match_length<=Dt.prev_length){for(er=Dt.strstart+Dt.lookahead-vr,ar=at._tr_tally(Dt,Dt.strstart-1-Dt.prev_match,Dt.prev_length-vr),Dt.lookahead-=Dt.prev_length-1,Dt.prev_length-=2;++Dt.strstart<=er&&(Dt.ins_h=(Dt.ins_h<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-_o&&(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:On):(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,_r;if(!Dt||!Dt.state||5>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=Kr);else{var In=_t+(ar.w_bits-8<<4)<<8;In|=(2<=ar.strategy||ar.level<2?0:ar.level<6?1:ar.level===6?2:3)<<6,ar.strstart!==0&&(In|=32),In+=31-In%31,ar.status=Kr,tn(ar,In),ar.strstart!==0&&(tn(ar,Dt.adler>>>16),tn(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)){_r=1;break}_r=ar.gzindexer&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),_r===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)){_r=1;break}_r=ar.gzindexer&&(Dt.adler=et(Dt.adler,ar.pending_buf,ar.pending-er,er)),_r===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=Kr)):ar.status=Kr),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 rn=ar.strategy===2?function(Yr,Io){for(var Bo;;){if(Yr.lookahead===0&&(zo(Yr),Yr.lookahead===0)){if(Io===st)return Ot;break}if(Yr.match_length=0,Bo=at._tr_tally(Yr,0,Yr.window[Yr.strstart]),Yr.lookahead--,Yr.strstart++,Bo&&(Dr(Yr,!1),Yr.strm.avail_out===0))return Ot}return Yr.insert=0,Io===ct?(Dr(Yr,!0),Yr.strm.avail_out===0?$o:On):Yr.last_lit&&(Dr(Yr,!1),Yr.strm.avail_out===0)?Ot:gr}(ar,Eo):ar.strategy===3?function(Yr,Io){for(var Bo,Ao,Qo,So,_n=Yr.window;;){if(Yr.lookahead<=wr){if(zo(Yr),Yr.lookahead<=wr&&Io===st)return Ot;if(Yr.lookahead===0)break}if(Yr.match_length=0,Yr.lookahead>=vr&&0Yr.lookahead&&(Yr.match_length=Yr.lookahead)}if(Yr.match_length>=vr?(Bo=at._tr_tally(Yr,1,Yr.match_length-vr),Yr.lookahead-=Yr.match_length,Yr.strstart+=Yr.match_length,Yr.match_length=0):(Bo=at._tr_tally(Yr,0,Yr.window[Yr.strstart]),Yr.lookahead--,Yr.strstart++),Bo&&(Dr(Yr,!1),Yr.strm.avail_out===0))return Ot}return Yr.insert=0,Io===ct?(Dr(Yr,!0),Yr.strm.avail_out===0?$o:On):Yr.last_lit&&(Dr(Yr,!1),Yr.strm.avail_out===0)?Ot:gr}(ar,Eo):c[ar.level].func(ar,Eo);if(rn!==$o&&rn!==On||(ar.status=666),rn===Ot||rn===$o)return Dt.avail_out===0&&(ar.last_flush=-1),ft;if(rn===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)):(tn(ar,Dt.adler>>>16),tn(ar,65535&Dt.adler)),Ir(Dt),0=Jr.w_size&&(_r===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),In=Dt.avail_in,rn=Dt.next_in,Yr=Dt.input,Dt.avail_in=Bo,Dt.next_in=0,Dt.input=Eo,zo(Jr);Jr.lookahead>=vr;){for(ar=Jr.strstart,er=Jr.lookahead-(vr-1);Jr.ins_h=(Jr.ins_h<>>=vr=Wt>>>24,$t-=vr,(vr=Wt>>>16&255)===0)gr[it++]=65535&Wt;else{if(!(16&vr)){if(!(64&vr)){Wt=Pt[(65535&Wt)+(_t&(1<>>=vr,$t-=vr),$t<15&&(_t+=Ot[lt++]<<$t,$t+=8,_t+=Ot[lt++]<<$t,$t+=8),Wt=Nt[_t&Ft];r:for(;;){if(_t>>>=vr=Wt>>>24,$t-=vr,!(16&(vr=Wt>>>16&255))){if(!(64&vr)){Wt=Nt[(65535&Wt)+(_t&(1<>>=vr,$t-=vr,(vr=it-st)<_o){if(gt<(vr=_o-vr)&&at.sane){c.msg="invalid distance too far back",at.mode=30;break e}if(Kr=vt,(Jt=0)===wt){if(Jt+=pt-vr,vr>3,_t&=(1<<($t-=wr<<3))-1,c.next_in=lt,c.next_out=it,c.avail_in=lt>>24&255)+(Jt>>>8&65280)+((65280&Jt)<<8)+((255&Jt)<<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(Jt){var Kr;return Jt&&Jt.state?(Kr=Jt.state,Jt.total_in=Jt.total_out=Kr.total=0,Jt.msg="",Kr.wrap&&(Jt.adler=1&Kr.wrap),Kr.mode=pt,Kr.last=0,Kr.havedict=0,Kr.dmax=32768,Kr.head=null,Kr.hold=0,Kr.bits=0,Kr.lencode=Kr.lendyn=new c.Buf32(gt),Kr.distcode=Kr.distdyn=new c.Buf32(wt),Kr.sane=1,Kr.back=-1,ct):ft}function Pt(Jt){var Kr;return Jt&&Jt.state?((Kr=Jt.state).wsize=0,Kr.whave=0,Kr.wnext=0,$t(Jt)):ft}function Nt(Jt,Kr){var Ot,gr;return Jt&&Jt.state?(gr=Jt.state,Kr<0?(Ot=0,Kr=-Kr):(Ot=1+(Kr>>4),Kr<48&&(Kr&=15)),Kr&&(Kr<8||15=On.wsize?(c.arraySet(On.window,Kr,Ot-On.wsize,On.wsize,0),On.wnext=0,On.whave=On.wsize):(gr<($o=On.wsize-On.wnext)&&($o=gr),c.arraySet(On.window,Kr,Ot-gr,$o,On.wnext),(gr-=$o)?(c.arraySet(On.window,Kr,Ot-gr,gr,0),On.wnext=gr,On.whave=On.wsize):(On.wnext+=$o,On.wnext===On.wsize&&(On.wnext=0),On.whave>>8&255,Ot.check=at(Ot.check,_r,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){Jt.msg="incorrect header check",Ot.mode=30;break}if((15&Ir)!=8){Jt.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){Jt.msg="invalid window size",Ot.mode=30;break}Ot.dmax=1<>8&1),512&Ot.flags&&(_r[0]=255&Ir,_r[1]=Ir>>>8&255,Ot.check=at(Ot.check,_r,2,0)),Dr=Ir=0,Ot.mode=3;case 3:for(;Dr<32;){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>>8&255,_r[2]=Ir>>>16&255,_r[3]=Ir>>>24&255,Ot.check=at(Ot.check,_r,4,0)),Dr=Ir=0,Ot.mode=4;case 4:for(;Dr<16;){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>8),512&Ot.flags&&(_r[0]=255&Ir,_r[1]=Ir>>>8&255,Ot.check=at(Ot.check,_r,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[On++]<>>8&255,Ot.check=at(Ot.check,_r,2,0)),Dr=Ir=0}else Ot.head&&(Ot.head.extra=null);Ot.mode=6;case 6:if(1024&Ot.flags&&(Lr<(vn=Ot.length)&&(vn=Lr),vn&&(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,On,vn,Dt)),512&Ot.flags&&(Ot.check=at(Ot.check,gr,vn,On)),Lr-=vn,On+=vn,Ot.length-=vn),Ot.length))break e;Ot.length=0,Ot.mode=7;case 7:if(2048&Ot.flags){if(Lr===0)break e;for(vn=0;Dt=gr[On+vn++],Ot.head&&Dt&&Ot.length<65536&&(Ot.head.name+=String.fromCharCode(Dt)),Dt&&vn>9&1,Ot.head.done=!0),Jt.adler=Ot.check=0,Ot.mode=12;break;case 10:for(;Dr<32;){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>>=7&Dr,Dr-=7&Dr,Ot.mode=27;break}for(;Dr<3;){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>>=1)){case 0:Ot.mode=14;break;case 1:if(wr(Ot),Ot.mode=20,Kr!==6)break;Ir>>>=2,Dr-=2;break e;case 2:Ot.mode=17;break;case 3:Jt.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[On++]<>>16^65535)){Jt.msg="invalid stored block lengths",Ot.mode=30;break}if(Ot.length=65535&Ir,Dr=Ir=0,Ot.mode=15,Kr===6)break e;case 15:Ot.mode=16;case 16:if(vn=Ot.length){if(Lr>>=5,Dr-=5,Ot.ndist=1+(31&Ir),Ir>>>=5,Dr-=5,Ot.ncode=4+(15&Ir),Ir>>>=4,Dr-=4,286>>=3,Dr-=3}for(;Ot.have<19;)Ot.lens[In[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){Jt.msg="invalid code lengths set",Ot.mode=30;break}Ot.have=0,Ot.mode=19;case 19:for(;Ot.have>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>>=jo,Dr-=jo,Ot.lens[Ot.have++]=Zo;else{if(Zo===16){for(ar=jo+2;Dr>>=jo,Dr-=jo,Ot.have===0){Jt.msg="invalid bit length repeat",Ot.mode=30;break}Dt=Ot.lens[Ot.have-1],vn=3+(3&Ir),Ir>>>=2,Dr-=2}else if(Zo===17){for(ar=jo+3;Dr>>=jo)),Ir>>>=3,Dr-=3}else{for(ar=jo+7;Dr>>=jo)),Ir>>>=7,Dr-=7}if(Ot.have+vn>Ot.nlen+Ot.ndist){Jt.msg="invalid bit length repeat",Ot.mode=30;break}for(;vn--;)Ot.lens[Ot.have++]=Dt}}if(Ot.mode===30)break;if(Ot.lens[256]===0){Jt.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){Jt.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){Jt.msg="invalid distances set",Ot.mode=30;break}if(Ot.mode=20,Kr===6)break e;case 20:Ot.mode=21;case 21:if(6<=Lr&&258<=ko){Jt.next_out=en,Jt.avail_out=ko,Jt.next_in=On,Jt.avail_in=Lr,Ot.hold=Ir,Ot.bits=Dr,lt(Jt,tn),en=Jt.next_out,$o=Jt.output,ko=Jt.avail_out,On=Jt.next_in,gr=Jt.input,Lr=Jt.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<>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>Fo)])>>>16&255,Zo=65535&er,!(Fo+(jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>>=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){Jt.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>>=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<>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>Fo)])>>>16&255,Zo=65535&er,!(Fo+(jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[On++]<>>=Fo,Dr-=Fo,Ot.back+=Fo}if(Ir>>>=jo,Dr-=jo,Ot.back+=jo,64&Ko){Jt.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>>=Ot.extra,Dr-=Ot.extra,Ot.back+=Ot.extra}if(Ot.offset>Ot.dmax){Jt.msg="invalid distance too far back",Ot.mode=30;break}Ot.mode=25;case 25:if(ko===0)break e;if(vn=tn-ko,Ot.offset>vn){if((vn=Ot.offset-vn)>Ot.whave&&Ot.sane){Jt.msg="invalid distance too far back",Ot.mode=30;break}zo=vn>Ot.wnext?(vn-=Ot.wnext,Ot.wsize-vn):Ot.wnext-vn,vn>Ot.length&&(vn=Ot.length),Yo=Ot.window}else Yo=$o,zo=en-Ot.offset,vn=Ot.length;for(koFt?(vr=zo[Yo+wt[Kr]],Dr[Zr+wt[Kr]]):(vr=96,0),_t=1<>en)+($t-=_t)]=Wt<<24|vr<<16|wr|0,$t!==0;);for(_t=1<>=1;if(_t!==0?(Ir&=_t-1,Ir+=_t):Ir=0,Kr++,--tn[Jt]==0){if(Jt===gr)break;Jt=st[ct+wt[Kr]]}if($o>>7)]}function Zr(er,_r){er.pending_buf[er.pending++]=255&_r,er.pending_buf[er.pending++]=_r>>>8&255}function tn(er,_r,In){er.bi_valid>vt-In?(er.bi_buf|=_r<>vt-er.bi_valid,er.bi_valid+=In-vt):(er.bi_buf|=_r<>>=1,In<<=1,0<--_r;);return In>>>1}function Yo(er,_r,In){var rn,Yr,Io=new Array(wt+1),Bo=0;for(rn=1;rn<=wt;rn++)Io[rn]=Bo=Bo+In[rn-1]<<1;for(Yr=0;Yr<=_r;Yr++){var Ao=er[2*Yr+1];Ao!==0&&(er[2*Yr]=zo(Io[Ao]++,Ao))}}function jo(er){var _r;for(_r=0;_r>1;1<=In;In--)Fo(er,Io,In);for(Yr=Qo;In=er.heap[1],er.heap[1]=er.heap[er.heap_len--],Fo(er,Io,1),rn=er.heap[1],er.heap[--er.heap_max]=In,er.heap[--er.heap_max]=rn,Io[2*Yr]=Io[2*In]+Io[2*rn],er.depth[Yr]=(er.depth[In]>=er.depth[rn]?er.depth[In]:er.depth[rn])+1,Io[2*In+1]=Io[2*rn+1]=Yr,er.heap[1]=Yr++,Fo(er,Io,1),2<=er.heap_len;);er.heap[--er.heap_max]=er.heap[1],function(_n,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++)_n.bl_count[Xs]=0;for(ga[2*_n.heap[_n.heap_max]+1]=0,Xo=_n.heap_max+1;Xo>=7;Yr>>=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>>3,(Io=er.static_len+3+7>>>3)<=Yr&&(Yr=Io)):Yr=Io=In+5,In+4<=Yr&&_r!==-1?ar(er,_r,In,rn):er.strategy===4||Io===Yr?(tn(er,2+(rn?1:0),3),Js(er,_o,Jt)):(tn(er,4+(rn?1:0),3),function(Ao,Qo,So,_n){var Do;for(tn(Ao,Qo-257,5),tn(Ao,So-1,5),tn(Ao,_n-4,4),Do=0;Do<_n;Do++)tn(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),rn&&Ko(er)},$._tr_tally=function(er,_r,In){return er.pending_buf[er.d_buf+2*er.last_lit]=_r>>>8&255,er.pending_buf[er.d_buf+2*er.last_lit+1]=255&_r,er.pending_buf[er.l_buf+er.last_lit]=255&In,er.last_lit++,_r===0?er.dyn_ltree[2*In]++:(er.matches++,_r--,er.dyn_ltree[2*(Ot[In]+st+1)]++,er.dyn_dtree[2*Dr(_r)]++),er.last_lit===er.lit_bufsize-1},$._tr_align=function(er){tn(er,2,3),vn(er,$t,_o),function(_r){_r.bi_valid===16?(Zr(_r,_r.bi_buf),_r.bi_buf=0,_r.bi_valid=0):8<=_r.bi_valid&&(_r.pending_buf[_r.pending++]=255&_r.bi_buf,_r.bi_buf>>=8,_r.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"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 +*/(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>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>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>>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>>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>>=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.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 "+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&>(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"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>>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&><$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>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>>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>10&1023,_t[pt++]=56320|1023>)}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>>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>>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)-(4Dt.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]&&vrKr&&--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=_r)for(vr=Dt.strstart-Dt.insert,Dt.ins_h=Dt.window[vr],Dt.ins_h=(Dt.ins_h<=_r&&(Dt.ins_h=(Dt.ins_h<=_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<=_r&&(Dt.ins_h=(Dt.ins_h<=_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.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>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.gzindexer&&(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.gzindexer&&(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&&0Kr.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=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<>>=_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)>3,_t&=(1<<($t-=wr<<3))-1,c.next_in=lt,c.next_out=it,c.avail_in=lt>>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=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>>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<>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++]<>>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++]<>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++]<>>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>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++]<>>=7&Dr,Dr-=7&Dr,Ot.mode=27;break}for(;Dr<3;){if(Lr===0)break e;Lr--,Ir+=gr[In++]<>>=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++]<>>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>>=5,Dr-=5,Ot.ndist=1+(31&Ir),Ir>>>=5,Dr-=5,Ot.ncode=4+(15&Ir),Ir>>>=4,Dr-=4,286>>=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>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<>>=jo,Dr-=jo,Ot.lens[Ot.have++]=Zo;else{if(Zo===16){for(ar=jo+2;Dr>>=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>>=jo)),Ir>>>=3,Dr-=3}else{for(ar=jo+7;Dr>>=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<>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<>Fo)])>>>16&255,Zo=65535&er,!(Fo+(jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<>>=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>>=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<>>16&255,Zo=65535&er,!((jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<>Fo)])>>>16&255,Zo=65535&er,!(Fo+(jo=er>>>24)<=Dr);){if(Lr===0)break e;Lr--,Ir+=gr[In++]<>>=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>>=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(koFt?(_r=zo[Yo+wt[Yr]],Dr[Zr+wt[Yr]]):(_r=96,0),_t=1<>en)+($t-=_t)]=Jt<<24|_r<<16|wr|0,$t!==0;);for(_t=1<>=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>>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<>vt-er.bi_valid,er.bi_valid+=_o-vt):(er.bi_buf|=vr<>>=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>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>=7;Kr>>=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>>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>>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"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 @@ -66,9 +66,9 @@ var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}func [`+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=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=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;s0;){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&&(oDATE)&&(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;odaysInYear(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;s0&&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;$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;athis.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;$s.valueOf():s.valueOf()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=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;ec&&(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]||c0,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;alt!==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;$tNt.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:Wt}=o,{preserveWhiteSpace:vr=!0}=o;!Wt&&e.childNodes&&(Wt=needMaskingText(e,nt,at,Wt===void 0));const wr=serializeNode(e,{doc:s,mirror:a,blockClass:$,blockSelector:c,needsMask:Wt,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 _o;a.hasNode(e)?_o=a.getId(e):slimDOMExcluded(wr,ft)||!vr&&wr.type===NodeType.Text&&!wr.isStyle&&!wr.textContent.replace(/^\s+|\s+$/gm,"").length?_o=IGNORED_NODE:_o=genId();const Jt=Object.assign(wr,{id:_o});if(a.add(e,Jt),_o===IGNORED_NODE)return null;vt&&vt(e);let Kr=!lt;if(Jt.type===NodeType.Element){Kr=Kr&&!Jt.needBlock,delete Jt.needBlock;const Ot=e.shadowRoot;Ot&&isNativeShadowDom(Ot)&&(Jt.isShadowHost=!0)}if((Jt.type===NodeType.Document||Jt.type===NodeType.Element)&&Kr){ft.headWhitespace&&Jt.type===NodeType.Element&&Jt.tagName==="head"&&(vr=!1);const Ot={doc:s,mirror:a,blockClass:$,blockSelector:c,needsMask:Wt,maskTextClass:nt,maskTextSelector:at,skipChild:lt,inlineStylesheet:et,maskInputOptions:it,maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft,dataURLOptions:pt,inlineImages:gt,recordCanvas:wt,preserveWhiteSpace:vr,onSerialize:vt,onIframeLoad:_t,iframeLoadTimeout:$t,onStylesheetLoad:Pt,stylesheetLoadTimeout:Nt,keepIframeSrcFn:Lt};if(!(Jt.type===NodeType.Element&&Jt.tagName==="textarea"&&Jt.attributes.value!==void 0))for(const gr of Array.from(e.childNodes)){const $o=serializeNodeWithId(gr,Ot);$o&&Jt.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),Jt.childNodes.push($o))}}return e.parentNode&&isShadowRoot(e.parentNode)&&isNativeShadowDom(e.parentNode)&&(Jt.isShadow=!0),Jt.type===NodeType.Element&&Jt.tagName==="iframe"&&onceIframeLoaded(e,()=>{const Ot=e.contentDocument;if(Ot&&_t){const gr=serializeNodeWithId(Ot,{doc:Ot,mirror:a,blockClass:$,blockSelector:c,needsMask:Wt,maskTextClass:nt,maskTextSelector:at,skipChild:!1,inlineStylesheet:et,maskInputOptions:it,maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft,dataURLOptions:pt,inlineImages:gt,recordCanvas:wt,preserveWhiteSpace:vr,onSerialize:vt,onIframeLoad:_t,iframeLoadTimeout:$t,onStylesheetLoad:Pt,stylesheetLoadTimeout:Nt,keepIframeSrcFn:Lt});gr&&_t(e,gr)}},$t),Jt.type===NodeType.Element&&Jt.tagName==="link"&&typeof Jt.attributes.rel=="string"&&(Jt.attributes.rel==="stylesheet"||Jt.attributes.rel==="preload"&&typeof Jt.attributes.href=="string"&&extractFileExtension(Jt.attributes.href)==="css")&&onceStylesheetLoaded(e,()=>{if(Pt){const Ot=serializeNodeWithId(e,{doc:s,mirror:a,blockClass:$,blockSelector:c,needsMask:Wt,maskTextClass:nt,maskTextSelector:at,skipChild:!1,inlineStylesheet:et,maskInputOptions:it,maskTextFn:st,maskInputFn:ct,slimDOMOptions:ft,dataURLOptions:pt,inlineImages:gt,recordCanvas:wt,preserveWhiteSpace:vr,onSerialize:vt,onIframeLoad:_t,iframeLoadTimeout:$t,onStylesheetLoad:Pt,stylesheetLoadTimeout:Nt,keepIframeSrcFn:Lt});Ot&&Pt(e,Ot)}},Nt),Jt}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 +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;alt!==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;$tNt.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`${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!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 Wt=getInputType($t)||"";Wt==="radio"||Wt==="checkbox"?Ft=$t.checked:(at[Nt.toLowerCase()]||at[Wt])&&(Lt=maskInputValue({element:$t,maskInputOptions:at,tagName:Nt,type:Wt,value:Lt,maskInputFn:lt})),ct($t,it?{text:Lt,isChecked:Ft,userTriggered:Pt}:{text:Lt,isChecked:Ft});const vr=$t.name;Wt==="radio"&&vr&&Ft&&o.querySelectorAll(`input[type="radio"][name="${vr}"]`).forEach(wr=>{if(wr!==$t){const _o=wr.value;ct(wr,it?{text:_o,isChecked:!Ft,userTriggered:!1}:{text:_o,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&>!==-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&>!==-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&>!==-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&>!==-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&>!==-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&<?.isCollapsed)return;nt=lt.isCollapsed||!1;const et=[],it=lt.rangeCount||0;for(let st=0;st{}: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}}/*! ***************************************************************************** +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`${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!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&>!==-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&>!==-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&>!==-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&>!==-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&>!==-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&<?.isCollapsed)return;nt=lt.isCollapsed||!1;const et=[],it=lt.rangeCount||0;for(let st=0;st{}: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 @@ -96,17 +96,17 @@ PERFORMANCE OF THIS SOFTWARE. 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>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__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:Wt=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:vr=!1,collectFonts:wr=!1,inlineImages:_o=!1,plugins:Jt,keepIframeSrcFn:Kr=()=>!1,ignoreCSSAttributes:Ot=new Set([]),errorHandler:gr}=e;registerErrorHandler(gr);const $o=Ft?window.parent===window:!0;let On=!1;if(!$o)try{window.parent.document&&(On=!1)}catch{On=!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 Jt||[])Js.eventProcessor&&(Fo=Js.eventProcessor(Fo));return vt&&!On&&(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(On){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)}))},tn=Fo=>wrappedEmit(wrapEvent({type:EventType$1.IncrementalSnapshot,data:Object.assign({source:IncrementalSource$1.Scroll},Fo)})),vn=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 Jt||[])Fo.getMirror&&Fo.getMirror({nodeMirror:mirror,crossOriginIframeMirror:jo.crossOriginIframeMirror,crossOriginIframeStyleMirror:jo.crossOriginIframeStyleMirror});const Ko=new ProcessedNodeManager;canvasManager=new CanvasManager({recordCanvas:Lt,mutationCb:vn,win:window,blockClass:$,blockSelector:c,mirror,sampling:_t.canvas,dataURLOptions:$t});const Zo=new ShadowDomManager({mutationCb:Zr,scrollCb:tn,bypassOptions:{blockClass:$,blockSelector:c,maskTextClass:lt,maskTextSelector:et,inlineStylesheet:it,maskInputOptions:en,dataURLOptions:$t,maskTextFn:gt,maskInputFn:pt,recordCanvas:Lt,inlineImages:_o,sampling:_t,slimDOMOptions:Lr,iframeManager:jo,stylesheetManager:Yo,canvasManager,keepIframeSrcFn:Kr,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:_o,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:Kr});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:tn,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:vn,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:_o,userTriggeredOnInput:vr,collectFonts:wr,doc:Dt,maskInputFn:pt,maskTextFn:gt,keepIframeSrcFn:Kr,blockSelector:c,slimDOMOptions:Lr,dataURLOptions:$t,mirror,iframeManager:jo,stylesheetManager:Yo,shadowDomManager:Zo,processedNodeManager:Ko,canvasManager,ignoreCSSAttributes:Ot,plugins:((Eo=Jt?.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:{}})),Wt==="DOMContentLoaded"&&Ks()})),Fo.push(on("load",()=>{wrappedEmit(wrapEvent({type:EventType$1.Load,data:{}})),Wt==="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"u"?[]:new Uint8Array(256),a=0;a>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__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="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(it127&&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=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=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-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-1};break;default:Wt=function(vr){return vr.getAttribute(Nt)}}for(wt=[],gt=0,ct=0;ct=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"&<(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&<.removeItem(it),lt.getItem(et)===a&<.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.lengthc.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;nt5&&(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)&<.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&<!==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;otypeof 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(Jt){return!$.current||at.props.enableMultiContainer&&Jt.containerId!==at.props.containerId||c.has(Jt.toastId)&&Jt.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 Wt={...Nt,style:Nt.toastStyle,key:at.toastKey++,...Object.fromEntries(Object.entries(vt).filter(Jt=>{let[Kr,Ot]=Jt;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&&(vr=vt.autoClose,wr=Nt.autoClose,vr===!1||u(vr)&&vr>0?vr:wr),deleteToast(){const Jt=y(c.get(_t),"removed");c.delete(_t),v.emit(4,Jt);const Kr=at.queue.length;if(at.count=_t==null?at.count-at.displayedToast:at.count-1,at.count<0&&(at.count=0),Kr>0){const Ot=_t==null?at.props.limit:1;if(Kr===1||Ot===1)at.displayedToast++,it();else{const gr=Ot>Kr?Kr:Ot;at.displayedToast=gr;for(let $o=0;$oLr in E)(Ot)&&(On=E[Ot](en))),On}(Wt),p(vt.onOpen)&&(Wt.onOpen=vt.onOpen),p(vt.onClose)&&(Wt.onClose=vt.onClose),Wt.closeButton=Nt.closeButton,vt.closeButton===!1||f(vt.closeButton)?Wt.closeButton=vt.closeButton:vt.closeButton===!0&&(Wt.closeButton=!f(Nt.closeButton)||Nt.closeButton);let _o=ft;reactExports.isValidElement(ft)&&!d(ft.type)?_o=reactExports.cloneElement(ft,{closeToast:Lt,toastProps:Wt,data:Pt}):p(ft)&&(_o=ft({closeToast:Lt,toastProps:Wt,data:Pt})),Nt.limit&&Nt.limit>0&&at.count>Nt.limit&&Ft?at.queue.push({toastContent:_o,toastProps:Wt,staleId:wt}):u(gt)?setTimeout(()=>{ct(_o,Wt,wt)},gt):ct(_o,Wt,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&>.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:Wt}=nt.boundingRect;Pt.nativeEvent.type!=="touchend"&&e.pauseOnHover&&nt.x>=Ft&&nt.x<=Wt&&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:Wt,deleteToast:vr,isIn:wr,isLoading:_o,iconOut:Jt,closeOnClick:Kr,theme:Ot}=e,gr=clsx("Toastify__toast",`Toastify__toast-theme--${Ot}`,`Toastify__toast--${et}`,{"Toastify__toast--rtl":Ft},{"Toastify__toast--close-on-click":Kr}),$o=p(pt)?pt({rtl:Ft,position:ft,type:et,defaultClassName:gr}):clsx(gr,pt),On=!!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:vr,position:ft,preventExitTransition:s,nodeRef:a},t.createElement("div",{id:Wt,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},Jt!=null&&t.createElement("div",{className:clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!_o})},Jt),t.createElement("div",null,nt)),Lr,t.createElement(O$1,{...Pt&&!On?{key:`pb-${Pt}`}:{},rtl:Ft,theme:Ot,delay:at,isRunning:o,isIn:wr,closeToast:st,hide:it,type:et,style:$t,className:_t,controlledProgress:On,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 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}`),publishToMarketplace=(e,o)=>api.post("/agent_templates/publish_template/with_executionid",{agent_execution_id:e,price:o}),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]},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"}};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,Wt=Lt.pageY,vr=(Ft-nt)*3,wr=(Wt-lt)*3;s.current.scrollLeft=it-vr,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&>.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:"收回"})]})]})};/*! +`);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=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=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-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-1};break;default:Jt=function(_r){return _r.getAttribute(Nt)}}for(wt=[],gt=0,ct=0;ct=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"&<(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&<.removeItem(it),lt.getItem(et)===a&<.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.lengthc.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;nt5&&(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)&<.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&<!==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;otypeof 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;$oLr 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&>.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{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&>.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{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{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{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{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{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"&<===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;${(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 Hy{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 Hy(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]{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{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._flushBatchSize||e-this._flushTime>=this._flushIntervalInMilliseconds){for(let o=this._flushPointer;this._flushPointerperformance.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>>=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||360)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{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>>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<=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<>>32-e,this.unsigned):J(0,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<>>o,this.high<>>o,this.unsigned)):(e-=32,o=32-e,J(this.high<>>o,this.low<>>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<>>e,this.low<>>e,this.unsigned)):(e-=32,o=32-e,J(this.low<>>e,this.high<>>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=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=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=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>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>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{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{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>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;ct1)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{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;c191&&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>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-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>>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)<>>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)<>>0,this.buf[this.pos++]<128)return ft}return ft.lo=(ft.lo|(this.buf[this.pos++]&127)<>>0,ft}if(this.len-this.pos>4){for(;pt<5;++pt)if(ft.hi=(ft.hi|(this.buf[this.pos]&127)<>>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)<>>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>>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>>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>>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=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>>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>>0,et.ints[ft].high>>>0).toNumber():et.ints[ft]}if(et.strings&&et.strings.length){st.strings=[];for(var ft=0;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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>3){case 1:{if(ct.dims&&ct.dims.length||(ct.dims=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos>>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=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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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{wn(),qo(),ot=rr(sr()),We(),Me=class{static arraysEqual(e,o){if(e.length!==o.length)return!1;for(let s=0;s1&&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=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;c1&&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;ao.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=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=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[$]=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;$=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=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?a.push(s[at+2]):a[at]=s[at+2];for(let at=0;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{qu=rr(Fs()),qo(),Pr(),H=rr(sr()),Y(),si=F.experimental.fbs,bt=class Ru{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 Ru(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;et0){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;ettypeof 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{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{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{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{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{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"&<===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;${(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]{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{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._flushBatchSize||e-this._flushTime>=this._flushIntervalInMilliseconds){for(let o=this._flushPointer;this._flushPointerperformance.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>>=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||360)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{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>>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<=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<>>32-e,this.unsigned):J(0,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<>>o,this.high<>>o,this.unsigned)):(e-=32,o=32-e,J(this.high<>>o,this.low<>>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<>>e,this.low<>>e,this.unsigned)):(e-=32,o=32-e,J(this.low<>>e,this.high<>>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=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=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=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>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>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{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{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>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;ct1)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{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;c191&&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>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-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>>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)<>>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)<>>0,this.buf[this.pos++]<128)return ft}return ft.lo=(ft.lo|(this.buf[this.pos++]&127)<>>0,ft}if(this.len-this.pos>4){for(;pt<5;++pt)if(ft.hi=(ft.hi|(this.buf[this.pos]&127)<>>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)<>>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>>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>>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>>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=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>>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>>0,et.ints[ft].high>>>0).toNumber():et.ints[ft]}if(et.strings&&et.strings.length){st.strings=[];for(var ft=0;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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>3){case 1:{if(ct.dims&&ct.dims.length||(ct.dims=[]),(ft&7)===2)for(var pt=et.uint32()+et.pos;et.pos>>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=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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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{wn(),qo(),ot=rr(sr()),We(),Me=class{static arraysEqual(e,o){if(e.length!==o.length)return!1;for(let s=0;s1&&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=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;c1&&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;ao.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=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=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[$]=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;$=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=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?a.push(s[at+2]):a[at]=s[at+2];for(let at=0;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{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;et0){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{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)})`,Wt=et?"":`${gt} rc = +}`}function Cm(e,o){let s="";for(let a=0;a{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; - `,vr=` + `,_r=` ${Nt} ${Pt} ${_t} void main() { - ${Wt} + ${Jt} vec4 value = vec4(0); for (int i = 0; i < ${st}; i++) { @@ -725,7 +725,7 @@ vec4 getBAtOutCoordsMatmul(int i) { ${c} ${$t} ${pt.output} = value; - }`;return{...o,output:{dims:lt,type:s[0].type,textureType:2},shaderSource:vr,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=` + }`;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]}; @@ -1902,10 +1902,10 @@ ${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{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;othis.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{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.sizebt.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{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;$"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;$"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;$"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;$"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._allData[$]._from=-2});this._nodes.splice(s,this._nodes.length-s);for(let a=0;a=0)$._to[c]=o[$._to[c]];else throw new Error("Trying to update a removed node")}e=0;for(let a=0;a0){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;nt0)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;nt0)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;${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;${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 _o.buffer!=Ot.buffer&&Ir(),Ot}function s(){return _o.buffer!=Ot.buffer&&Ir(),gr}function a(){return _o.buffer!=Ot.buffer&&Ir(),$o}function $(){return _o.buffer!=Ot.buffer&&Ir(),On}function c(){return _o.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,Wt=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 nn=[];self.onmessage=Po=>nn.push(Po),self.startWorker=()=>{postMessage({cmd:"loaded"});for(let Po of nn)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"&&(Wt=lt[Po]));_o=Er.wasmMemory,Ir(),vr(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(nn){if(nn!="unwind")throw nn}}else Qr==="cancel"?hu()&&Pu(-1):Er.target!=="setimmediate"&&(Qr==="checkMailbox"?wr&&Ou():Qr&&(Wt(`worker: received unknown command ${Qr}`),Wt(Er)))}catch(nn){throw Ny(),nn}};var vr,wr=!1;Wt=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=>{vr=nn=>{nn=new WebAssembly.Instance(nn,Dt()),Er(nn),Qr()}}),self.onunhandledrejection=tr=>{throw tr.reason||tr},self.onmessage=Mt}lt.wasmBinary&&(Pt=lt.wasmBinary);var _o,Jt,Kr,Ot,gr,$o,On,en,Lr,ko=!1;function Ir(){var Mt=_o.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=On=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(!((_o=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0})).buffer instanceof gt))throw Wt("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=[],tn=[],vn=0,zo=null;function Yo(){if(--vn==0&&zo){var Mt=zo;zo=null,Mt()}}function jo(Mt){throw Wt(Mt="Aborted("+Mt+")"),ko=!0,Kr=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(nn=>{if(!nn.ok)throw`failed to load wasm binary file at '${Qr}'`;return nn.arrayBuffer()}).catch(()=>Js(Qr));if(ft)return new Promise((nn,Po)=>{ft(Qr,qs=>nn(new Uint8Array(qs)),Po)})}return Promise.resolve().then(()=>Js(Qr))}(Mt).then(Qr=>WebAssembly.instantiate(Qr,tr)).then(Er,Qr=>{Wt(`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:_o,r:Yr,N:Cy,c:y1}}}var Eo={836900:(Mt,tr,Er,Qr,nn)=>{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(nn){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=()=>{}},_r=Mt=>{Ao.length==0&&(Jo(),Lo(Ao[0]));var tr=Ao.pop();if(!tr)return 6;Qo.push(tr),_n[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},In=0,rn=(Mt,tr,...Er)=>{for(var Qr=2*Er.length,nn=ty(),Po=ey(8*Qr),qs=Po>>>3,xa=0;xa>>0]=tu)}return Mt=My(Mt,0,Qr,Po,tr),Du(nn),Mt};function Yr(Mt){if(ct)return rn(0,1,Mt);if(Kr=Mt,!(0{if(Kr=Mt,ct)throw Io(Mt),"unwind";Yr(Mt)},Ao=[],Qo=[],So=[],_n={},Do=Mt=>{var tr=Mt.Ra;delete _n[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=nn=>{var Po=(nn=nn.data).cmd;if(nn.targetThread&&nn.targetThread!=hu()){var qs=_n[nn.targetThread];qs?qs.postMessage(nn,nn.transferList):Wt(`Internal error! Worker sent a message "${Po}" to target pthread ${nn.targetThread}, but that thread no longer exists!`)}else Po==="checkMailbox"?Ou():Po==="spawnThread"?_r(nn):Po==="cleanupThread"?Do(_n[nn.thread]):Po==="killThread"?(nn=nn.thread,Po=_n[nn],delete _n[nn],er(Po),Om(nn),Qo.splice(Qo.indexOf(Po),1),Po.Ra=0):Po==="cancelThread"?_n[nn.thread].postMessage({cmd:"cancel"}):Po==="loaded"?(Mt.loaded=!0,tr(Mt)):Po==="alert"?alert(`Thread ${nn.threadId}: ${nn.text}`):nn.target==="setimmediate"?Mt.postMessage(nn):Po==="callHandler"?lt[nn.handler](...nn.args):Po&&Wt(`worker sent an unknown command ${Po}`)},Mt.onerror=nn=>{throw Wt(`worker sent an error! ${nn.filename}:${nn.lineno}: ${nn.message}`),nn};var Er,Qr=[];for(Er of[])lt.hasOwnProperty(Er)&&Qr.push(Er);Mt.postMessage({cmd:"load",handlers:Qr,wasmMemory:_o,wasmModule:Jt})});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{var Mt=hu(),tr=$()[Mt+52>>>2>>>0];Mt=$()[Mt+56>>>2>>>0],Ly(tr,tr-Mt),Du(tr)},ga=[],eu=(Mt,tr)=>{In=0;var Er=ga[Mt];Er||(Mt>=ga.length&&(ga.length=Mt+1),ga[Mt]=Er=Xs.get(Mt)),Mt=Er(tr),0>>=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?rn(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 Wt("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var nn=[];return ct&&nn.length===0?Tu(Mt,tr,Er,Qr):(Mt={cb:Er,Ra:Mt,ab:Qr,ib:nn},ct?(Mt.Za="spawnThread",postMessage(Mt,nn),0):_r(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(nn=(240&nn)==224?(15&nn)<<12|Po<<6|qs:(7&nn)<<18|Po<<12|qs<<6|63&Mt[tr++])?Qr+=String.fromCharCode(nn):(nn-=65536,Qr+=String.fromCharCode(55296|nn>>10,56320|1023&nn))}}else Qr+=String.fromCharCode(nn)}return Qr},_u=(Mt,tr)=>(Mt>>>=0)?uu(s(),Mt,tr):"";function iy(Mt,tr,Er){return ct?rn(3,1,Mt,tr,Er):0}function oy(Mt,tr){if(ct)return rn(4,1,Mt,tr)}var sy=Mt=>{for(var tr=0,Er=0;Er=Qr?tr++:2047>=Qr?tr+=2:55296<=Qr&&57343>=Qr?(tr+=4,++Er):tr+=3}return tr},ay=(Mt,tr,Er,Qr)=>{if(!(0>>=0;Qr=Er+Qr-1;for(var Po=0;Po=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-nn},bu=(Mt,tr,Er)=>ay(Mt,s(),tr,Er);function ly(Mt,tr){if(ct)return rn(5,1,Mt,tr)}function uy(Mt,tr,Er){if(ct)return rn(6,1,Mt,tr,Er)}function cy(Mt,tr,Er){return ct?rn(7,1,Mt,tr,Er):0}function dy(Mt,tr){if(ct)return rn(8,1,Mt,tr)}function fy(Mt,tr,Er){if(ct)return rn(9,1,Mt,tr,Er)}function py(Mt,tr,Er,Qr){if(ct)return rn(10,1,Mt,tr,Er,Qr)}function hy(Mt,tr,Er,Qr){if(ct)return rn(11,1,Mt,tr,Er,Qr)}function my(Mt,tr,Er,Qr){if(ct)return rn(12,1,Mt,tr,Er,Qr)}function gy(Mt){if(ct)return rn(13,1,Mt)}function yy(Mt,tr){if(ct)return rn(14,1,Mt,tr)}function _y(Mt,tr,Er){if(ct)return rn(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>>=0)==tr>>>0?setTimeout(Ou):ct?postMessage({targetThread:Mt,cmd:"checkMailbox"}):(Mt=_n[Mt])&&Mt.postMessage({cmd:"checkMailbox"})}var Bu=[];function Xy(Mt,tr,Er,Qr,nn){for(tr>>>=0,Qr/=2,Bu.length=Qr,Er=nn>>>0>>>3,nn=0;nn>>0];return(tr?Eo[tr]:_1[Mt])(...Bu)}function Qy(Mt){Mt>>>=0,ct?postMessage({cmd:"cleanupThread",thread:Mt}):Do(_n[Mt])}function Zy(Mt){}function Jy(Mt,tr){Mt=-9007199254740992>Mt||9007199254740992>>=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>>=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(),nn=new Date(tr.getFullYear(),6,1).getTimezoneOffset(),Po=new Date(tr.getFullYear(),0,1).getTimezoneOffset(),qs=Math.min(Po,nn);return 0>Er?a()[Mt+32>>>2>>>0]=+(nn!=Po&&qs==Qr):0>>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,nn,Po,qs){return ct?rn(16,1,Mt,tr,Er,Qr,nn,Po,qs):-52}function xy(Mt,tr,Er,Qr,nn,Po){if(ct)return rn(17,1,Mt,tr,Er,Qr,nn,Po)}function r1(Mt,tr,Er,Qr){Mt>>>=0,tr>>>=0,Er>>>=0,Qr>>>=0;var nn=new Date().getFullYear(),Po=new Date(nn,0,1),qs=new Date(nn,6,1);nn=Po.getTimezoneOffset();var xa=qs.getTimezoneOffset(),tu=Math.max(nn,xa);$()[Mt>>>2>>>0]=60*tu,a()[tr>>>2>>>0]=+(nn!=xa),Po=(Mt=ru=>ru.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1])(Po),qs=Mt(qs),xa>>=0,tr>>>=0,Er>>>=0,Uu.length=0;for(var Qr;Qr=s()[tr++>>>0];){var nn=Qr!=105;Er+=(nn&=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+=nn?8:4}return Eo[Mt](...Uu)}var i1=()=>{},o1=()=>Date.now();function s1(Mt,tr){return Wt(_u(Mt>>>0,tr>>>0))}var $y,a1=()=>{throw In+=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=Er;Er*=2){var Qr=tr*(1+.2/Er);Qr=Math.min(Qr,Mt+100663296);var nn=Math;Qr=Math.max(Mt,Qr);e:{nn=(nn.min.call(nn,4294901760,Qr+(65536-Qr%65536)%65536)-_o.buffer.byteLength+65535)/65536;try{_o.grow(nn),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(` +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;${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;${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>>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{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(_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=Qr?tr++:2047>=Qr?tr+=2:55296<=Qr&&57343>=Qr?(tr+=4,++Er):tr+=3}return tr},ay=(Mt,tr,Er,Qr)=>{if(!(0>>=0;Qr=Er+Qr-1;for(var Po=0;Po=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>>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>>=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>>=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>>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=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 nn=3;Qr[nn]&&Iu()!=Mt;)++nn;for(Mt=0;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 rn(18,1,Mt,tr);Mt>>>=0,tr>>>=0;var Er=0;return Sy().forEach((Qr,nn)=>{var Po=tr+Er;for(nn=$()[Mt+4*nn>>>2>>>0]=Po,Po=0;Po>>0]=Qr.charCodeAt(Po);o()[nn>>>0]=0,Er+=Qr.length+1}),0}function ky(Mt,tr){if(ct)return rn(19,1,Mt,tr);Mt>>>=0,tr>>>=0;var Er=Sy();$()[Mt>>>2>>>0]=Er.length;var Qr=0;return Er.forEach(nn=>Qr+=nn.length+1),$()[tr>>>2>>>0]=Qr,0}function Oy(Mt){return ct?rn(20,1,Mt):52}function Iy(Mt,tr,Er,Qr){return ct?rn(21,1,Mt,tr,Er,Qr):52}function Ay(Mt,tr,Er,Qr){return ct?rn(22,1,Mt,tr,Er,Qr):70}var m1=[null,[],[]];function Py(Mt,tr,Er,Qr){if(ct)return rn(23,1,Mt,tr,Er,Qr);tr>>>=0,Er>>>=0,Qr>>>=0;for(var nn=0,Po=0;Po>>2>>>0],xa=$()[tr+4>>>2>>>0];tr+=8;for(var tu=0;tu>>0],nu=m1[Mt];ru===0||ru===10?((Mt===1?Ft:Wt)(uu(nu,0)),nu.length=0):nu.push(ru)}nn+=xa}return $()[Qr>>>2>>>0]=nn,0}var Dy=[31,29,31,30,31,30,31,31,30,31,30,31],Ry=[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 nn(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 nn(Oo,_a,"0")}function qs(Oo,_a){function $a(zy){return 0>zy?-1:0fu-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=>nn(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{for(var _a=0,$a=0;$a<=Oo.Wa-1;_a+=(pu(Oo.Ta+1900)?Dy:Ry)[$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(()=>{vn++,function(tr){ct?tr():Promise.all(Ao.map(Lo)).then(tr)}(()=>Yo())})}();var _1=[Yr,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 nn=Zs,Po=xa=>()=>xa()>>>0,qs=xa=>tu=>xa(tu)>>>0;return(nn=Object.assign({},nn)).Ba=Po(nn.Ba),nn.Ca=qs(nn.Ca),nn.emscripten_main_runtime_thread_id=Po(nn.emscripten_main_runtime_thread_id),nn.Oa=qs(nn.Oa),nn.Pa=Po(nn.Pa),nn}(),So.push(Zs.Ea),Xs=Zs.Fa,Zr.unshift(Zs.$),Jt=Qr,Yo(),Zs}var tr=Dt();if(vn++,lt.instantiateWasm)try{return lt.instantiateWasm(tr,Mt)}catch(Er){Wt(`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 nn=Ko;return Pt||typeof WebAssembly.instantiateStreaming!="function"||Zo(nn)||Fo(nn)||typeof fetch!="function"?Ks(nn,Er,Qr):fetch(nn,{credentials:"same-origin"}).then(Po=>WebAssembly.instantiateStreaming(Po,Er).then(Qr,function(qs){return Wt(`wasm streaming compile failed: ${qs}`),Wt("falling back to ArrayBuffer instantiation"),Ks(nn,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,nn,Po,qs,xa,tu,ru)=>(lt._OrtCreateSessionOptions=Zs.ca)(Mt,tr,Er,Qr,nn,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,nn,Po)=>(lt._OrtCreateTensor=Zs.na)(Mt,tr,Er,Qr,nn,Po),lt._OrtGetTensorData=(Mt,tr,Er,Qr,nn)=>(lt._OrtGetTensorData=Zs.oa)(Mt,tr,Er,Qr,nn),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,nn)=>(lt._OrtRunWithBinding=Zs.ya)(Mt,tr,Er,Qr,nn),lt._OrtRun=(Mt,tr,Er,Qr,nn,Po,qs,xa)=>(lt._OrtRun=Zs.za)(Mt,tr,Er,Qr,nn,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,nn,Po)=>(_d=Zs.Ga)(Mt,tr,Er,Qr,nn,Po),Ny=()=>(Ny=Zs.Ha)(),My=(Mt,tr,Er,Qr,nn)=>(My=Zs.Ia)(Mt,tr,Er,Qr,nn),Om=Mt=>(Om=Zs.Ja)(Mt),Pu=Mt=>(Pu=Zs.Ka)(Mt),jy=()=>(jy=Zs.La)(),Ly=(Mt,tr)=>(Ly=Zs.Ma)(Mt,tr),Du=Mt=>(Du=Zs.Na)(Mt),ey=Mt=>(ey=Zs.Oa)(Mt),ty=()=>(ty=Zs.Pa)();function Fy(){0ty(),lt.stackRestore=Mt=>Du(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$._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;wtnt.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),Wt=nt.stackAlloc(pt*4);try{nt.jsepOnRunStart?.(lt),[gt,wt]=jp(c);for(let gr=0;grKo*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;Fo0){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(On),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(vr=>nt._OrtReleaseTensor(vr)),_t.forEach(vr=>nt._OrtReleaseTensor(vr)),$t.forEach(vr=>nt._free(vr)),gt!==0&&nt._OrtReleaseRunOptions(gt),wt.forEach(vr=>nt._free(vr))}},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;stvo,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: +`))[0]=="Error"&&Qr.shift(),Ey(Qr);for(var _n=3;Qr[_n]&&Iu()!=Mt;)++_n;for(Mt=0;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>>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>>2>>>0],xa=$()[tr+4>>>2>>>0];tr+=8;for(var tu=0;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:0fu-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{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(){0ty(),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$._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;wtnt.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;grKo*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;Fo0){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;stvo,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: (** @@ -1927,7 +1927,7 @@ long/index.js: * * 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;ctreactExports.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),On=0;On-1?gr:Ot}function Wt(Ot,gr){gr=gr||{};var $o=gr.body;if(Ot instanceof Wt){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)}Wt.prototype.clone=function(){return new Wt(this,{body:this._bodyInit})};function vr(Ot){var gr=new FormData;return Ot.trim().split("&").forEach(function($o){if($o){var On=$o.split("="),en=On.shift().replace(/\+/g," "),Lr=On.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(On){var en=On.split(":"),Lr=en.shift().trim();if(Lr){var ko=en.join(":").trim();gr.append(Lr,ko)}}),gr}Nt.call(Wt.prototype);function _o(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(_o.prototype),_o.prototype.clone=function(){return new _o(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new pt(this.headers),url:this.url})},_o.error=function(){var Ot=new _o(null,{status:0,statusText:""});return Ot.type="error",Ot};var Jt=[301,302,303,307,308];_o.redirect=function(Ot,gr){if(Jt.indexOf(gr)===-1)throw new RangeError("Invalid status code");return new _o(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 On=Error(gr);this.stack=On.stack},nt.DOMException.prototype=Object.create(Error.prototype),nt.DOMException.prototype.constructor=nt.DOMException}function Kr(Ot,gr){return new Promise(function($o,On){var en=new Wt(Ot,gr);if(en.signal&&en.signal.aborted)return On(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 _o(Dr,Ir))},Lr.onerror=function(){On(new TypeError("Network request failed"))},Lr.ontimeout=function(){On(new TypeError("Network request failed"))},Lr.onabort=function(){On(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 Kr.polyfill=!0,c.fetch||(c.fetch=Kr,c.Headers=pt,c.Request=Wt,c.Response=_o),nt.Headers=pt,nt.Request=Wt,nt.Response=_o,nt.fetch=Kr,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={"=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":">",'"':""","'":"'","`":"`"},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+=`'+ +*/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;ctreactExports.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-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={"=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":">",'"':""","'":"'","`":"`"},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)+ @@ -1939,4 +1939,4 @@ __p+='`),et}),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;$1)flatten$1(at,o-1,s,a),$=a.length;else for(var lt=0,et=at.length;lto?(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;c0?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);c0?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&&c0?0:at-1;for(c||($=s[nt?nt[lt]:lt],lt+=e);lt>=0&<=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;ata&&(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;atat||nt===void 0)return 1;if(nt1&&(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;$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"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),[Wt,vr]=reactExports.useState(null),[wr,_o]=reactExports.useState(null),[Jt,Kr]=reactExports.useState(null),[Ot,gr]=reactExports.useState(null),[$o,On]=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 _n=document.createElement("script");_n.src=`${WEB_SITE}/assets/opencv.js`,_n.async=!0,_n.onload=()=>{console.log("OpenCV.js loaded")},document.body.appendChild(_n)})()},[]),reactExports.useEffect(()=>{},[]),reactExports.useEffect(()=>{console.log("new source iamge id",a);const So={};Dr.current=So,(!a||et)&&(Kr(generateUniqueFilename("_embeddings.npy")),gr(generateUniqueFilename("_mask.png")),it(null),ct(null),$t(null),nt([]),Nt({}),pt(null),lt(null),vt(null),vr(null)),a&&getLocalResourceURL(a,$).then(_n=>{if(Dr.current!=So){console.log("cancel executions.",a);return}if(_o(_n.url),vn(_n.url),(!e.value||!e.value[1]||!e.value[1].name||$o)&&Zo(new URL(_n.url),So),Dr.current!=So){console.log("cancel executions.",a);return}On(a)})},[a]),reactExports.useEffect(()=>{const So={};Zr.current=So,(async Do=>{if(!Lt&&!Wt&&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}vr(Lo.file),tn(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},_n=new ResizeObserver(Do=>{for(const Xo of Do)Xo.target===document.body&&So()});return So(),_n.observe(document.body),()=>{_n.unobserve(document.body)}},[et]);const tn=async So=>{if(So)try{const _n=await Yo(So),Do=await Js(_n,"float32");vt(Do)}catch(_n){alert("internal error"),console.error("Failed to load tensor:",_n)}},vn=async So=>{try{if(!So)return;const _n=new Image;_n.src=new URL(So).href,_n.onload=()=>{const{height:Do,width:Xo,samScale:Lo}=Fo(_n);$t({height:Do,width:Xo,samScale:Lo}),_n.width=Xo,_n.height=Do,it(_n)}}catch(_n){console.log(_n)}},zo=async So=>{try{if(!So){ct(null);return}const _n=new Image;_n.src=new URL(So).href,_n.onload=()=>{ct(_n)}}catch(_n){console.log(_n)}};function Yo(So){return new Promise((_n,Do)=>{const Xo=new FileReader;Xo.onload=Lo=>{_n(Lo.target.result)},Xo.onerror=Lo=>{Do(Lo)},Xo.readAsArrayBuffer(So)})}async function jo(So,_n){try{const Do=new Blob([So],{type:"application/octet-stream"}),Xo=Jt,Lo=new File([Do],Xo,{type:"application/octet-stream"});if(Dr.current!==_n){console.log("canceld:",Lo);return}if(vr(Lo),tn(Lo),Dr.current!==_n){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 _n=await fetch(So).then(Lo=>Lo.blob()),Do=new File([_n],"mask.png",{type:"image/png"}),Xo=new FormData;return Xo.append("file",_n),Xo.append("name",Do.name),Xo.append("size",Do.size),Xo.append("type",Do.type),Xo},Zo=async(So,_n)=>{const Do=await Ko(So);let Xo=0;for(;Xo<3;){try{if(Dr.current!==_n)return;let Lo=await fetch(`${MARKETPLACE_SITE}${ko}/getembeddings_refined`,{method:"POST",body:Do});if(Lo.ok){const Jo=await Lo.arrayBuffer();jo(Jo,_n);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,_n)=>{const Xo=await new npyjs().load(So);return new yt(_n,Xo.data,Xo.shape)};reactExports.useEffect(()=>{if(c){const So=In();if(So){const _n=rn(So);_n.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(_n,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,Wt]}})}},"image/png")},ct(_n)}else ct(null)}},[c]),reactExports.useEffect(()=>{if(!at){pt(null);return}if(gt===null||wt===null||_t===null)return;(async()=>{const _n=await ar({x:at.x,y:at.y}),Do=rn(_n);pt(Do)})()},[at]),reactExports.useEffect(()=>{if(!st)return;const So=new window.Image;So.src=st.src,So.onload=()=>{const _n=en.current;if(!_n)return;const Do=_n.getContext("2d");_n.width=So.width,_n.height=So.height,Do.drawImage(So,0,0);const Xo=Do.getImageData(0,0,_n.width,_n.height),Lo=Xo.data;for(let Jo=0;Jo{if(So.preventDefault(),!st)return;const _n=document.createElement("canvas");_n.width=st.width,_n.height=st.height;const Do=_n.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{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 _n=So.currentTarget.getBoundingClientRect(),Do=(So.clientX-_n.left)*(_t.width/_n.width),Xo=(So.clientY-_n.top)*(_t.height/_n.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,_n,Do=1)=>({x:So,y:_n,clickType:Do}),ar=async({x:So,y:_n})=>{try{if(gt===null||wt===null||_t===null)return;const Do=[Jr(So,_n)],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,_n,Do){const[Xo,Lo,Jo,Xs]=[0,114,189,255],na=new Uint8ClampedArray(4*_n*Do).fill(0);for(let ba=0;ba0&&(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,_n)}function _r(So){const _n=document.createElement("canvas");return _n.width=So.width,_n.height=So.height,_n.getContext("2d").putImageData(So,0,0),_n}const In=()=>{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,_n=et.height,Do=document.createElement("canvas");Do.getContext("2d"),Do.width=So,Do.height=_n;const Xo=new Uint8ClampedArray(4*So*_n).fill(0);return Object.entries(Pt).forEach(([Jo,Xs])=>{const ba=_r(Xs).getContext("2d").getImageData(0,0,So,_n).data,ga=parseInt(Jo.split(",")[2]);if(ga===-1)for(let eu=0;eu0&&(Xo[eu+3]=0);else if(ga===1)for(let eu=0;eu0&&(Xo[eu+3]=255)}),new ImageData(Xo,So,_n)};function rn(So){const _n=_r(So),Do=new Image;return Do.src=_n.toDataURL(),Do}const Yr=So=>{if(So.preventDefault(),!st)return;const _n=document.createElement("canvas"),Do=_n.getContext("2d");if(_n.width=st.width,_n.height=st.height,Do.fillStyle="white",Do.fillRect(0,0,_n.width,_n.height),Do.drawImage(st,0,0),window.cv)try{const Xo=window.cv.imread(_n),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(_n,ga);const eu=_n.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),_n.toBlob(Lo=>{let Jo=generateUniqueFilename("mask.png");FileSaver_minExports.saveAs(Lo,Jo)},"image/png")}};function Io(So){const _n=atob(So.split(",")[1]),Do=new Array(_n.length);for(let Lo=0;Lo<_n.length;Lo++)Do[Lo]=_n.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,Wt]}})},Ao=_.throttle(So=>{if(gt===null||wt===null||_t===null)return;let _n=So.nativeEvent.target;const Do=_n.getBoundingClientRect();let Xo=So.clientX-Do.left,Lo=So.clientY-Do.top;const Jo=et?et.width/_n.offsetWidth:1;Xo*=Jo,Lo*=Jo;const Xs=Jr(Xo,Lo);Xs&<(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&>&&_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:Yr,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,Wt]=reactExports.useState(null),vr=Zr=>{if(Zr){const tn=e.accept.split(","),vn=Zr.name.split(".").pop().toLowerCase();if(tn==""||tn.includes(`.${vn}`)){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 tn=o/1.5/Zr.width,vn=s/1.5/Zr.height,zo=Math.min(vn,tn),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}),Wt(Yo),Nt(zo),et(!0),$t(Zr)}},[o,s,a]);const _o=Zr=>{Zr.preventDefault(),Ft&&(at(Ft),st({x:Ft.x,y:Ft.y,width:Ft.width,height:Ft.height}))},Jt=(Zr,tn)=>{const zo=tn.height/15,Yo=tn.width/15;for(let jo=0;jo{const tn=o/_t.width,vn=s/_t.height,zo=_t.width*tn,Yo=_t.height*vn;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,tn=Zr.getContext("2d");Zr.width=o,Zr.height=s,Jt(tn,Zr)},[]);const Ot=Zr=>{Zr.preventDefault(),Zr.stopPropagation();const vn=.01*(1024/_t.width),zo=Zr.clientX-c.current.getBoundingClientRect().left,Yo=Zr.clientY-c.current.getBoundingClientRect().top,jo=Zr.deltaY>0?-vn:vn;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 tn={x:Zr.clientX-c.current.getBoundingClientRect().left,y:Zr.clientY-c.current.getBoundingClientRect().top},vn=8;if(Math.abs(tn.x-it.x){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 tn=Zr.clientX-c.current.getBoundingClientRect().left,vn=Zr.clientY-c.current.getBoundingClientRect().top,zo=tn+pt.x,Yo=vn+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}})},On=()=>{ft(!1),vt(!1)};reactExports.useEffect(()=>{if(lt&&nt){const Zr=c.current,tn=Zr.getContext("2d");tn.clearRect(0,0,Zr.width,Zr.height),Jt(tn,Zr),tn.drawImage(nt.image,nt.x,nt.y,nt.width,nt.height),en(tn),Kr(tn)}},[nt,lt,it]);const en=Zr=>{const tn=c.current;Zr.clearRect(0,0,tn.width,tn.height),Jt(Zr,tn),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 vn=8;Zr.fillStyle="blue",Zr.fillRect(it.x-vn/2,it.y-vn/2,vn,vn),Zr.fillRect(it.x+it.width-vn/2,it.y-vn/2,vn,vn),Zr.fillRect(it.x-vn/2,it.y+it.height-vn/2,vn,vn),Zr.fillRect(it.x+it.width-vn/2,it.y+it.height-vn/2,vn,vn)};function Lr(Zr,tn){const vn=document.createElement("canvas"),zo=vn.getContext("2d");return vn.width=Zr.width/tn,vn.height=Zr.height/tn,zo.drawImage(Zr,0,0,vn.width,vn.height),vn}const ko=Zr=>{Zr.preventDefault();const tn=document.createElement("canvas"),vn=tn.getContext("2d");tn.width=Math.round(it.width/Pt),tn.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;vn.drawImage(Yo,0,0,jo,Ko,Zo,Fo,jo,Ko),tn.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 tn=document.createElement("canvas"),vn=tn.getContext("2d");tn.width=Math.round(it.width/Pt),tn.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;vn.drawImage(Yo,0,0,jo,Ko,Zo,Fo,jo,Ko),tn.toBlob(Js=>{URL.createObjectURL(Js),document.createElement("a");const Ks=Dr("edited_.png"),Dt=new File([Js],Ks,{type:"image/png"});vr(Dt)},"image/png")};function Dr(Zr){const tn=new Date,vn=tn.getFullYear()+("0"+(tn.getMonth()+1)).slice(-2)+("0"+tn.getDate()).slice(-2)+"_"+("0"+tn.getHours()).slice(-2)+("0"+tn.getMinutes()).slice(-2)+("0"+tn.getSeconds()).slice(-2),zo=v4().replace(/-/g,""),Yo=`${vn}_${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:On}),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=>_o(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(Wt=>Wt.maskSourceUrl===e[_t].name);let Lt=null;Nt>=0&&(Lt=null);const Ft=await Promise.all(e.map(async(Wt,vr)=>{try{if(_t===vr||vr==Nt)if(Wt.type==="file"||Wt.type==="combo_image_selection"||Wt.type==="image_editer"){if($t===void 0||$t==null){const{value:wr,..._o}=Wt;Wt=_o}else if($t.target.files[0])try{let wr=$t.target.files[0];const _o=URL.createObjectURL(wr);if(wr.type.startsWith("image/")){const Jt=await loadImage(_o),{height:Kr,width:Ot,samScale:gr}=handleImageScale(Jt);wr=await resizeImage(Jt,Ot,Kr,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(_o),Wt={...Wt,value:wr}}catch(wr){throw console.error("Error processing image:",wr),URL.revokeObjectURL(objectURL),wr}return Wt}else if(Wt.type==="mask")if(vr==Nt&&($t=Lt),$t)if($t.target.files.length>0){let wr=[];for(let _o=0;_o<$t.target.files.length;_o++){const Jt=$t.target.files[_o];if(Jt){const Kr={file:Jt,name:Jt.name,size:Jt.size,type:Jt.type},Ot=`${Kr.name}_${Kr.type}_${Kr.size}`;await saveFile(Kr.file,Ot),wr.push(Kr)}else Jt==""?wr.push(Wt.value?.[_o]):wr.push(null)}return Wt={...Wt,value:wr},Wt}else return Wt;else return Wt={...Wt,value:[null,null]},Wt;else if(Wt.type==="workflow"){if(vr==Nt)if($t)try{$t=await ct($t.target.files[0])}catch(wr){console.error("workflow is error:",wr),$t=[]}else $t=[];return Wt={...Wt,value:$t},Wt}else return Wt={...Wt,value:$t},Wt;return Wt}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(Wt=>Wt.maskSourceUrl===_t.name);nt(Wt=>{const vr=[...Wt];return vr[$t]=Lt,Ft>=0&&(vr[Ft]=`${_t.value.name}_${_t.value.type}_${_t.value.size}`),vr})}}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(Wt=>Wt.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 Wt=(Nt.options||Nt.default||"").split(",")[0].trim();return{...Nt,value:Wt}}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:Wt=>st(Ft,Wt.target.value),onInput:Wt=>{Wt.target.style.height="auto",Wt.target.style.height=Wt.target.scrollHeight+"px"},onFocus:Wt=>{Wt.target.style.height="auto",Wt.target.style.height=Wt.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:Wt=>st(Ft,Wt.target.value),children:(()=>{try{const Wt=JSON.parse(Lt.options||Lt.default);if(console.log(1),Array.isArray(Wt))return Wt.map((vr,wr)=>jsxRuntimeExports.jsx("option",{value:vr.value,children:vr.option},wr))}catch{return(Lt.options||Lt.default||"").split(",").map((vr,wr)=>jsxRuntimeExports.jsx("option",{value:vr.trim(),children:vr.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 Wt=JSON.parse(Lt.options||Lt.default||"{}");if(Array.isArray(Wt))return jsxRuntimeExports.jsx(ImageList,{optionsObject:Wt,param:Lt,handleImageSelect:wt,paramIndex:Ft})}catch{return(Lt.options||Lt.default||"").split(",").map((vr,wr)=>jsxRuntimeExports.jsx("div",{className:styles.image_option,children:jsxRuntimeExports.jsx("img",{src:vr.trim(),alt:`Option ${wr+1}`,onClick:()=>wt(Ft,vr.trim()),className:Lt.value===vr.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 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),[Wt,vr]=reactExports.useState(["百变真我学习趣味爱情节日短视频电商音乐电商跳舞其他","百变真我","学习","趣味","爱情","节日","短视频","电商","音乐","跳舞","其他"]),[wr,_o]=reactExports.useState(!1),[Jt,Kr]=reactExports.useState(!1),Ot=reactExports.useRef(null);reactExports.useRef(null),reactExports.useRef(null),reactExports.useRef(null);const[gr,$o]=reactExports.useState(!1),[On,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,tn]=reactExports.useState("我想为你作一件事.."),[vn,zo]=reactExports.useState("百变真我"),[Yo,jo]=reactExports.useState([{name:"图标",type:"file",accept:".png,.jpg,.jpeg,.webp,.gif"}]);reactExports.useEffect(()=>{(async()=>{try{const In=await getFileObject("newlogo1.png_image/png_70522");if(In){jo([{name:"图标",type:"file",value:{file:In,name:In.name,type:In.type,size:In.size},accept:".png,.jpg,.jpeg,.webp,.gif"}]);return}else{const rn=await fetch(`${WEB_SITE}/logo/newlogo1.png`);if(!rn.ok)throw new Error("Failed to fetch logo");const Yr=await rn.blob(),Io=new File([Yr],"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(In){console.error("Error fetching logo:",In)}})()},[]);const Ko=_r=>{Nt(_r),_r=="COMPLETED"?(document.getElementById("trial").disabled=!1,document.getElementById("trial").innerText="运行完毕,再来一遍",document.getElementById("publish")&&(document.getElementById("publish").disabled=!1,document.getElementById("publish").innerText="运行完毕,可以定价上架啦!")):alert("出现错误:",_r)},Zo=async _r=>{create_order_debug({id:1001,price:0,pre_price:0,amount:1,description:_r}).then(rn=>{rn.data.result.startsWith("SUCCESS"),console.log(rn.data.result)}).catch(rn=>{console.error("Error adding user:",rn)})};reactExports.useEffect(()=>{c(a)},[a]);const Fo=_r=>{ft(_r)},Js=_r=>{jo(_r)},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 _r of Yo)if(_r.type==="file"&&_r.value===void 0)return alert(_r.name+":图标(logo)中必须输入合适文件"),!1;return!0};reactExports.useEffect(()=>{const _r=async rn=>{const Yr=await window.comfyui_app.graphToPrompt();console.log("MoneySetting initialized with response:",Yr);let Io=JSON.stringify(Yr.output,null,2);if(Object.values(Yr.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(Yr.output).map(So=>parseInt(So)));Yr.output[Bo+1]={inputs:{"ComfyUI 主机地址":rn+".shangxiaobao.com:7000"},class_type:"ComfyUIAppstoreHost",_meta:{title:"ComfyUI Appstore Host (ComfyUI_Appstore)"}},Io=JSON.stringify(Yr.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:",Yr);try{const So=await transformNodesFromFile(Ao);ft(So),st(Qo)}catch(So){console.error("workflow not ready:",So)}}};(async()=>{const Yr=await fetch("/manager/asset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!Yr.ok)throw new Error(`HTTP error! status: ${Yr.status}`);const Io=await Yr.json(),Bo=Io.message,Ao=Io.data;Bo=="success"&&(gt(Ao),_r(Ao))})()},[]);const Dt=async _r=>{if(!Ks())return;_r.preventDefault();const In=[{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}],rn={token:nt,name:Ir,description:Zr,category:vn,host:pt,parameter:In,logo:Yo||[]};try{const Yr=await fetch(`${API_BASE_URL}agents/create_workflow_agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(rn)});if(!Yr.ok)throw new Error(`HTTP error! status: ${Yr.status}`);const Io=await Yr.json();console.log("Form submitted successfully");const Bo=Io.id,Ao=Io.name,Qo=Io.execution_id;vt(Bo),uploadParameterFiles(In,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(Yr){console.error("Error submitting form:",Yr)}},Eo=_r=>{setLocalStorageValue("agent_category",Wt[_r],zo),_o(!1)};reactExports.useEffect(()=>{function _r(In){Ot.current&&!Ot.current.contains(In.target)&&_o(!1)}return document.addEventListener("mousedown",_r),()=>{document.removeEventListener("mousedown",_r)}},[]);const Jr=(_r,In)=>{publishToMarketplace(_r,parseFloat(In)).then(rn=>{Ft(rn.data.id),$o(!1)}).catch(rn=>{console.error("Error publishing to marketplace:",rn)})},ar=()=>{$o(!1)},er=_r=>{en(_r.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:_r=>_r.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:On,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,On),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:[Jt&&jsxRuntimeExports.jsx("div",{className:"modal",children:jsxRuntimeExports.jsxs("div",{className:"modal-content",style:{width:"75%"},onClick:_r=>_r.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:()=>Kr(!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:_r=>{_r.currentTarget.src=`${WEB_SITE}/logo/dev_qq.png`,_r.currentTarget.style.width="200px",_r.currentTarget.style.borderRadius="10px",_r.currentTarget.style.height="auto"},onMouseOut:_r=>{_r.currentTarget.src=`${WEB_SITE}/help/help2.png`,_r.currentTarget.style.width="20px",_r.currentTarget.style.borderRadius="50%",_r.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 _r="Guest_"+Math.random().toString(36).substr(2,9);document.getElementById("loginGuestButton").textContent="登录中";const rn=await(await fetch(`${API_BASE_URL}register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_r,smsCode:"Gues",password:_r})})).json();rn.key?(console.log("Login successful, key:",rn.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=` 游客已登录,请记录画小宝账号信息:用户名:${_r} 密码:${_r}`,setLocalStorageValue("accessTokenHuaxiaobao",rn.token,et),setLocalStorageValue("usernameHuaxiaobao",_r,ko),setLocalStorageValue("keyHuaxiaobao",rn.key,at),Dr(_r+"的一个精品"),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 In=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();In.key?(console.log("Login successful"),document.querySelectorAll("label").forEach(rn=>rn.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",In.token,et),setLocalStorageValue("usernameHuaxiaobao",document.getElementById("username").value,ko),setLocalStorageValue("keyHuaxiaobao",In.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:_r=>Dr(_r.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:()=>_o(!wr),children:[vn,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:Wt.slice(1).map((_r,In)=>jsxRuntimeExports.jsx("div",{className:"custom_select_option",onClick:()=>Eo(In+1),style:{maxWidth:"100%"},children:_r},In+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:_r=>tn(_r.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:_r=>Dt(_r),children:"试运行"})})]})]}),_t&&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{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,{})})); +`+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;$1)flatten$1(at,o-1,s,a),$=a.length;else for(var lt=0,et=at.length;lto?(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;c0?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);c0?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&&c0?0:at-1;for(c||($=s[nt?nt[lt]:lt],lt+=e);lt>=0&<=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;ata&&(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;atat||nt===void 0)return 1;if(nt1&&(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;$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"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{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{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;ba0&&(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;eu0&&(Xo[eu+3]=0);else if(ga===1)for(let eu=0;eu0&&(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{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&<(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&>&&_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{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){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&<.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{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,{})}));