diff --git a/lib/RemoteCalibrator.min.js b/lib/RemoteCalibrator.min.js index bbbc133..4b0c781 100644 --- a/lib/RemoteCalibrator.min.js +++ b/lib/RemoteCalibrator.min.js @@ -1,3 +1,3 @@ /*! For license information please see RemoteCalibrator.min.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RemoteCalibrator=t():e.RemoteCalibrator=t()}(self,(()=>(()=>{var __webpack_modules__={6003:()=>{window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){return window.setTimeout(e,1e3/60)},window.cancelRequestAnimFrame=window.cancelCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.clearTimeout},359:(e,t,n)=>{"use strict";n.d(t,{F:()=>r,a:()=>i});var s=n(9199);const r=(e,t,{go:n,cancel:r,custom:i},a,o=!0)=>{const l=document.createElement("div");let u,c,h;if(l.className="rc-buttons"+(o?" rc-absolute-buttons":""),l.id="rc-buttons",n&&(u=document.createElement("button"),u.className="rc-button rc-go-button",u.onclick=n,u.innerHTML=s.H.RC_ok[e],l.appendChild(u)),r&&a&&(c=document.createElement("button"),c.className="rc-button rc-cancel-button",c.onclick=r,c.innerHTML=s.H.RC_cancel[e],l.appendChild(c)),i){const{callback:e,content:t}=i;h=document.createElement("button"),h.className="rc-button rc-custom-button",h.onclick=e,h.innerHTML=t,l.appendChild(h)}return t.appendChild(l),[l,u,c,h]},i=e=>{e.querySelector("#rc-buttons").remove()}},2016:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>takeInput});var _buttons__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(359),_keyBinder__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9853),_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9043);const takeInput=async(RC,extraFunction=null,extraFunctionOut=null,customButtonConfig=null)=>{const unit=RC.equipment.value.unit,unitDisplay=unit===RC._CONST.UNITS.CM?"cm":"in",unitIsFraction=unit===RC._CONST.UNITS.IN_F,formItem=`
\n
\n ${unitIsFraction?`${unitDisplay}`:`${unitDisplay}`}\n
\n
`,instruction=RC.background.querySelector(".calibration-instruction");instruction.innerHTML+=formItem;const formElement=instruction.querySelector(".rc-form"),formInputElement=instruction.querySelector(".rc-form-input"),formInputElementFInteger=instruction.querySelector(".rc-form-input-f-integer"),formInputElementFFraction=instruction.querySelector(".rc-form-input-f-fraction");unitIsFraction?formInputElementFInteger.focus():formInputElement.focus();const addedButtons=(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.F)(RC.L,formElement,{go:()=>{},custom:customButtonConfig||void 0},!0,!1),goButton=addedButtons[1],customButton=addedButtons[3];goButton.disabled=!0;const eleOkay=e=>{e.classList.remove("rc-input-error"),goButton.disabled=!1},eleError=e=>{isAcceptedSingleInput(e.value.slice(-1))?(e.classList.add("rc-input-error"),goButton.disabled=!0):e.value=e.value.substring(0,e.value.length-1)},setupEleOninput=(e,t)=>{e.oninput=()=>{t(e.value)?eleOkay(e):eleError(e)}},_validationForFraction=()=>{let e=!0;return validInputInteger(formInputElementFInteger.value)?eleOkay(formInputElementFInteger):(eleError(formInputElementFInteger),e=!1),validInputFraction(formInputElementFFraction.value)?eleOkay(formInputElementFFraction):(eleError(formInputElementFFraction),e=!1),e};return unitIsFraction?(formInputElementFInteger.oninput=_validationForFraction,formInputElementFFraction.oninput=_validationForFraction):setupEleOninput(formInputElement,validInput),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(extraFunction),new Promise((resolve=>{const bFunction=()=>{removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve(null)},fFunction=()=>{let valid=!1,numericalValue,inputValue;unitIsFraction&&validInputInteger(formInputElementFInteger.value)&&validInputFraction(formInputElementFFraction.value)?(valid=!0,numericalValue=Number.parseInt(formInputElementFInteger.value)+eval(formInputElementFFraction.value),inputValue=`${formInputElementFInteger.value} ${formInputElementFFraction.value}`):!unitIsFraction&&validInput(formInputElement.value)&&(valid=!0,numericalValue=Number(formInputElement.value)||Number(formInputElement.value.replace(",",".")),inputValue=formInputElement.value),valid&&(removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve({value:{numerical:numericalValue,input:inputValue,unit},timestamp:performance.now()}))};goButton.onclick=fFunction,customButton.onclick=bFunction;const bindKeysFunction=(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.m)({Enter:fFunction,Escape:bFunction})}))},removeInputElements=(e,t)=>{(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.a)(e);for(const t of e.children)t.remove();e.remove(),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(t)},validInput=e=>e.length>0&&!e.includes(" ")&&(!Number.isNaN(e)||!Number.isNaN(e.replace(",","."))),validInputInteger=e=>!!validInput(e)&&(Number.parseInt(e)===Number(e)&&Number(e)>0),validInputFraction=text=>{if("0"===text)return!0;if(!text.includes("/")||text.match(/\//g).length>1)return!1;const numbers=text.split("/");return validInputInteger(numbers[0])&&validInputInteger(numbers[1])&&(0,_utils__WEBPACK_IMPORTED_MODULE_2__.DW)(numbers[1])&&eval(text)<1},isAcceptedSingleInput=e=>/[0-9]/.test(e)||[".","/",","].includes(e)},9853:(e,t,n)=>{"use strict";n.d(t,{l:()=>i,m:()=>r});var s=n(9043);function r(e,t="keydown"){const n=t=>{t.key in e&&(t.preventDefault(),(0,s.nB)(e[t.key],t))};return document.body.addEventListener(t,n),n}function i(e,t="keydown"){document.body.removeEventListener(t,e)}},2646:(e,t,n)=>{"use strict";n.d(t,{G:()=>a,t:()=>r});var s=n(9199);function r(e){const t=Object.keys(s.H.EE_languageNameNative);if(t.includes(e))return i(e);const n=[];t.map((e=>{n.push(e.split("-")[0])}));const r=e.split("-")[0].toLowerCase();return n.includes(r)?i(t[n.indexOf(r)]):i("en-US")}function i(e){return{value:{language:e,languageNameEnglish:s.H.EE_languageNameEnglish[e],languageNameNative:s.H.EE_languageNameNative[e],languageDirection:s.H.EE_languageDirection[e],languagePhraseSource:s.H.EE_phraseSource[e]},timestamp:performance.now()}}function a(e){return"1"===s.H.EE_languageUseSpace[e]?" ":""}},477:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});const s="mocha"===n(7786)._;let r,i;if(!s){const e=n(9171);r=e.Synth,i=e.Volume}class a{triggerAttackRelease(){}}const o=s?new a:new r({oscillator:{type:"sine"},envelope:{attack:.001,decay:.001,sustain:1,release:.001}}).connect(new i(-17).toDestination()),l=s?new a:new r({oscillator:{type:"sine"}}).connect(new i(-5).toDestination()),u=(e=0)=>{switch(e){case 0:default:return void o.triggerAttackRelease(2e3,.05);case 1:return void o.triggerAttackRelease(500,.5);case 2:return void o.triggerAttackRelease(200,.6);case 3:return void l.triggerAttackRelease(200,.2)}}},9043:(e,t,n)=>{"use strict";function s(e,...t){if(e&&"function"==typeof e)return t.length?e(...t):e()}n.d(t,{$O:()=>l,$k:()=>w,AU:()=>u,Av:()=>y,DW:()=>d,Ew:()=>c,G8:()=>g,JZ:()=>m,KY:()=>v,Md:()=>r,Nh:()=>f,Sf:()=>a,aS:()=>o,k4:()=>p,ll:()=>h,ln:()=>b,nB:()=>s,yy:()=>i}),function(){let e=0;const t=["ms","moz","webkit","o"];for(let e=0;e{};function i(e){return new Promise((t=>setTimeout(t,e)))}function a(){if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled){const e=document.documentElement;return e.requestFullscreen?(e.requestFullscreen(),!0):e.mozRequestFullScreen?(e.mozRequestFullScreen(),!0):e.webkitRequestFullscreen?(e.webkitRequestFullscreen(),!0):!!e.msRequestFullscreen&&(e.msRequestFullscreen(),!0)}return!1}function o(){return Math.abs(window.innerHeight-screen.height)<5&&Math.abs(window.innerWidth-screen.width)<5&&window.screenX<5&&window.screenY<5}function l(e,t=null,n=!1,s=""){return`

${e}

${t?`

${t}

`:""}`}function u(e,t,n){return en?n:e}function c(e,t,n,s,r){return s+1*(e-t)/(n-t)*(r-s)}function h(e,t,n,s){return Math.sqrt((e-n)**2+(t-s)**2)}function d(e){return e&&!(e&e-1)}function p(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function f(e,t){const n=10**t;return Math.round(e*n)/n}const m=e=>{const t=Math.floor(e.length/2),n=[...e].sort(((e,t)=>e-t));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},g=e=>e.reduce(((e,t)=>e+t))/e.length;function y(e,t,n=1){let s=0,r=0;for(;0===s;)s=Math.random();for(;0===r;)r=Math.random();let i=Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*r);return i=i/10+.5,i>1||i<0?i=y(e,t,n):(i=i**n,i*=t-e,i+=e),i}const b=e=>JSON.parse(JSON.stringify(e));function w(){"activeElement"in document&&document.activeElement.blur()}const v=e=>{if("touchstart"===e.type||"touchmove"===e.type){const t=e.touches[0];return{x:t.clientX,y:t.clientY}}return{x:e.clientX,y:e.clientY}}},7786:(e,t,n)=>{"use strict";n.d(t,{A:()=>w,_:()=>y});var s=n(7503),r=n.n(s),i=n(115),a=n.n(i);const o=["tall","short","up","down","fancy","busy","loud","crazy","kind","nice","real","speedy","handy","active","alert","bold","brave","bright","calm","clever","cool","free","grand","great","happy","jolly","lucky","spicy","sunny","super","wise"],l=["bat","bear","bird","cat","cow","deer","dog","dove","dragon","duck","eagle","fish","fox","frog","goose","lion","mouse","owl","pig","rat","seal","shark","sheep","snake","spider","tiger","turkey","viper","whale","wolf","onion","carrot","pear","bean","corn","bread","apple","banana","fig","grape","lemon","lime","orange","peach","plum","dumpling","cake","pasta","pot","sushi"],u=["blue","bronze","fire","forest","gold","gray","green","navy","purple","red","silver","sky","yellow","neon","black","white","brown","aqua"];function c(e){return e[Math.floor(Math.random()*e.length)]}function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(){const e=`000${(new Date).getMilliseconds().toString()}`;return h(c(o))+h(c(u))+h(c(l))+e.substring(e.length-3)}var p=n(782),f=n(9043),m=n(2646),g=n(9199);const y="production";class b{constructor(){window.console.log(`%c\nEasyEyes Remote Calibrator ${this.version.value}\n`,`color: ${this._CONST.COLOR.ORANGE}`),this._initialized=!1,this._initializing=!1,this._id=null,this._lang=null,this._langData=[],this._panelStatus={hasPanel:!1,panelFinished:!1,panelResolveIntervals:[]},this._panel={panel:null,panelObserver:null,panelTasks:[],panelParent:null,panelOptions:{},panelCallback:null,panelResolve:null},this._participantCheckEquipment={has:null,equipment:null,unit:null},this._trackingSetupFinishedStatus={gaze:!0,distance:!0},this._trackingPaused={gaze:!1,distance:!1},this._trackingVideoFrameTimestamps={gaze:0,distance:0},this._distanceTrackNudging={distanceCorrecting:null,distanceCorrectEnabled:!1,distanceDesired:null,distanceAllowedRatio:null,needEasyEyesKeypadBeyondCm:null},this._gazeTrackNudging={isCorrectingGaze:!1},this._environmentData=[],this._displayData=[],this._screenData=[],this._viewingDistanceData=[],this._nearPointData=[],this._PDData=[],this._gazePositionData=[],this._gazeAccuracyData=[],this._performanceData=[],this._fullscreenData=[],this._equipmentData=[],this._checkData=[],this._background={element:null,instructionElement:null},this._nudger={element:null,gazeElement:null},this._params={backgroundColor:"#eee",videoOpacity:.8,showCancelButton:!0}}get background(){return this._background.element}get instructionElement(){return this._background.instructionElement}get nudger(){return this._nudger.element}get params(){return this._params}get id(){return this._id?{value:this._id.value,timestamp:this._id.timestamp,date:this._id.date}:null}_helper_get(e,t){if(!e.length)return null;const n=e[e.length-1];return t?{value:n.value[t],timestamp:n.timestamp}:n}get version(){return{value:"0.7.15"}}get supportedLanguages(){const e=[];for(const t in g.H.EE_languageNameEnglish)e.push({language:t,languageNameEnglish:g.H.EE_languageNameEnglish[t],languageNameNative:g.H.EE_languageNameNative[t]});return e}get L(){return this._lang}get LD(){return this.languageDirection.value}get language(){return this._helper_get(this._langData,"language")}get languageNameEnglish(){return this._helper_get(this._langData,"languageNameEnglish")}get languageNameNative(){return this._helper_get(this._langData,"languageNameNative")}get languageDirection(){return this._helper_get(this._langData,"languageDirection")}get languagePhraseSource(){return this._helper_get(this._langData,"languagePhraseSource")}get computeArrayFillMHz(){return this._helper_get(this._performanceData,"computeArrayFillMHz")}get computeRandomMHz(){return this._helper_get(this._performanceData,"computeRandomMHz")}get idealFps(){return this._helper_get(this._performanceData,"idealFps")}get stressFps(){return this._helper_get(this._performanceData,"stressFps")}get isFullscreen(){return this.fullscreenData.length&&a()((0,f.aS)(),this._helper_get(this._fullscreenData).value)||(this.newFullscreenData={value:(0,f.aS)(),timestamp:performance.now()}),this._helper_get(this._fullscreenData)}get concurrency(){return this._helper_get(this._environmentData,"concurrency")}get browser(){return this._helper_get(this._environmentData,"browser")}get browserVersion(){return this._helper_get(this._environmentData,"browserVersion")}get deviceType(){return this._helper_get(this._environmentData,"deviceType")}get isMobile(){const e=this._helper_get(this._environmentData,"deviceType");return{value:"desktop"!==e.value,timestamp:e.timestamp}}get model(){return this._helper_get(this._environmentData,"model")}get manufacturer(){return this._helper_get(this._environmentData,"manufacturer")}get engine(){return this._helper_get(this._environmentData,"engine")}get system(){return this._helper_get(this._environmentData,"system")}get systemFamily(){return this._helper_get(this._environmentData,"systemFamily")}get description(){return this._helper_get(this._environmentData,"description")}get fullDescription(){return this._helper_get(this._environmentData,"fullDescription")}get userLanguage(){return this._helper_get(this._environmentData,"userLanguage")}get equipment(){return this._helper_get(this._equipmentData)}get displayWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"displayWidthPx")}get displayHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"displayHeightPx")}get windowWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"windowWidthPx")}get windowHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"windowHeightPx")}get screenWidthCm(){return this._helper_get(this._screenData,"screenWidthCm")}get screenHeightCm(){return this._helper_get(this._screenData,"screenHeightCm")}get screenDiagonalCm(){return this._helper_get(this._screenData,"screenDiagonalCm")}get screenDiagonalIn(){return this._helper_get(this._screenData,"screenDiagonalIn")}get screenPpi(){return this._helper_get(this._screenData,"screenPpi")}get screenPhysicalPpi(){return this._helper_get(this._screenData,"screenPhysicalPpi")}get viewingDistanceCm(){return this._helper_get(this._viewingDistanceData)}get nearPointCm(){return this._helper_get(this._nearPointData)}get PDCm(){return this._helper_get(this._PDData)}get gazePositionPx(){return this._helper_get(this._gazePositionData)}get gazeAccuracyDeg(){return this._helper_get(this._gazeAccuracyData)}get displayData(){return this._displayData}get screenData(){return this._screenData}get viewingDistanceData(){return this._viewingDistanceData}get nearPointData(){return this._nearPointData}get PDData(){return this._PDData}get gazeData(){return this._gazePositionData}get performanceData(){return this._performanceData}get fullscreenData(){return this._fullscreenData}get environmentData(){return this._environmentData}get languageData(){return this._langData}get equipmentData(){return this._equipmentData}get checkData(){return this._checkData}set newDisplayData(e){this._displayData.push(e)}set newScreenData(e){this._screenData.push(e)}set newViewingDistanceData(e){this._viewingDistanceData.push(e)}set newNearPointData(e){this._nearPointData.push(e)}set newPDData(e){this._PDData.push(e)}set newGazePositionData(e){this._gazePositionData.push(e)}set newGazeAccuracyData(e){this._gazeAccuracyData.push(e)}set newEnvironmentData(e){this._environmentData.push(e)}set newPerformanceData(e){this._performanceData.push(e)}set newFullscreenData(e){this._fullscreenData.push(e)}set newLanguageData(e){this._langData.push(e)}set newEquipmentData(e){this._equipmentData.push(e)}set newCheckData(e){this._checkData.push(e)}}b.prototype.init=async function(e={},t=void 0){if(!this._initialized&&!this._initializing){this._initializing=!0;const n=Object.assign({id:d(),language:"AUTO",languagePhrasesJSON:null,fullscreen:!1},e);await(async(e=null)=>{const{remoteCalibratorPhrases:t}=await import("https://cdn.jsdelivr.net/gh/EasyEyes/remote-calibrator@latest/src/i18n/phrases.js");Object.assign(g.H,t),e&&Object.assign(g.H,e)})(n.languagePhrasesJSON),n.fullscreen&&!p.Y&&(0,f.Sf)(),this._id={value:n.id,timestamp:performance.now(),date:new Date},this._environment(),this._displaySize(),this._CONST.S.AUTO===n.language?this.newLanguageData=(0,m.t)(this.userLanguage.value):this.newLanguageData=(0,m.t)(n.language),this._lang=this.language.value,this._initializing=!1,this._initialized=!0,(0,f.nB)(t,this._id)}},b.prototype._environment=function(){if(this.checkInitialized()){(0,f.$k)();const e=e=>e.match(/Mobi/i)?"mobile":"desktop",t={value:{concurrency:window.navigator.hardwareConcurrency||-1,browser:r().name,browserVersion:r().version,deviceType:e(navigator.userAgent),model:r().product||"unknown",manufacturer:r().manufacturer||"unknown",engine:r().layout,system:`${r().os.family} ${r().os.version}`,systemFamily:r().os.family,description:r().description,fullDescription:r().ua,userLanguage:window.navigator.userLanguage||window.navigator.language},timestamp:this.id.timestamp};this.newEnvironmentData=t}},b.prototype.checkInitialized=function(){return!!this._initialized},b.prototype.getFullscreen=function(e=!0){return!!(0,f.aS)()||(this.newFullscreenData={value:!(!e||p.Y)&&(0,f.Sf)(),timestamp:performance.now()},this.isMobile.value&&window.scrollBy(0,1),this.isFullscreen)},b.prototype.newLanguage=function(e){if(this.checkInitialized()){let t;return this.newLanguageData=t=(0,m.t)(e),this._lang=this.language.value,t}},b.prototype._addBackground=function(e){if(null!==this.background)return;let t=document.getElementById("calibration-background");return t||(t=document.createElement("div"),t.id="calibration-background",t.className=`calibration-background rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._background.element=t,this.background},b.prototype._replaceBackground=function(e){return null!==this.background&&this._removeBackground(),this._addBackground(e)},b.prototype._removeBackground=function(){const e=document.getElementById("calibration-background");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._background={element:null,instructionElement:null},!0)},b.prototype._addBackgroundText=function(e,t){const n=this.background.getElementsByClassName("calibration-instruction");for(let e=0;e{"use strict";n.d(t,{Y:()=>s});const s=!1},9199:(e,t,n)=>{"use strict";n.d(t,{H:()=>r});const s=["en-US","ar","hy","bg","zh-CN","zh-HK","hr","cs","da","nl","en-UK","fi","fr","de","el","he","hi","hu","is","id","it","ja","kn","ko","lt","ms","ml","no","fa","pl","pt","ro","ru","sr","es","su","sw","sv","tl","tr","ur"],r={};["EE_languageNameEnglish","EE_languageNameNative","EE_languageDirection","EE_languageUseSpace","EE_phraseSource","RC_cancel","RC_distanceTracking","RC_distanceTrackingCloseL","RC_distanceTrackingCloseR","RC_distanceTrackingGuide","RC_distanceTrackingIntroEnd","RC_distanceTrackingIntroStart","RC_distanceTrackingMoveCloser","RC_distanceTrackingMoveFurther","RC_canUsePhoneKeypad","RC_distanceTrackingRedo","RC_distanceTrackingTitle","RC_errorCameraUseDenied","RC_errorNoCamera","RC_gazeTracking","RC_gazeTrackingIntro","RC_gazeTrackingNudge","RC_gazeTrackingTitle","RC_nearPointIntro","RC_nearPointTitle","RC_ok","RC_panelButton","RC_panelIntro","RC_panelTitle","RC_panelTitleNext","RC_panelIntroNext","RC_panelUsesWebcam","RC_panelUsesWebcamPhone","RC_performance","RC_performanceIntro","RC_performanceTitle","RC_privacyCamera","RC_requestCamera","RC_screenSize","RC_screenSizeCredit","RC_screenSizeCreditCard","RC_screenSizeHave","RC_screenSizeIntro","RC_screenSizeTitle","RC_screenSizeUSBA","RC_screenSizeUSBC","RC_starting","RC_viewingBlindSpotCredit","RC_viewingBlindSpotRejected","RC_viewingDistance","RC_viewingDistanceIntroTitle","RC_viewingDistanceIntroLiMethod","RC_viewingDistanceTitle"].map((e=>{r[e]={},s.map((t=>{r[e][t]=""}))}))},7790:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>_setDebugControl});var _components_utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9043);const _setDebugControl=(e,t,n,s)=>{const r=document.createElement("div");r.className="rc-panel-debug-control",r.innerHTML='

DEBUG CONTROL

REMEMBER TO SET debug TO false FOR PRODUCTION MODE!

',t.appendChild(r);const i=[];for(const t of n){const n=t.name?t.name:t,s=document.createElement("div");s.className="rc-panel-debug-control-task-row",s.id=`rc-debugger-row-${n}`;const a=e._debuggerDefault[n];if(a){r.innerHTML+=`

${n}

`;const e={n:"number",s:"string"};switch(n){case"screenSize":for(const t in a.value)s.innerHTML+=_createValueElement(n,t,a.value[t],`.value.${t}`,e.n);break;case"measureDistance":s.innerHTML+=_createValueElement(n,"value",a.value,".value",e.n),s.innerHTML+=_createValueElement(n,"method",a.method,".method",e.s,!0);break;case"trackDistance":s.innerHTML+=_createValueElement(n,"viewingDistanceCm",a.value.viewingDistanceCm,".value",e.n),s.innerHTML+=_createValueElement(n,"PDCm",a.value.PDCm,".value",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.x",a.value.nearPointCm.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.y",a.value.nearPointCm.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",a.value.latencyMs,".latencyMs",e.n),s.innerHTML+=_createValueElement(n,"method",a.method,".method",e.s,!0);break;case"trackGaze":s.innerHTML+=_createValueElement(n,"x",a.value.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"y",a.value.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",a.value.latencyMs,".value.latencyMs",e.n);break;case"performance":s.innerHTML+=_createValueElement(n,"computeArrayFillMHz",a.value.computeArrayFillMHz,".value.computeArrayFillMHz",e.n),s.innerHTML+=_createValueElement(n,"computeRandomMHz",a.value.computeRandomMHz,".value.computeRandomMHz",e.n),s.innerHTML+=_createValueElement(n,"idealFps",a.value.idealFps,".value.idealFps",e.n),s.innerHTML+=_createValueElement(n,"stressFps",a.value.stressFps,".value.stressFps",e.n)}r.appendChild(s),i.push(n)}}const a=document.createElement("button");a.className="rc-panel-debug-control-next",a.innerHTML="Simulate calibration and continue",a.onclick=()=>{_wrapValues(e,i),(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.nB)(s,{timestamp:performance.now()}),e._panelStatus.panelFinished=!0},r.appendChild(a)},_createValueElement=(e,t,n,s,r,i=!1)=>`
\n \n

${t}

\n
`,_wrapValues=(e,t)=>{for(const n of t){const t=document.querySelector(`#rc-debugger-row-${n}`),s={};switch(n){case"screenSize":s.value={},_putData(e,s,t),e.newScreenData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"measureDistance":_putData(e,s,t),e.newViewingDistanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"trackDistance":e.newViewingDistanceData={value:_get(t,"#trackDistance-viewingDistanceCm"),latencyMs:_get(t,"#trackDistance-latencyMs"),method:_get(t,"#trackDistance-method","string"),timestamp:e._debuggerDefault.timestamp},e.newNearPointData={value:{x:_get(t,"#trackDistance-nearPointCm-x"),y:_get(t,"#trackDistance-nearPointCm-y")},timestamp:e._debuggerDefault.timestamp},e.newPDData={value:_get(t,"#trackDistance-PDCm"),timestamp:e._debuggerDefault.timestamp};break;case"trackGaze":s.value={},_putData(e,s,t),e.newGazePositionData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"performance":s.value={},_putData(e,s,t),e.newPerformanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s)}}},_get=(e,t)=>{const n=e.querySelector(t);return"number"===n.dataset.type?Number(n.value):n.value},_putData=(RC,newData,taskRow)=>{for(const ele of taskRow.childNodes){const eleInput=ele.querySelector("input");try{eval(`newData${eleInput.dataset.source} = eleInput.dataset.type === 'number' ? Number(eleInput.value) : eleInput.value`)}catch(e){}newData.timestamp=RC._debuggerDefault.timestamp}return newData}},2921:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".animated{-webkit-animation-duration:var(--animate-duration);animation-duration:var(--animate-duration);-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.animated.repeat-1{-webkit-animation-iteration-count:var(--animate-repeat);animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{-webkit-animation-iteration-count:calc(var(--animate-repeat)*2);animation-iteration-count:calc(var(--animate-repeat)*2)}.animated.repeat-3{-webkit-animation-iteration-count:calc(var(--animate-repeat)*3);animation-iteration-count:calc(var(--animate-repeat)*3)}.animated.delay-1s{-webkit-animation-delay:var(--animate-delay);animation-delay:var(--animate-delay)}.animated.delay-2s{-webkit-animation-delay:calc(var(--animate-delay)*2);animation-delay:calc(var(--animate-delay)*2)}.animated.delay-3s{-webkit-animation-delay:calc(var(--animate-delay)*3);animation-delay:calc(var(--animate-delay)*3)}.animated.delay-4s{-webkit-animation-delay:calc(var(--animate-delay)*4);animation-delay:calc(var(--animate-delay)*4)}.animated.delay-5s{-webkit-animation-delay:calc(var(--animate-delay)*5);animation-delay:calc(var(--animate-delay)*5)}.animated.faster{-webkit-animation-duration:calc(var(--animate-duration)/2);animation-duration:calc(var(--animate-duration)/2)}.animated.fast{-webkit-animation-duration:calc(var(--animate-duration)*.8);animation-duration:calc(var(--animate-duration)*.8)}.animated.slow{-webkit-animation-duration:calc(var(--animate-duration)*2);animation-duration:calc(var(--animate-duration)*2)}.animated.slower{-webkit-animation-duration:calc(var(--animate-duration)*3);animation-duration:calc(var(--animate-duration)*3)}@media (prefers-reduced-motion:reduce),print{.animated{-webkit-animation-duration:1ms!important;animation-duration:1ms!important;-webkit-animation-iteration-count:1!important;animation-iteration-count:1!important;-webkit-transition-duration:1ms!important;transition-duration:1ms!important}.animated[class*=Out]{opacity:0}}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_base.css"],names:[],mappings:"AAAA,UACE,kDAA2C,CAA3C,0CAA2C,CAC3C,gCAAyB,CAAzB,wBACF,CAEA,mBACE,0CAAmC,CAAnC,kCACF,CAEA,mBACE,uDAAgD,CAAhD,+CACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,4CAAqC,CAArC,oCACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,eACE,2DAAuD,CAAvD,mDACF,CAEA,eACE,0DAAqD,CAArD,kDACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,6CACE,UACE,wCAAkC,CAAlC,gCAAkC,CAElC,6CAAuC,CAAvC,qCAAuC,CADvC,yCAAmC,CAAnC,iCAEF,CAEA,sBACE,SACF,CACF",sourcesContent:[".animated {\n animation-duration: var(--animate-duration);\n animation-fill-mode: both;\n}\n\n.animated.infinite {\n animation-iteration-count: infinite;\n}\n\n.animated.repeat-1 {\n animation-iteration-count: var(--animate-repeat);\n}\n\n.animated.repeat-2 {\n animation-iteration-count: calc(var(--animate-repeat) * 2);\n}\n\n.animated.repeat-3 {\n animation-iteration-count: calc(var(--animate-repeat) * 3);\n}\n\n.animated.delay-1s {\n animation-delay: var(--animate-delay);\n}\n\n.animated.delay-2s {\n animation-delay: calc(var(--animate-delay) * 2);\n}\n\n.animated.delay-3s {\n animation-delay: calc(var(--animate-delay) * 3);\n}\n\n.animated.delay-4s {\n animation-delay: calc(var(--animate-delay) * 4);\n}\n\n.animated.delay-5s {\n animation-delay: calc(var(--animate-delay) * 5);\n}\n\n.animated.faster {\n animation-duration: calc(var(--animate-duration) / 2);\n}\n\n.animated.fast {\n animation-duration: calc(var(--animate-duration) * 0.8);\n}\n\n.animated.slow {\n animation-duration: calc(var(--animate-duration) * 2);\n}\n\n.animated.slower {\n animation-duration: calc(var(--animate-duration) * 3);\n}\n\n@media print, (prefers-reduced-motion: reduce) {\n .animated {\n animation-duration: 1ms !important;\n transition-duration: 1ms !important;\n animation-iteration-count: 1 !important;\n }\n\n .animated[class*='Out'] {\n opacity: 0;\n }\n}\n"],sourceRoot:""}]);const o=a},2636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,":root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_vars.css"],names:[],mappings:"AAAA,MACE,qBAAsB,CACtB,kBAAmB,CACnB,kBACF",sourcesContent:[":root {\n --animate-duration: 1s;\n --animate-delay: 1s;\n --animate-repeat: 1;\n}\n"],sourceRoot:""}]);const o=a},7271:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_entrances/fadeInUp.css"],names:[],mappings:"AAAA,4BACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAVA,oBACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAEA,UACE,+BAAwB,CAAxB,uBACF",sourcesContent:["@keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n}\n\n.fadeInUp {\n animation-name: fadeInUp;\n}\n"],sourceRoot:""}]);const o=a},2551:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"@-webkit-keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_exits/fadeOutDown.css"],names:[],mappings:"AAAA,+BACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CATA,uBACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CAEA,aACE,kCAA2B,CAA3B,0BACF",sourcesContent:["@keyframes fadeOutDown {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n}\n\n.fadeOutDown {\n animation-name: fadeOutDown;\n}\n"],sourceRoot:""}]);const o=a},8470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,'.swal2-popup.swal2-toast{background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:min-content auto min-content;overflow-y:hidden;padding:1em;pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{font-size:1em;margin:.5em 1em;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{font-size:1em;height:2em;margin:.5em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{font-size:.8em;margin:.5em 0 0;padding:.5em 0 0}.swal2-popup.swal2-toast .swal2-close{align-self:center;font-size:2em;grid-column:3/3;grid-row:1/99;height:.8em;margin:0;width:.8em}.swal2-popup.swal2-toast .swal2-html-container{font-size:1em;margin:.5em 1em;overflow:initial;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:.25em;width:2em}.swal2-popup.swal2-toast .swal2-icon{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:0 .5em 0 0;min-width:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{align-items:center;display:flex;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;justify-content:flex-start;margin:.5em 0 0;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{font-size:1em;margin:.25em .5em;padding:.4em .6em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:3em;position:absolute;width:1.6em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:4em 0 0 4em;left:-.5em;top:-.8em;transform:rotate(-45deg);transform-origin:2em 2em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 4em 4em 0;left:.9375em;top:-.25em;transform-origin:0 1.5em}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{height:2.6875em;left:.4375em;top:0;width:.4375em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{left:.1875em;top:1.125em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{right:.1875em;top:.9375em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){box-sizing:border-box;display:grid;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;inset:0;overflow-x:hidden;padding:.625em;position:fixed;transition:background-color .1s;z-index:1060;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:transparent!important}div:where(.swal2-container).swal2-bottom-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}div:where(.swal2-container).swal2-bottom,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-top{grid-template-columns:auto minmax(0,1fr) auto}div:where(.swal2-container).swal2-bottom-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-left>.swal2-popup,div:where(.swal2-container).swal2-center-start>.swal2-popup{align-self:center;grid-row:2}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-left>.swal2-popup,div:where(.swal2-container).swal2-bottom-start>.swal2-popup{align-self:end;grid-column:1;grid-row:3}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup,div:where(.swal2-container).swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{align-self:stretch;grid-row:1/4}div:where(.swal2-container).swal2-no-transition{transition:none!important}div:where(.swal2-container) div:where(.swal2-popup){background:#fff;border:none;border-radius:5px;box-sizing:border-box;color:#545454;display:none;font-family:inherit;font-size:1rem;grid-template-columns:minmax(0,100%);max-width:100%;padding:0 0 1.25em;position:relative;width:32em}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){color:inherit;font-size:1.875em;font-weight:600;margin:0;max-width:100%;padding:.8em 1em 0;position:relative;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:1.25em auto 0;padding:0;width:auto;z-index:1}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}div:where(.swal2-container) div:where(.swal2-loader){align-items:center;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-color:#2778c4 transparent;border-radius:100%;border-style:solid;border-width:.25em;display:none;height:2.2em;justify-content:center;margin:0 1.875em;width:2.2em}div:where(.swal2-container) button:where(.swal2-styled){box-shadow:0 0 0 3px transparent;font-weight:500;margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){background:initial;background-color:#7066e0;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){background:initial;background-color:#dc3741;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){background:initial;background-color:#6e7881;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px hsla(208,8%,47%,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){border-top:1px solid #eee;color:inherit;font-size:1em;margin:1em 0 0;padding:1em 1em 0;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{border-bottom-left-radius:5px;border-bottom-right-radius:5px;bottom:0;grid-column:auto!important;left:0;overflow:hidden;position:absolute;right:0}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){background:rgba(0,0,0,.2);height:.25em;width:100%}div:where(.swal2-container) img:where(.swal2-image){margin:2em auto 1em;max-width:100%}div:where(.swal2-container) button:where(.swal2-close){align-items:center;background:transparent;border:none;border-radius:5px;color:#ccc;cursor:pointer;font-family:monospace;font-size:2.5em;height:1.2em;justify-content:center;justify-self:end;margin-bottom:-1.2em;margin-right:0;margin-top:0;overflow:hidden;padding:0;transition:color .1s,box-shadow .1s;width:1.2em;z-index:2}div:where(.swal2-container) button:where(.swal2-close):hover{background:transparent;color:#f27474;transform:none}div:where(.swal2-container) button:where(.swal2-close):focus-visible{box-shadow:inset 0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{color:inherit;font-size:1.125em;font-weight:400;justify-content:center;line-height:normal;margin:0;overflow:auto;padding:1em 1.6em .3em;text-align:center;z-index:1;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) label:where(.swal2-checkbox),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) textarea:where(.swal2-textarea){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) textarea:where(.swal2-textarea){background:transparent;border:1px solid #d9d9d9;border-radius:.1875em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;box-sizing:border-box;color:inherit;font-size:1.125em;transition:border-color .1s,box-shadow .1s;width:auto}div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) input:where(.swal2-file)::-moz-placeholder,div:where(.swal2-container) input:where(.swal2-input)::-moz-placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::-moz-placeholder{color:#ccc}div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{background:#fff;margin:1em 2em 3px}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{color:inherit;font-weight:600;text-align:center;width:20%}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{font-size:1.125em;height:2.625em;line-height:2.625em;padding:0}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{background:transparent;font-size:1.125em;margin-left:auto;margin-right:auto;width:75%}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{background:transparent;color:inherit;font-size:1.125em;max-width:100%;min-width:50%;padding:.375em .625em}div:where(.swal2-container) .swal2-checkbox,div:where(.swal2-container) .swal2-radio{align-items:center;background:#fff;color:inherit;justify-content:center}div:where(.swal2-container) .swal2-checkbox label,div:where(.swal2-container) .swal2-radio label{font-size:1.125em;margin:0 .6em}div:where(.swal2-container) .swal2-checkbox input,div:where(.swal2-container) .swal2-radio input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;justify-content:center;margin:1em 0 0;overflow:hidden;padding:.625em}div:where(.swal2-container) div:where(.swal2-validation-message):before{background-color:#f27474;border-radius:50%;color:#fff;content:"!";display:inline-block;font-weight:600;height:1.5em;line-height:1.5em;margin:0 .625em;min-width:1.5em;text-align:center;width:1.5em}div:where(.swal2-container) .swal2-progress-steps{align-items:center;background:transparent;flex-wrap:wrap;font-weight:600;margin:1.25em auto;max-width:100%;padding:0}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{background:#2778c4;border-radius:2em;color:#fff;flex-shrink:0;height:2em;line-height:2em;text-align:center;width:2em;z-index:20}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{background:#2778c4;flex-shrink:0;height:.4em;margin:0 -1px;width:2.5em;z-index:10}div:where(.swal2-icon){border:.25em solid #000;border-radius:50%;box-sizing:content-box;cursor:default;font-family:inherit;height:5em;justify-content:center;line-height:5em;margin:2.5em auto .6em;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5em}div:where(.swal2-icon) .swal2-icon-content{align-items:center;display:flex;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{flex-grow:1;position:relative}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{background-color:#f27474;border-radius:.125em;display:block;height:.3125em;position:absolute;top:2.3125em;width:2.9375em}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:7.5em;position:absolute;width:3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:7.5em 0 0 7.5em;left:-2.0635em;top:-.4375em;transform:rotate(-45deg);transform-origin:3.75em 3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 7.5em 7.5em 0;left:1.875em;top:-.6875em;transform:rotate(-45deg);transform-origin:0 3.75em}div:where(.swal2-icon).swal2-success .swal2-success-ring{border:.25em solid hsla(98,55%,69%,.3);border-radius:50%;box-sizing:content-box;height:100%;left:-.25em;position:absolute;top:-.25em;width:100%;z-index:2}div:where(.swal2-icon).swal2-success .swal2-success-fix{height:5.625em;left:1.625em;position:absolute;top:.5em;transform:rotate(-45deg);width:.4375em;z-index:1}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{background-color:#a5dc86;border-radius:.125em;display:block;height:.3125em;position:absolute;z-index:2}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{left:.8125em;top:2.875em;transform:rotate(45deg);width:1.5625em}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{right:.5em;top:2.375em;transform:rotate(-45deg);width:2.9375em}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{height:50px;overflow:scroll;position:absolute;top:-9999px;width:50px}.swal2-rtl .swal2-close{margin-left:0;margin-right:0}.swal2-rtl .swal2-timer-progress-bar{left:auto;right:0}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotate(2deg)}33%{transform:translateY(0) rotate(-2deg)}66%{transform:translateY(.3125em) rotate(2deg)}to{transform:translateY(0) rotate(0deg)}}@keyframes swal2-toast-hide{to{opacity:0;transform:rotate(1deg)}}@keyframes swal2-toast-animate-success-line-tip{0%{left:.0625em;top:.5625em;width:0}54%{left:.125em;top:.125em;width:0}70%{left:-.25em;top:.625em;width:1.625em}84%{left:.75em;top:1.0625em;width:.5em}to{left:.1875em;top:1.125em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{right:1.375em;top:1.625em;width:0}65%{right:.9375em;top:1.25em;width:0}84%{right:0;top:.9375em;width:1.125em}to{right:.1875em;top:.9375em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}to{transform:scale(1)}}@keyframes swal2-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.5)}}@keyframes swal2-animate-success-line-tip{0%{left:.0625em;top:1.1875em;width:0}54%{left:.125em;top:1.0625em;width:0}70%{left:-.375em;top:2.1875em;width:3.125em}84%{left:1.3125em;top:3em;width:1.0625em}to{left:.8125em;top:2.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{right:2.875em;top:3.375em;width:0}65%{right:2.875em;top:3.375em;width:0}84%{right:0;top:2.1875em;width:3.4375em}to{right:.5em;top:2.375em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}to{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;opacity:0;transform:scale(.4)}50%{margin-top:1.625em;opacity:0;transform:scale(.4)}80%{margin-top:-.375em;transform:scale(1.15)}to{margin-top:0;opacity:1;transform:scale(1)}}@keyframes swal2-animate-error-icon{0%{opacity:0;transform:rotateX(100deg)}to{opacity:1;transform:rotateX(0deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-1turn)}to{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{opacity:0;transform:rotate(45deg)}25%{opacity:.4;transform:rotate(-25deg)}50%{opacity:.8;transform:rotate(15deg)}75%{opacity:1;transform:rotate(-5deg)}to{opacity:1;transform:rotateX(0)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent;box-sizing:border-box;max-width:100%;pointer-events:none;width:360px}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}',"",{version:3,sources:["webpack://./node_modules/sweetalert2/src/scss/_toasts.scss","webpack://./node_modules/sweetalert2/src/variables.scss","webpack://./node_modules/sweetalert2/src/scss/_core.scss","webpack://./node_modules/sweetalert2/src/scss/_icons.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-animations.scss","webpack://./node_modules/sweetalert2/src/scss/_animations.scss","webpack://./node_modules/sweetalert2/src/scss/_mixins.scss","webpack://./node_modules/sweetalert2/src/scss/_body.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-body.scss"],names:[],mappings:"AACE,yBAOE,eCRU,CDSV,sJCqOF,CD5OE,qBAAA,CACA,yBAAA,CACA,sBAAA,CACA,kDAAA,CAEA,iBAAA,CADA,WCmPkB,CD/OlB,kBAAA,CAEA,2BACE,aAAA,CAGF,sCAGE,aCyOwB,CD3OxB,eCyOqB,CDxOrB,SCyOsB,CDvOtB,kBAAA,CAGF,wCACE,sBAAA,CAGF,sCAGE,aCqOwB,CDvOxB,UCqOqB,CDpOrB,WCsOwB,CDlO1B,mDACE,aCkO6B,CD/N/B,uCAGE,cCgOyB,CDlOzB,eCgOsB,CD/NtB,gBCiOyB,CD7N3B,sCAGE,iBAAA,CAIA,aCqM+B,CD3M/B,eAAA,CACA,aAAA,CAGA,WCqM4B,CDpM5B,QCqM4B,CDvM5B,UCwM+B,CDlMjC,+CAIE,aCuMiC,CD1MjC,eCwM8B,CDtM9B,gBAAA,CADA,SCwM+B,CDrM/B,kBAAA,CAEA,qDACE,SAAA,CAIJ,uCAGE,iBAAA,CAFA,aAAA,CACA,aAAA,CAGA,UAAA,CACA,YAAA,CAFA,SAEA,CAGF,qCAGE,iBAAA,CAFA,aAAA,CACA,aAAA,CAIA,UAAA,CACA,iBAAA,CAFA,aAAA,CADA,SAGA,CAEA,yDAEE,kBAAA,CADA,YAAA,CAEA,eCuKqB,CDtKrB,eAAA,CAIA,uEAEE,UAAA,CADA,SACA,CAKF,4EACE,UAAA,CACA,aAAA,CAEA,yFACE,YAAA,CAGF,0FACE,aAAA,CAMR,wCAEE,WAAA,CADA,0BAAA,CAGA,eAAA,CACA,cAAA,CAGF,uCAGE,aCyI0B,CD3I1B,iBAAA,CACA,iBC0I0B,CDtI5B,wCACE,oBC1FU,CD4FV,6EAKE,iBAAA,CADA,UAAA,CAF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CAAA,CCpCN,wCAIE,4BAAA,CAHA,qBAAA,CAEA,cAAA,CAEA,mBAAA,CAHA,WAGA,CAEA,kDACE,qBAAA,CACA,0BAAA,CAGF,8GAEE,mBAAA,CAGF,+GAEE,mBAAA,CAGF,qHAEE,qBAAA,CACA,0BAAA,CAGF,qDACE,uBAAA,CACA,8BAAA,CAGF,oHAEE,qBAAA,CACA,0BAAA,CAGF,qHAEE,mBAAA,CAGF,qDACE,qBAAA,CACA,0BAAA,CAGF,oHAEE,mBAAA",sourceRoot:""}]);const o=a},663:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".rc-buttons{z-index:10}.rc-absolute-buttons{bottom:1.25rem;position:fixed;right:1.25rem;text-align:right}.rc-button{border:none!important;border-radius:7px!important;cursor:pointer;font-size:1rem!important;font-weight:700!important;line-height:150%!important;margin:.25rem!important;padding:1rem 1.5rem!important;text-align:center!important}.rc-go-button{background:rgba(255,154,0,.667)!important;color:#fff!important}.rc-go-button:hover{background:#ff9a00!important}.rc-go-button:active{background:#d68200!important}.rc-cancel-button,.rc-custom-button{background:hsla(0,0%,100%,.933)!important;color:#333!important}.rc-cancel-button:hover,.rc-custom-button:hover{background:#ddd!important}.rc-cancel-button:active,.rc-custom-button:active{background:#aaa!important;color:#000!important}.rc-button:disabled{background:#ddd!important;color:#999!important;cursor:default!important}","",{version:3,sources:["webpack://./src/css/buttons.scss"],names:[],mappings:"AAAA,YACE,UAAA,CAGF,qBAGE,cAAA,CAFA,cAAA,CAGA,aAAA,CAFA,gBAEA,CAGF,WAEE,qBAAA,CAMA,2BAAA,CACA,cAAA,CALA,wBAAA,CACA,yBAAA,CAFA,0BAAA,CAIA,uBAAA,CADA,6BAAA,CALA,2BAQA,CAGF,cACE,yCAAA,CACA,oBAAA,CAEA,oBACE,4BAAA,CAGF,qBACE,4BAAA,CAIJ,oCAEE,yCAAA,CACA,oBAAA,CAEA,gDACE,yBAAA,CAGF,kDACE,yBAAA,CACA,oBAAA,CAIJ,oBACE,yBAAA,CACA,oBAAA,CACA,wBAAA",sourceRoot:""}]);const o=a},290:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".my__swal2__container .swal2-select{border:2px solid #aaa!important;border-radius:5px!important;font-family:inherit!important;font-size:1.2rem!important;margin:auto 1.6rem!important;outline:none!important;padding-top:.5rem!important}.rc-form{font-family:inherit;font-size:2rem;pointer-events:auto!important}.rc-form .rc-form-inputs{display:flex;justify-content:space-between!important;margin:1rem 0}.rc-form .rc-form-inputs .rc-form-input,.rc-form .rc-form-inputs span{flex-grow:1;font-family:inherit;font-size:inherit;padding:.5rem}.rc-form .rc-form-inputs span{font-weight:700}.rc-form .rc-form-input{border:2px solid #aaa;border-radius:5px;outline:none;width:min(100%,10rem)}.rc-form .rc-form-input.rc-input-error{border-color:#ac0d0d!important;color:#ac0d0d!important}.rc-form .rc-form-input+.rc-form-input{margin-left:.5rem}.arrow-two-sided-svg{position:fixed}.arrow-two-sided-svg .arrow-two-sided{fill:#ff9a00}.arrow-two-sided-horizontal{bottom:10%;left:0;right:0;width:100%}.arrow-two-sided-vertical{bottom:0;height:100%;right:5%;top:0}","",{version:3,sources:["webpack://./src/css/check.scss"],names:[],mappings:"AAAA,oCAME,+BAAA,CADA,2BAAA,CADA,6BAAA,CAHA,0BAAA,CACA,4BAAA,CAKA,sBAAA,CAJA,2BAIA,CAOF,SAEE,mBAAA,CADA,cAAA,CAEA,6BAAA,CAEA,yBACE,YAAA,CACA,uCAAA,CACA,aAAA,CAEA,sEAEE,WAAA,CAEA,mBAAA,CACA,iBAAA,CAFA,aAEA,CAGF,8BACE,eAAA,CAIJ,wBACE,qBAAA,CAEA,iBAAA,CADA,YAAA,CAEA,qBAAA,CAEA,uCACE,8BAAA,CACA,uBAAA,CAIJ,uCACE,iBAAA,CAIJ,qBACE,cAAA,CAEA,sCACE,YAAA,CAIJ,4BAEE,UAAA,CACA,MAAA,CACA,OAAA,CAHA,UAGA,CAGF,0BAIE,QAAA,CAHA,WAAA,CACA,QAAA,CACA,KACA",sourceRoot:""}]);const o=a},2945:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#eye-side{font-weight:700}#blind-spot-canvas{bottom:0;display:block;left:0;margin:0;padding:0;position:fixed;right:0;top:0;z-index:-1}#blind-spot-instruction{max-width:unset!important}@media(min-width:641px){#blind-spot-instruction{font-size:1.1rem!important;width:65%!important}}@media(max-width:640px){#blind-spot-instruction{font-size:.9rem!important;width:90%!important}}#pip-video{display:none}#video-canvas{border-radius:6px;bottom:1rem;display:block;left:1rem;position:absolute;z-index:1000}#rc-ruler{cursor:pointer;max-height:120px;overflow:hidden;position:fixed;-webkit-user-select:none;-moz-user-select:none;user-select:none}#rc-ruler-scales{left:30px;pointer-events:none;position:absolute;top:0;z-index:1}#rc-ruler-scales #size-arrow{opacity:.5;transform:rotate(90deg) translateY(calc(50% + 3px))}#rc-ruler-scales .rc-ruler-scale-text{color:rgba(44,46,67,.667);font-weight:700;margin:0!important;padding:0;position:absolute;top:32px!important;transform:translate(-50%)!important}#rc-ruler-scales .rc-ruler-scale{display:block;position:absolute;top:0;transform:translate(-1px);width:2px;z-index:2}#rc-ruler-scales .rc-ruler-major{background-color:rgba(44,46,67,.933);height:30px}#rc-ruler-scales .rc-ruler-secondary{background-color:rgba(89,82,96,.867);height:24px}#rc-ruler-scales .rc-ruler-minor{background-color:rgba(89,82,96,.4);height:16px}.hide-nudger .calibration-nudger{display:none!important;opacity:0!important}.calibration-nudger,.gaze-nudger{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999999}.calibration-nudger *,.gaze-nudger *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#rc-distance-correct{margin:0 auto auto;overflow-wrap:break-word;padding:2rem;text-align:center;width:100%}#rc-distance-correct #rc-distance-correct-instruction{font-size:7rem;font-weight:700;line-height:100%;margin:0 auto 2rem}#rc-distance-correct #rc-distance-correct-guide{font-size:3rem;font-weight:500;line-height:200%}#rc-distance-correct #rc-distance-correct-guide .rc-distance-num{border-radius:7px!important;font-family:monospace!important;font-size:9rem;font-weight:700;padding:.5rem;vertical-align:middle}","",{version:3,sources:["webpack://./src/css/distance.scss"],names:[],mappings:"AAAA,UACE,eAAA,CAGF,mBAME,QAAA,CAJA,aAAA,CAGA,MAAA,CAIA,QAAA,CADA,SAAA,CAPA,cAAA,CAMA,OAAA,CAHA,KAAA,CADA,UAMA,CAGF,wBAEE,yBAAA,CAGF,wBACE,wBAEE,0BAAA,CADA,mBACA,CAAA,CAIJ,wBACE,wBAEE,yBAAA,CADA,mBACA,CAAA,CAIJ,WACE,YAAA,CAGF,cAME,iBAAA,CAFA,WAAA,CADA,aAAA,CAEA,SAAA,CAHA,iBAAA,CADA,YAKA,CAKF,UAKE,cAAA,CAHA,gBAAA,CACA,eAAA,CAFA,cAAA,CAKA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAGF,iBAGE,SAAA,CAEA,mBAAA,CAJA,iBAAA,CACA,KAAA,CAEA,SACA,CAEA,6BAEE,UAAA,CADA,mDACA,CAGF,sCAKE,yBAAA,CACA,eAAA,CAHA,kBAAA,CACA,SAAA,CAHA,iBAAA,CACA,kBAAA,CAKA,mCAAA,CAGF,iCAEE,aAAA,CADA,iBAAA,CAEA,KAAA,CAEA,yBAAA,CADA,SAAA,CAEA,SAAA,CAGF,iCACE,oCAAA,CACA,WAAA,CAGF,qCACE,oCAAA,CACA,WAAA,CAGF,iCACE,kCAAA,CACA,WAAA,CAOF,iCACE,sBAAA,CACA,mBAAA,CAIJ,iCASE,QAAA,CAIA,qBAAA,CARA,WAAA,CAEA,MAAA,CAGA,QAAA,CACA,eAAA,CARA,cAAA,CAKA,OAAA,CAOA,oBAAA,CADA,iBAAA,CARA,KAAA,CAMA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CARA,UAAA,CAFA,iBAaA,CAEA,qCACE,wHAAA,CAKJ,qBAGE,kBAAA,CAEA,wBAAA,CADA,YAAA,CAHA,iBAAA,CACA,UAGA,CAEA,sDAEE,cAAA,CADA,eAAA,CAGA,gBAAA,CADA,kBACA,CAGF,gDAEE,cAAA,CADA,eAAA,CAEA,gBAAA,CAEA,iEAEE,2BAAA,CAEA,+BAAA,CAEA,cAAA,CAHA,eAAA,CAFA,aAAA,CAIA,qBACA",sourceRoot:""}]);const o=a},4636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,":root{--rc-panel-theme-color:#3490de;--rc-panel-darken-color:#185b94;--rc-panel-theme-color-semi:#3490de66;--rc-panel-darken-color-semi:#185b9488}.rc-panel{background-color:var(--rc-panel-theme-color);border-radius:10px!important;box-shadow:var(--rc-panel-darken-color-semi) 0 50px 100px -20px,var(--rc-panel-theme-color-semi) 0 30px 60px -30px!important;display:block;margin-left:auto!important;margin-right:auto!important;max-width:720px!important;overflow:hidden;padding:.75rem!important;position:relative;width:100%}.rc-panel *{box-sizing:border-box;outline:none;text-rendering:optimizeLegibility;vertical-align:baseline;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-kerning:normal;scrollbar-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-panel .rc-panel-title{color:#fff!important;font-size:2rem!important;font-weight:600!important;margin:1rem 1rem 0!important}.rc-panel .rc-panel-description{color:hsla(0,0%,100%,.8)!important;font-size:1rem!important;font-weight:500!important;margin:.5rem 1rem 0!important}.rc-panel #rc-panel-language-parent{display:flex;flex-direction:row-reverse;margin:0;padding:0}.rc-panel #rc-panel-language-parent #rc-panel-lang-picker{background-color:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:5px!important;display:block;font-size:1rem!important;font-weight:500!important;margin:.25rem .25rem 0!important;outline:none!important;padding:.25rem!important}.rc-panel .rc-panel-steps{margin:-3rem 0 0!important;padding-top:4rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l,.rc-panel .rc-panel-steps.rc-panel-steps-s{display:flex!important;justify-content:space-between!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{background:hsla(0,0%,100%,.8);flex-grow:1!important;margin:.25rem!important;padding:0!important;position:relative;text-align:center;transition:background-color .2s}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use{font-size:1rem!important;line-height:170%!important;margin:0!important;padding:0 .3rem!important;position:absolute;right:0;top:0}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use svg,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use svg{height:1rem;width:1rem;fill:var(--rc-panel-darken-color)}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-name,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-name{color:var(--rc-panel-darken-color);font-size:1rem!important;font-weight:700!important;line-height:150%!important;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-l{flex-flow:row nowrap;max-width:100%;overflow-x:scroll}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-name{margin:1.5rem .5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-use-tip{bottom:110%!important;display:flex!important;left:50%!important;position:absolute!important;transform:translate(-50%)!important}.rc-panel .rc-panel-steps.rc-panel-steps-s{flex-flow:column nowrap;overflow-x:hidden}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{overflow-x:hidden;text-align:left;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-name{margin:1.2rem .75rem 1.2rem 1.5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-use-tip{display:inline-flex!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step{border:none!important;border-radius:7px!important}.rc-panel .rc-panel-steps .rc-panel-step .rc-panel-step-name{display:inline-block!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip{align-items:center!important;background-color:rgba(255,154,0,.933)!important;border:none!important;border-radius:7px!important;color:#fff!important;font-size:.75rem!important;font-weight:500!important;justify-content:center!important;line-height:100%!important;margin:0!important;opacity:0;padding:.7rem .5rem!important;pointer-events:none;text-align:center!important;transition:opacity .2s;width:-moz-max-content!important;width:max-content!important;z-index:10!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg{height:.75rem;width:.75rem;fill:#fff}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg:last-of-type{margin-right:5px}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover{background-color:#fff}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus .rc-panel-step-use-tip,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover .rc-panel-step-use-tip{opacity:1!important}.rc-panel .rc-panel-steps .rc-panel-step-todo:active{background-color:hsla(0,0%,93%,.8)}.rc-panel .rc-panel-steps .rc-panel-step-finished{background-color:hsla(0,0%,73%,.8)!important}.rc-panel .rc-panel-steps .rc-panel-step-inactive{opacity:.6;pointer-events:none}.rc-panel .rc-panel-steps .rc-panel-step-active{cursor:pointer;opacity:1}.rc-panel ::-webkit-scrollbar{display:none;width:0}.rc-panel .rc-panel-debug-control{background-color:hsla(0,0%,100%,.8);border:3px solid #e00;border-radius:7px;margin:1rem 0 0;overflow:hidden;padding:.5rem}.rc-panel .rc-panel-debug-control *{color:#ac0d0d}.rc-panel .rc-panel-debug-control h2,.rc-panel .rc-panel-debug-control h3,.rc-panel .rc-panel-debug-control p{margin:0!important}.rc-panel .rc-panel-debug-control h2{font-size:1.2rem!important;font-weight:700!important}.rc-panel .rc-panel-debug-control h3{font-size:.9rem;font-variant:small-caps;font-weight:500;padding-bottom:.3rem;padding-top:.5rem}.rc-panel .rc-panel-debug-control .rc-panel-debug-bold-text{font-size:1rem!important;font-weight:700}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next{background-color:#e00;border:none;border-radius:5px;color:#fff;cursor:pointer;font-size:.9rem!important;margin:1rem 0 0;padding:.5rem 1.2rem!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next:hover{background-color:#ac0d0d}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row{display:inline-flex;justify-content:flex-start!important;width:100%}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element{flex-grow:1;overflow-x:hidden;padding:0 .1rem;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:first-of-type{padding-left:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:last-of-type{padding-right:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element p{color:#ac0d0d;font-size:.65rem!important;line-height:150%!important;padding-left:1px!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element input{background-color:hsla(0,0%,100%,.8);border:1px solid #e99!important;border-radius:3px!important;font-size:.8rem;margin:0!important;padding:.3rem!important;pointer-events:auto;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto;width:100%}","",{version:3,sources:["webpack://./src/css/panel.scss"],names:[],mappings:"AAAA,MACE,8BAAA,CACA,+BAAA,CACA,qCAAA,CACA,sCA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A,mBAAA,CADA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAJA,UAKA",sourceRoot:""}]);const o=a},5151:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#size-card,#size-usba,#size-usbc{display:block;height:auto;left:2rem;position:absolute;z-index:2}#size-arrow{display:block;height:auto;position:absolute;width:70px;z-index:1}#size-arrow-fill{transition:fill .3s}.minor{transition:opacity .25s}.rc-slider:active~.size-obj .minor{opacity:0}#matching-obj{background-color:#fff;border:none;border-radius:7px;font-size:1.1rem;font-weight:600;margin-bottom:unset;margin-left:.3rem;margin-right:.3rem;margin-top:unset;padding-bottom:unset;padding-left:.3rem;padding-right:.3rem;padding-top:unset;pointer-events:auto!important;vertical-align:middle}@media(min-width:481px){.rc-size-obj-selection{display:inline-flex}}@media(max-width:480px){.rc-size-obj-selection{display:inline-block}}","",{version:3,sources:["webpack://./src/css/screenSize.scss"],names:[],mappings:"AAAA,iCAIE,aAAA,CAGA,WAAA,CADA,SAAA,CAHA,iBAAA,CAKA,SAAA,CAGF,YAEE,aAAA,CAGA,WAAA,CAJA,iBAAA,CAGA,UAAA,CAEA,SAAA,CAGF,iBACE,mBAAA,CAGF,OACE,uBAAA,CAIF,mCACE,SAAA,CAKF,cAGE,qBAAA,CADA,WAAA,CADA,iBAAA,CAMA,gBAAA,CADA,eAAA,CADA,mBAAA,CAAA,iBAAA,CAAA,kBAAA,CAAA,gBAAA,CADA,oBAAA,CAAA,kBAAA,CAAA,mBAAA,CAAA,iBAAA,CAKA,6BAAA,CADA,qBACA,CAGF,wBACE,uBACE,mBAAA,CAAA,CAIJ,wBACE,uBACE,oBAAA,CAAA",sourceRoot:""}]);const o=a},5319:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".rc-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(90deg,#ffc772,#ffc772 60%,#fff 0);border-radius:5px;cursor:grab;direction:ltr!important;display:block;height:10px;left:2rem;opacity:1;position:absolute;transition:opacity .3s;width:calc(100% - 4rem);z-index:10}.rc-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-ms-thumb{appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}","",{version:3,sources:["webpack://./src/css/slider.scss"],names:[],mappings:"AAAA,WAGE,uBAAA,CAAA,oBAAA,CAAA,eAAA,CAGA,4DAAA,CAIA,iBAAA,CAEA,WAAA,CAEA,uBAAA,CAZA,aAAA,CAGA,WAAA,CAIA,SAAA,CAFA,SAAA,CANA,iBAAA,CAYA,sBAAA,CATA,uBAAA,CAOA,UAGA,CAkBF,iCAVE,uBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAOF,6BAdE,oBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAWF,sBAlBE,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA",sourceRoot:""}]);const o=a},4889:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#webgazerVideoContainer .webgazer-videoinput-select{background:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:.6rem!important;color:#666;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.6rem;left:0;line-height:100%;margin:.3rem;outline:none!important;padding:.2rem .3rem;position:absolute;top:0;z-index:9}","",{version:3,sources:["webpack://./src/css/video.scss"],names:[],mappings:"AACE,oDAcE,uCAAA,CAHA,qBAAA,CAEA,6BAAA,CAEA,UAAA,CARA,wHAAA,CAEA,eAAA,CALA,MAAA,CAMA,gBAAA,CALA,YAAA,CAOA,sBAAA,CANA,mBAAA,CAJA,iBAAA,CACA,KAAA,CAFA,SAcA",sourceRoot:""}]);const o=a},9057:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#gaze-system-instruction{top:65%;white-space:pre}.gaze-nudge-instruction{top:65%}.gaze-calibration-dot{background:#ff005c80;cursor:auto;display:block;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;z-index:999999998}.gaze-calibration-dot-click{background:#ff005c;cursor:pointer;margin:auto;position:absolute;text-align:center;vertical-align:middle}.gaze-calibration-dot-click:active{opacity:.3}.gaze-calibration-dot-text{color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.9rem;font-weight:500;vertical-align:text-bottom}#webgazerGazeDot,#webgazerGazeDot-tempClone,.gaze-calibration-dot-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerGazeDot,#webgazerGazeDot-tempClone{background-color:#111d5e;border-radius:5px;opacity:.5;position:fixed;z-index:9999999999}#webgazerVideoContainer{border-radius:5px;display:block;overflow:hidden;position:fixed!important;transform-origin:bottom left;z-index:999999997}#webgazerFaceFeedbackBox,#webgazerVideoContainer,#webgazerVideoContainer *{-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerFaceFeedbackBox{border-radius:10px;box-sizing:border-box;opacity:.6;pointer-events:none}.rc-crosshair,.rc-gaze-nudger-arrows{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-crosshair{border-radius:50%;cursor:pointer;display:block;height:40px;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;width:40px;z-index:999999999}.rc-crosshair-component{background-color:#000;left:50%;margin:auto;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}","",{version:3,sources:["webpack://./src/css/gaze.css"],names:[],mappings:"AAAA,yBACE,OAAQ,CACR,eACF,CAEA,wBACE,OACF,CAEA,sBACE,oBAAqB,CAGrB,WAAe,CADf,aAAc,CADd,wBAA0B,CAI1B,sCAAuC,CACvC,gDAIa,CANb,iBAOF,CAEA,4BAEE,kBAAmB,CAEnB,cAAe,CADf,WAAY,CAFZ,iBAAkB,CAIlB,iBAAkB,CAClB,qBACF,CAEA,mCACE,UACF,CAEA,2BAIE,UAAW,CAHX,wHAC8D,CAG9D,eAAiB,CAFjB,eAAgB,CAGhB,0BAGF,CAIA,uEALE,mBAAoB,CADpB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAeF,CATA,4CAKE,wBAAyB,CACzB,iBAAkB,CAFlB,UAAY,CAFZ,cAAe,CACf,kBAMF,CAEA,wBAKE,iBAAkB,CAHlB,aAAc,CAKd,eAAgB,CAJhB,wBAA0B,CAC1B,4BAA6B,CAH7B,iBASF,CAMA,2EAPE,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAcF,CAPA,yBAGE,kBAAmB,CADnB,qBAAsB,CAEtB,UAAY,CACZ,mBAEF,CAIA,qCAEE,iBAAkB,CAIlB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBACF,CAEA,cAcE,iBAAkB,CARlB,cAAe,CAJf,aAAc,CAEd,WAAY,CAHZ,wBAA0B,CAM1B,sCAAuC,CACvC,gDAIa,CATb,UAAW,CAEX,iBAUF,CAEA,wBAQE,qBAAsB,CALtB,QAAS,CAET,WAAY,CACZ,mBAAoB,CALpB,iBAAkB,CAClB,OAAQ,CAER,8BAAgC,CAGhC,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAEF",sourcesContent:["#gaze-system-instruction {\n top: 65%;\n white-space: pre;\n}\n\n.gaze-nudge-instruction {\n top: 65%;\n}\n\n.gaze-calibration-dot {\n background: #ff005c80;\n position: fixed !important;\n display: block;\n cursor: initial;\n z-index: 999999998;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n}\n\n.gaze-calibration-dot-click {\n position: absolute;\n background: #ff005c;\n margin: auto;\n cursor: pointer;\n text-align: center;\n vertical-align: middle;\n}\n\n.gaze-calibration-dot-click:active {\n opacity: 0.3;\n}\n\n.gaze-calibration-dot-text {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-weight: 500;\n color: #fff;\n font-size: 0.9rem;\n vertical-align: text-bottom;\n user-select: none;\n pointer-events: none;\n}\n\n/* ----------------------------- WebGazer Native ---------------------------- */\n\n#webgazerGazeDot,\n#webgazerGazeDot-tempClone {\n position: fixed;\n z-index: 9999999999;\n opacity: 0.5;\n background-color: #111d5e;\n border-radius: 5px;\n pointer-events: none;\n user-select: none;\n}\n\n#webgazerVideoContainer {\n z-index: 999999997;\n display: block;\n position: fixed !important;\n transform-origin: bottom left;\n border-radius: 5px;\n /* opacity: 0.8; */\n overflow: hidden;\n /* pointer-events: none; */\n user-select: none;\n}\n\n#webgazerVideoContainer * {\n user-select: none;\n}\n\n#webgazerFaceFeedbackBox {\n /* TODO Set style in sub-module */\n box-sizing: border-box;\n border-radius: 10px;\n opacity: 0.6;\n pointer-events: none;\n user-select: none;\n}\n\n/* ------------------------------- Gaze Nudger ------------------------------ */\n\n.rc-crosshair,\n.rc-gaze-nudger-arrows {\n position: absolute;\n /* top: 50%;\n left: 50%;\n transform: translate(-50%, -50%); */\n user-select: none;\n}\n\n.rc-crosshair {\n position: fixed !important;\n display: block;\n width: 40px;\n height: 40px;\n z-index: 999999999;\n cursor: pointer;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n /* filter: drop-shadow(0 0 3px #fff); */\n border-radius: 50%;\n}\n\n.rc-crosshair-component {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n margin: auto;\n pointer-events: none;\n user-select: none;\n background-color: #000;\n}\n"],sourceRoot:""}]);const o=a},9725:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#calibration-background{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;overflow-y:scroll;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999990}#calibration-background::-webkit-scrollbar{display:none;width:0}#calibration-background *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#calibration-background p{line-height:150%}.calibration-instruction{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.calibration-instruction-scrollable{height:200%}.calibration-instruction h1{font-weight:700;min-width:360px}.calibration-instruction *{font-size:1.2rem;line-height:170%;margin:0;padding:0}.calibration-instruction p{margin-top:1rem;white-space:pre-line}.calibration-description{line-height:170%}.rc-hang-description{font-size:1rem!important;margin-top:50vh!important}@media (min-width:481px){.calibration-instruction{margin:2rem}.calibration-instruction h1{font-size:2.5rem!important;line-height:100%}.calibration-description{width:calc(100% - 4rem);width:max(min(100% - 4rem,960px),300px)}.calibration-description,.calibration-description *{font-size:1.2rem}.calibration-credit-text{font-size:.9rem!important}}@media (max-width:480px){.calibration-instruction{margin:1rem}.calibration-instruction h1{font-size:1.8rem!important;line-height:120%}.calibration-description{width:calc(100% - 1rem)}.calibration-description,.calibration-description *{font-size:1rem}.calibration-credit-text{font-size:.7rem!important}}.float-instruction{background:hsla(0,0%,100%,.9);border-radius:10px;font-size:1rem;font-weight:500;left:50%;margin:0;max-width:25rem;padding:10px 17px;position:fixed;text-align:center;transform:translate(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:999999991}.swal2-container{z-index:999999999!important}.calibration-credit-text{bottom:3px!important;color:#999!important;line-height:100%!important;margin:0!important;padding:0!important;position:fixed!important;text-align:center!important;width:100%!important}.lock-view{overflow:hidden!important}.rc-lang-ltr{direction:ltr!important;text-align:left!important}.rc-lang-rtl{direction:rtl!important;text-align:right!important}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}","",{version:3,sources:["webpack://./src/css/main.css"],names:[],mappings:"AACA,wBAQE,QAAS,CAMT,qBAAsB,CAVtB,WAAY,CAEZ,MAAO,CAGP,QAAS,CAET,eAAgB,CAChB,iBAAkB,CAVlB,cAAe,CAKf,OAAQ,CASR,oBAAqB,CADrB,iBAAkB,CAVlB,KAAM,CAQN,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAAiB,CAVjB,UAAW,CAFX,iBAgBF,CAEA,2CAEE,YAAa,CADb,OAEF,CAEA,0BACE,wHAEF,CAEA,0BACE,gBACF,CAEA,yBAGE,mBAAoB,CAFpB,iBAAkB,CAClB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAEF,CAEA,oCACE,WACF,CAEA,4BAEE,eAAgB,CADhB,eAEF,CAEA,2BACE,gBAAiB,CACjB,gBAAiB,CACjB,QAAS,CACT,SACF,CAEA,2BAEE,eAAgB,CADhB,oBAEF,CAEA,yBACE,gBACF,CAEA,qBAEE,wBAA0B,CAD1B,yBAEF,CAKA,yBACE,yBACE,WACF,CAEA,4BAEE,0BAA4B,CAD5B,gBAEF,CAEA,yBACE,uBAAwB,CACxB,uCACF,CAEA,oDAEE,gBACF,CAEA,yBACE,yBACF,CACF,CAEA,yBACE,yBACE,WACF,CAEA,4BAEE,0BAA4B,CAD5B,gBAEF,CAEA,yBACE,uBACF,CAEA,oDAEE,cACF,CAEA,yBACE,yBACF,CACF,CAEA,mBAIE,6BAAoC,CAMpC,kBAAmB,CACnB,cAAe,CACf,eAAgB,CALhB,QAAS,CADT,QAAS,CAET,eAAgB,CAHhB,iBAAkB,CAJlB,cAAe,CACf,iBAAkB,CAOlB,yBAA6B,CAN7B,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAAiB,CAUjB,iBACF,CAIA,iBACE,2BACF,CAIA,yBAGE,oBAAsB,CACtB,oBAAsB,CAGtB,0BAA4B,CAF5B,kBAAoB,CACpB,mBAAqB,CALrB,wBAA0B,CAO1B,2BAA6B,CAN7B,oBAOF,CAIA,WACE,yBACF,CAIA,aACE,uBAAyB,CACzB,yBACF,CAEA,aACE,uBAAyB,CACzB,0BACF,CAMA,aACE,WACF,CAEA,iBACE,eACF",sourcesContent:["/* background div */\n#calibration-background {\n z-index: 999999990;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n /* background: #eee; */\n overflow: hidden;\n overflow-y: scroll;\n user-select: none;\n box-sizing: border-box;\n text-align: center;\n scrollbar-width: none;\n}\n\n#calibration-background::-webkit-scrollbar {\n width: 0;\n display: none;\n}\n\n#calibration-background * {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\n\n#calibration-background p {\n line-height: 150%;\n}\n\n.calibration-instruction {\n position: absolute;\n user-select: none;\n pointer-events: none;\n}\n\n.calibration-instruction-scrollable {\n height: 200%;\n}\n\n.calibration-instruction h1 {\n min-width: 360px;\n font-weight: 700;\n}\n\n.calibration-instruction * {\n font-size: 1.2rem;\n line-height: 170%;\n margin: 0;\n padding: 0;\n}\n\n.calibration-instruction p {\n white-space: pre-line;\n margin-top: 1rem;\n}\n\n.calibration-description {\n line-height: 170%;\n}\n\n.rc-hang-description {\n margin-top: 50vh !important;\n font-size: 1rem !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Screen size specific */\n\n@media (min-width: 481px) {\n .calibration-instruction {\n margin: 2rem;\n }\n\n .calibration-instruction h1 {\n line-height: 100%;\n font-size: 2.5rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 4rem);\n width: max(min(100% - 4rem, 960px), 300px);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1.2rem;\n }\n\n .calibration-credit-text {\n font-size: 0.9rem !important;\n }\n}\n\n@media (max-width: 480px) {\n .calibration-instruction {\n margin: 1rem;\n }\n\n .calibration-instruction h1 {\n line-height: 120%;\n font-size: 1.8rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 1rem);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1rem;\n }\n\n .calibration-credit-text {\n font-size: 0.7rem !important;\n }\n}\n\n.float-instruction {\n position: fixed;\n text-align: center;\n user-select: none;\n background: rgba(255, 255, 255, 0.9);\n padding: 10px 17px;\n margin: 0;\n left: 50%;\n max-width: 25rem;\n transform: translate(-50%, 0);\n border-radius: 10px;\n font-size: 1rem;\n font-weight: 500;\n z-index: 999999991;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.swal2-container {\n z-index: 999999999 !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.calibration-credit-text {\n position: fixed !important;\n width: 100% !important;\n bottom: 3px !important;\n color: #999 !important;\n margin: 0 !important;\n padding: 0 !important;\n line-height: 100% !important;\n text-align: center !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.lock-view {\n overflow: hidden !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.rc-lang-ltr {\n direction: ltr !important;\n text-align: left !important;\n}\n\n.rc-lang-rtl {\n direction: rtl !important;\n text-align: right !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* --------------------------------- CURSOR --------------------------------- */\n/* -------------------------------------------------------------------------- */\n\n.cursor-grab {\n cursor: grab;\n}\n\n.cursor-grabbing {\n cursor: grabbing;\n}\n"],sourceRoot:""}]);const o=a},2535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".swal2-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif!important}.my__swal2__icon{font-weight:700!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__icon *{color:#ff9a00!important}.my__swal2__title{color:#000!important;font-size:2rem!important;font-weight:700!important}.my__swal2__html,.my__swal2__title{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__html{color:#444!important;font-size:1.2rem!important;font-weight:400!important;line-height:150%!important;margin:1.6rem}.my__swal2__html__center{text-align:center!important}.animate__animated.animate__fadeInUp,.animate__animated.animate__fadeOutDown{--animate-duration:400ms!important;--animate-delay:0!important}.fadeInUp,.fadeOutDown{animation-delay:0!important;animation-duration:.4s!important}","",{version:3,sources:["webpack://./src/css/swal.css"],names:[],mappings:"AAAA,iBACE,kIAEF,CAEA,iBACE,yBAA4B,CAC5B,kCAA4B,CAA5B,+BAA4B,CAA5B,0BACF,CAEA,mBACE,uBACF,CAEA,kBACE,oBAAsB,CACtB,wBAA0B,CAC1B,yBAEF,CAEA,mCAHE,kCAA4B,CAA5B,+BAA4B,CAA5B,0BAUF,CAPA,iBAEE,oBAAsB,CACtB,0BAA4B,CAE5B,yBAA8B,CAD9B,0BAA4B,CAH5B,aAMF,CAEA,yBACE,2BACF,CAEA,6EAEE,kCAAoC,CACpC,2BACF,CAEA,uBAGE,2BAA6B,CAD7B,gCAEF",sourcesContent:[".swal2-container {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n}\n\n.my__swal2__icon {\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__icon * {\n color: #ff9a00 !important;\n}\n\n.my__swal2__title {\n color: #000 !important;\n font-size: 2rem !important;\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__html {\n margin: 1.6rem;\n color: #444 !important;\n font-size: 1.2rem !important;\n line-height: 150% !important;\n font-weight: normal !important;\n user-select: none !important;\n}\n\n.my__swal2__html__center {\n text-align: center !important;\n}\n\n.animate__animated.animate__fadeInUp,\n.animate__animated.animate__fadeOutDown {\n --animate-duration: 400ms !important;\n --animate-delay: 0 !important;\n}\n\n.fadeInUp,\n.fadeOutDown {\n animation-duration: 400ms !important;\n animation-delay: 0 !important;\n}\n"],sourceRoot:""}]);const o=a},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var o=0;o0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),t.push(c))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),i="/*# ".concat(r," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},7158:function(e){var t=function(){"use strict";var e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m,g,y,b,w,v,A,x,C="leader-line",k=1,S=2,_=3,E=4,I={top:k,right:S,bottom:_,left:E},T=1,N=2,O=3,R=4,D=5,M={straight:T,arc:N,fluid:O,magnet:R,grid:D},F="behind",B=C+"-defs",z='',L={disc:{elmId:"leader-line-disc",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},square:{elmId:"leader-line-square",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},arrow1:{elmId:"leader-line-arrow1",bBox:{left:-8,top:-8,width:16,height:16,right:8,bottom:8},widthR:4,heightR:4,bCircle:8,sideLen:8,backLen:8,overhead:8,outlineBase:2,outlineMax:1.5},arrow2:{elmId:"leader-line-arrow2",bBox:{left:-7,top:-8,width:11,height:16,right:4,bottom:8},widthR:2.75,heightR:4,bCircle:8,sideLen:8,backLen:7,overhead:4,outlineBase:1,outlineMax:1.75},arrow3:{elmId:"leader-line-arrow3",bBox:{left:-4,top:-5,width:12,height:10,right:8,bottom:5},widthR:3,heightR:2.5,bCircle:8,sideLen:5,backLen:4,overhead:8,outlineBase:1,outlineMax:2.5},hand:{elmId:"leader-line-hand",bBox:{left:-3,top:-12,width:40,height:24,right:37,bottom:12},widthR:10,heightR:6,bCircle:37,sideLen:12,backLen:3,overhead:37},crosshair:{elmId:"leader-line-crosshair",noRotate:!0,bBox:{left:-96,top:-96,width:192,height:192,right:96,bottom:96},widthR:48,heightR:48,bCircle:96,sideLen:96,backLen:96,overhead:0}},P={behind:F,disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},V={disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},W=[k,S,_,E],G="auto",U={x:"left",y:"top",width:"width",height:"height"},q=80,j=4,H=5,$=120,K=8,X=3.75,Z=10,Y=30,Q=.5522847,J=.25*Math.PI,ee=/^\s*(\-?[\d\.]+)\s*(\%)?\s*$/,te="http://www.w3.org/2000/svg",ne="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style&&!window.navigator.msPointerEnabled,se=!ne&&!!document.uniqueID,re="MozAppearance"in document.documentElement.style,ie=!(ne||re||!window.chrome||!window.CSS),ae=!(ne||se||re||ie||window.chrome||!("WebkitAppearance"in document.documentElement.style)),oe=se||ne?.2:.1,le={path:O,lineColor:"coral",lineSize:4,plugSE:[F,"arrow1"],plugSizeSE:[1,1],lineOutlineEnabled:!1,lineOutlineColor:"indianred",lineOutlineSize:.25,plugOutlineEnabledSE:[!1,!1],plugOutlineSizeSE:[1,1]},ue=(v={}.toString,A={}.hasOwnProperty.toString,x=A.call(Object),function(e){var t,n;return e&&"[object Object]"===v.call(e)&&(!(t=Object.getPrototypeOf(e))||(n=t.hasOwnProperty("constructor")&&t.constructor)&&"function"==typeof n&&A.call(n)===x)}),ce=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},he=(p={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},f=1e3/60/2,m=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,f)},g=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(e){clearTimeout(e)},y=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},b=[],w=0,{add:function(e,t,n,s,r,i,a){var o,l,u,c,h,d,m,g,y,v,A,x,C,k=++w;function S(t,n){return{value:e(n),timeRatio:t,outputRatio:n}}if("string"==typeof r&&(r=p[r]),e=e||function(){},n=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex)return null;var e=null,t=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===t)e=0;else{if("1"!==t)return null;e=1}return this._skipOptionalSpacesOrDelimiter(),e}};var o=e.SVGPathElement.prototype.setAttribute,l=e.SVGPathElement.prototype.removeAttribute,u=e.Symbol?e.Symbol():"__cachedPathData",c=e.Symbol?e.Symbol():"__cachedNormalizedPathData",h=function(e,t,n,s,r,i,a,o,l,u){function c(e,t,n){return{x:e*Math.cos(n)-t*Math.sin(n),y:e*Math.sin(n)+t*Math.cos(n)}}var d,p,f,m,g,y,b,w,v,A,x,C,k,S,_,E=(d=a,Math.PI*d/180),I=[];u?(S=u[0],_=u[1],C=u[2],k=u[3]):(e=(p=c(e,t,-E)).x,t=p.y,1<(y=(m=(e-(n=(f=c(n,s,-E)).x))/2)*m/(r*r)+(g=(t-(s=f.y))/2)*g/(i*i))&&(r*=y=Math.sqrt(y),i*=y),v=(b=r*r)*(w=i*i)-b*g*g-w*m*m,A=b*g*g+w*m*m,C=(x=(o===l?-1:1)*Math.sqrt(Math.abs(v/A)))*r*g/i+(e+n)/2,k=x*-i*m/r+(t+s)/2,S=Math.asin(parseFloat(((t-k)/i).toFixed(9))),_=Math.asin(parseFloat(((s-k)/i).toFixed(9))),e120*Math.PI/180&&(T=_,N=n,O=s,_=l&&S<_?S+120*Math.PI/180*1:S+120*Math.PI/180*-1,n=C+r*Math.cos(_),s=k+i*Math.sin(_),I=h(n,s,N,O,r,i,a,0,l,[_,T,C,k])),R=_-S;var D=Math.cos(S),M=Math.sin(S),F=Math.cos(_),B=Math.sin(_),z=Math.tan(R/4),L=4/3*r*z,P=4/3*i*z,V=[e,t],W=[e+L*M,t-P*D],G=[n+L*B,s-P*F],U=[n,s];if(W[0]=2*V[0]-W[0],W[1]=2*V[1]-W[1],u)return[W,G,U].concat(I);I=[W,G,U].concat(I).join().split(",");var q=[],j=[];return I.forEach((function(e,t){t%2?j.push(c(I[t-1],I[t],E).y):j.push(c(I[t],I[t+1],E).x),6===j.length&&(q.push(j),j=[])})),q};e.SVGPathElement.prototype.setAttribute=function(e,t){"d"===e&&(this[u]=null,this[c]=null),o.call(this,e,t)},e.SVGPathElement.prototype.removeAttribute=function(e,t){"d"===e&&(this[u]=null,this[c]=null),l.call(this,e)},e.SVGPathElement.prototype.getPathData=function(e){if(e&&e.normalize){if(this[c])return i(this[c]);this[u]?d=i(this[u]):(d=r(this.getAttribute("d")||""),this[u]=i(d));var t=a((n=[],h=l=o=s=null,d.forEach((function(e){var t,r,i,a,u,c,d=e.type;"M"===d?(u=e.values[0],c=e.values[1],n.push({type:"M",values:[u,c]}),s=l=u,o=h=c):"m"===d?(u=s+e.values[0],c=o+e.values[1],n.push({type:"M",values:[u,c]}),s=l=u,o=h=c):"L"===d?(u=e.values[0],c=e.values[1],n.push({type:"L",values:[u,c]}),s=u,o=c):"l"===d?(u=s+e.values[0],c=o+e.values[1],n.push({type:"L",values:[u,c]}),s=u,o=c):"C"===d?(t=e.values[0],r=e.values[1],i=e.values[2],a=e.values[3],u=e.values[4],c=e.values[5],n.push({type:"C",values:[t,r,i,a,u,c]}),s=u,o=c):"c"===d?(t=s+e.values[0],r=o+e.values[1],i=s+e.values[2],a=o+e.values[3],u=s+e.values[4],c=o+e.values[5],n.push({type:"C",values:[t,r,i,a,u,c]}),s=u,o=c):"Q"===d?(t=e.values[0],r=e.values[1],u=e.values[2],c=e.values[3],n.push({type:"Q",values:[t,r,u,c]}),s=u,o=c):"q"===d?(t=s+e.values[0],r=o+e.values[1],u=s+e.values[2],c=o+e.values[3],n.push({type:"Q",values:[t,r,u,c]}),s=u,o=c):"A"===d?(u=e.values[5],c=e.values[6],n.push({type:"A",values:[e.values[0],e.values[1],e.values[2],e.values[3],e.values[4],u,c]}),s=u,o=c):"a"===d?(u=s+e.values[5],c=o+e.values[6],n.push({type:"A",values:[e.values[0],e.values[1],e.values[2],e.values[3],e.values[4],u,c]}),s=u,o=c):"H"===d?(u=e.values[0],n.push({type:"H",values:[u]}),s=u):"h"===d?(u=s+e.values[0],n.push({type:"H",values:[u]}),s=u):"V"===d?(c=e.values[0],n.push({type:"V",values:[c]}),o=c):"v"===d?(c=o+e.values[0],n.push({type:"V",values:[c]}),o=c):"S"===d?(i=e.values[0],a=e.values[1],u=e.values[2],c=e.values[3],n.push({type:"S",values:[i,a,u,c]}),s=u,o=c):"s"===d?(i=s+e.values[0],a=o+e.values[1],u=s+e.values[2],c=o+e.values[3],n.push({type:"S",values:[i,a,u,c]}),s=u,o=c):"T"===d?(u=e.values[0],c=e.values[1],n.push({type:"T",values:[u,c]}),s=u,o=c):"t"===d?(u=s+e.values[0],c=o+e.values[1],n.push({type:"T",values:[u,c]}),s=u,o=c):"Z"!==d&&"z"!==d||(n.push({type:"Z",values:[]}),s=l,o=h)})),n));return this[c]=i(t),t}if(this[u])return i(this[u]);var n,s,o,l,h,d=r(this.getAttribute("d")||"");return this[u]=i(d),d},e.SVGPathElement.prototype.setPathData=function(e){if(0===e.length)s?this.setAttribute("d",""):this.removeAttribute("d");else{for(var t="",n=0,r=e.length;n=n.duration&&n.count&&n.loopsLeft<=1)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);if(s>n.duration){if(r=Math.floor(s/n.duration),n.count){if(r>=n.loopsLeft)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);n.loopsLeft-=r}n.framesStart+=n.duration*r,s=e-n.framesStart}n.reverse&&(s=n.duration-s),i=n.frames[n.lastFrame=Math.round(s/f)],!1!==n.frameCallback(i.value,!1,i.timeRatio,i.outputRatio)?t=!0:n.framesStart=null}})),t&&(d=m.call(window,Ce))}function ke(e,t){e.framesStart=Date.now(),null!=t&&(e.framesStart-=e.duration*(e.reverse?1-t:t)),e.loopsLeft=e.count,e.lastFrame=null,Ce()}function Se(e,t){var n,s;return typeof e!=typeof t||(n=ue(e)?"obj":Array.isArray(e)?"array":"")!=(ue(t)?"obj":Array.isArray(t)?"array":"")||("obj"===n?Se(s=Object.keys(e).sort(),Object.keys(t).sort())||s.some((function(n){return Se(e[n],t[n])})):"array"===n?e.length!==t.length||e.some((function(e,n){return Se(e,t[n])})):e!==t)}function _e(e){return e?ue(e)?Object.keys(e).reduce((function(t,n){return t[n]=_e(e[n]),t}),{}):Array.isArray(e)?e.map(_e):e:e}function Ee(e){var t,n,s,r=1,i=e=(e+"").trim();function a(e){var t=1,n=ee.exec(e);return n&&(t=parseFloat(n[1]),n[2]?t=0<=t&&t<=100?t/100:1:(t<0||1=Math.abs(s)?0<=t?S:E:0<=s?_:k))}))),A.position_path!==x.position_path||A.position_lineStrokeWidth!==x.position_lineStrokeWidth||[0,1].some((function(e){return A.position_plugOverheadSE[e]!==x.position_plugOverheadSE[e]||(i=C[e],a=x.position_socketXYSE[e],i.x!==a.x||i.y!==a.y||i.socketId!==a.socketId)||(n=t[e],s=x.position_socketGravitySE[e],(r=null==n?"auto":Array.isArray(n)?"array":"number")!=(null==s?"auto":Array.isArray(s)?"array":"number")||("array"==r?n[0]!==s[0]||n[1]!==s[1]:n!==s));var n,s,r,i,a}))){switch(e.pathList.baseVal=s=[],e.pathList.animVal=null,A.position_path){case T:s.push([F(C[0]),F(C[1])]);break;case N:d="number"==typeof t[0]&&0j?(A.position_lineStrokeWidth-j)*H:0),e.socketId===k?((i=(e.y-n.y)/2)=t.x:t.dirId===i?e.y>=t.y:e.x<=t.x}function p(e,t){return t.dirId===n||t.dirId===i?e.x===t.x:e.y===t.y}function f(e){return e[0]?{contain:0,notContain:1}:{contain:1,notContain:0}}function m(e,t,n){return Math.abs(t[n]-e[n])}function g(e,t,s){return"x"===s?e.x=Y?g(l[t.notContain],l[t.contain],u[t.contain]):l[t.contain].dirId)):(s=[{x:l[0].x,y:l[0].y},{x:l[1].x,y:l[1].y}],o.forEach((function(e,t){var n=0===t?1:0,r=m(s[t],s[n],u[t]);rZ&&(l[i]-eZ&&(l[i]-es.outlineMax&&(t=s.outlineMax),t*=2*s.outlineBase,A=Xe(b,v.plugOutline_strokeWidthSE,e,t)||A,A=Xe(b,v.plugOutline_inStrokeWidthSE,e,v.plugOutline_colorTraSE[e]?t-oe/(v.line_strokeWidth/le.lineSize)/w.plugSizeSE[e]*2:t/2)||A)})),A)),(n.faces||he.line||he.plug||he.lineOutline||he.plugOutline)&&(he.faces=(k=(x=t).curStats,S=x.aplStats,_=x.events,E=!1,!k.line_altColor&&Xe(x,S,"line_color",C=k.line_color,_.apl_line_color)&&(x.lineFace.style.stroke=C,E=!0),Xe(x,S,"line_strokeWidth",C=k.line_strokeWidth,_.apl_line_strokeWidth)&&(x.lineShape.style.strokeWidth=C+"px",E=!0,(re||se)&&(qe(x,x.lineShape),se&&(qe(x,x.lineFace),qe(x,x.lineMaskCaps)))),Xe(x,S,"lineOutline_enabled",C=k.lineOutline_enabled,_.apl_lineOutline_enabled)&&(x.lineOutlineFace.style.display=C?"inline":"none",E=!0),k.lineOutline_enabled&&(Xe(x,S,"lineOutline_color",C=k.lineOutline_color,_.apl_lineOutline_color)&&(x.lineOutlineFace.style.stroke=C,E=!0),Xe(x,S,"lineOutline_strokeWidth",C=k.lineOutline_strokeWidth,_.apl_lineOutline_strokeWidth)&&(x.lineOutlineMaskShape.style.strokeWidth=C+"px",E=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace))),Xe(x,S,"lineOutline_inStrokeWidth",C=k.lineOutline_inStrokeWidth,_.apl_lineOutline_inStrokeWidth)&&(x.lineMaskShape.style.strokeWidth=C+"px",E=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace)))),Xe(x,S,"plug_enabled",C=k.plug_enabled,_.apl_plug_enabled)&&(x.plugsFace.style.display=C?"inline":"none",E=!0),k.plug_enabled&&[0,1].forEach((function(e){var t=k.plug_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(x,S.plug_enabledSE,e,C=k.plug_enabledSE[e],_.apl_plug_enabledSE)&&(x.plugsFace.style[s.prop]=C?"url(#"+x.plugMarkerIdSE[e]+")":"none",E=!0),k.plug_enabledSE[e]&&(Xe(x,S.plug_plugSE,e,t,_.apl_plug_plugSE)&&(x.plugFaceSE[e].href.baseVal="#"+n.elmId,He(x,x.plugMarkerSE[e],s.orient,n.bBox,x.svg,x.plugMarkerShapeSE[e],x.plugsFace),E=!0,re&&qe(x,x.plugsFace)),Xe(x,S.plug_colorSE,e,C=k.plug_colorSE[e],_.apl_plug_colorSE)&&(x.plugFaceSE[e].style.fill=C,E=!0,(ie||ae||se)&&!k.line_colorTra&&qe(x,se?x.lineMaskCaps:x.capsMaskLine)),["markerWidth","markerHeight"].forEach((function(t){var n="plug_"+t+"SE";Xe(x,S[n],e,C=k[n][e],_["apl_"+n])&&(x.plugMarkerSE[e][t].baseVal.value=C,E=!0)})),Xe(x,S.plugOutline_enabledSE,e,C=k.plugOutline_enabledSE[e],_.apl_plugOutline_enabledSE)&&(C?(x.plugFaceSE[e].style.mask="url(#"+x.plugMaskIdSE[e]+")",x.plugOutlineFaceSE[e].style.display="inline"):(x.plugFaceSE[e].style.mask="none",x.plugOutlineFaceSE[e].style.display="none"),E=!0),k.plugOutline_enabledSE[e]&&(Xe(x,S.plugOutline_plugSE,e,t,_.apl_plugOutline_plugSE)&&(x.plugOutlineFaceSE[e].href.baseVal=x.plugMaskShapeSE[e].href.baseVal=x.plugOutlineMaskShapeSE[e].href.baseVal="#"+n.elmId,[x.plugMaskSE[e],x.plugOutlineMaskSE[e]].forEach((function(e){e.x.baseVal.value=n.bBox.left,e.y.baseVal.value=n.bBox.top,e.width.baseVal.value=n.bBox.width,e.height.baseVal.value=n.bBox.height})),E=!0),Xe(x,S.plugOutline_colorSE,e,C=k.plugOutline_colorSE[e],_.apl_plugOutline_colorSE)&&(x.plugOutlineFaceSE[e].style.fill=C,E=!0,se&&(qe(x,x.lineMaskCaps),qe(x,x.lineOutlineMaskCaps))),Xe(x,S.plugOutline_strokeWidthSE,e,C=k.plugOutline_strokeWidthSE[e],_.apl_plugOutline_strokeWidthSE)&&(x.plugOutlineMaskShapeSE[e].style.strokeWidth=C+"px",E=!0),Xe(x,S.plugOutline_inStrokeWidthSE,e,C=k.plugOutline_inStrokeWidthSE[e],_.apl_plugOutline_inStrokeWidthSE)&&(x.plugMaskShapeSE[e].style.strokeWidth=C+"px",E=!0)))})),E)),(n.position||he.line||he.plug)&&(he.position=Qe(t)),(n.path||he.position)&&(he.path=(N=(I=t).curStats,O=I.aplStats,R=I.pathList.animVal||I.pathList.baseVal,D=N.path_edge,M=!1,R&&(D.x1=D.x2=R[0][0].x,D.y1=D.y2=R[0][0].y,N.path_pathData=T=Le(R,(function(e){e.xD.x2&&(D.x2=e.x),e.y>D.y2&&(D.y2=e.y)})),Ve(T,O.path_pathData)&&(I.linePath.setPathData(T),O.path_pathData=T,M=!0,se?(qe(I,I.plugsFace),qe(I,I.lineMaskCaps)):re&&qe(I,I.linePath),I.events.apl_path&&I.events.apl_path.forEach((function(e){e(I,T)})))),M)),he.viewBox=(z=(B=t).curStats,P=B.aplStats,W=z.path_edge,G=z.viewBox_bBox,q=P.viewBox_bBox,j=B.svg.viewBox.baseVal,H=B.svg.style,$=!1,K=Math.max(z.line_strokeWidth/2,z.viewBox_plugBCircleSE[0]||0,z.viewBox_plugBCircleSE[1]||0),X={x1:W.x1-K,y1:W.y1-K,x2:W.x2+K,y2:W.y2+K},B.events.new_edge4viewBox&&B.events.new_edge4viewBox.forEach((function(e){e(B,X)})),G.x=z.lineMask_x=z.lineOutlineMask_x=z.maskBGRect_x=X.x1,G.y=z.lineMask_y=z.lineOutlineMask_y=z.maskBGRect_y=X.y1,G.width=X.x2-X.x1,G.height=X.y2-X.y1,["x","y","width","height"].forEach((function(e){var t;(t=G[e])!==q[e]&&(j[e]=q[e]=t,H[U[e]]=t+("x"===e||"y"===e?B.bodyOffset[e]:0)+"px",$=!0)})),$),he.mask=(Q=(Z=t).curStats,J=Z.aplStats,ee=!1,Q.plug_enabled?[0,1].forEach((function(e){Q.capsMaskMarker_enabledSE[e]=Q.plug_enabledSE[e]&&Q.plug_colorTraSE[e]||Q.plugOutline_enabledSE[e]&&Q.plugOutline_colorTraSE[e]})):Q.capsMaskMarker_enabledSE[0]=Q.capsMaskMarker_enabledSE[1]=!1,Q.capsMaskMarker_enabled=Q.capsMaskMarker_enabledSE[0]||Q.capsMaskMarker_enabledSE[1],Q.lineMask_outlineMode=Q.lineOutline_enabled,Q.caps_enabled=Q.capsMaskMarker_enabled||Q.capsMaskAnchor_enabledSE[0]||Q.capsMaskAnchor_enabledSE[1],Q.lineMask_enabled=Q.caps_enabled||Q.lineMask_outlineMode,(Q.lineMask_enabled&&!Q.lineMask_outlineMode||Q.lineOutline_enabled)&&["x","y"].forEach((function(e){var t="maskBGRect_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.maskBGRect[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"lineMask_enabled",Y=Q.lineMask_enabled)&&(Z.lineFace.style.mask=Y?"url(#"+Z.lineMaskId+")":"none",ee=!0,ae&&qe(Z,Z.lineMask)),Q.lineMask_enabled&&(Xe(Z,J,"lineMask_outlineMode",Y=Q.lineMask_outlineMode)&&(Y?(Z.lineMaskBG.style.display="none",Z.lineMaskShape.style.display="inline"):(Z.lineMaskBG.style.display="inline",Z.lineMaskShape.style.display="none"),ee=!0),["x","y"].forEach((function(e){var t="lineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineMask[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"caps_enabled",Y=Q.caps_enabled)&&(Z.lineMaskCaps.style.display=Z.lineOutlineMaskCaps.style.display=Y?"inline":"none",ee=!0,ae&&qe(Z,Z.capsMaskLine)),Q.caps_enabled&&([0,1].forEach((function(e){var t;Xe(Z,J.capsMaskAnchor_enabledSE,e,Y=Q.capsMaskAnchor_enabledSE[e])&&(Z.capsMaskAnchorSE[e].style.display=Y?"inline":"none",ee=!0,ae&&qe(Z,Z.lineMask)),Q.capsMaskAnchor_enabledSE[e]&&(Ve(t=Q.capsMaskAnchor_pathDataSE[e],J.capsMaskAnchor_pathDataSE[e])&&(Z.capsMaskAnchorSE[e].setPathData(t),J.capsMaskAnchor_pathDataSE[e]=t,ee=!0),Xe(Z,J.capsMaskAnchor_strokeWidthSE,e,Y=Q.capsMaskAnchor_strokeWidthSE[e])&&(Z.capsMaskAnchorSE[e].style.strokeWidth=Y+"px",ee=!0))})),Xe(Z,J,"capsMaskMarker_enabled",Y=Q.capsMaskMarker_enabled)&&(Z.capsMaskLine.style.display=Y?"inline":"none",ee=!0),Q.capsMaskMarker_enabled&&[0,1].forEach((function(e){var t=Q.capsMaskMarker_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(Z,J.capsMaskMarker_enabledSE,e,Y=Q.capsMaskMarker_enabledSE[e])&&(Z.capsMaskLine.style[s.prop]=Y?"url(#"+Z.lineMaskMarkerIdSE[e]+")":"none",ee=!0),Q.capsMaskMarker_enabledSE[e]&&(Xe(Z,J.capsMaskMarker_plugSE,e,t)&&(Z.capsMaskMarkerShapeSE[e].href.baseVal="#"+n.elmId,He(Z,Z.capsMaskMarkerSE[e],s.orient,n.bBox,Z.svg,Z.capsMaskMarkerShapeSE[e],Z.capsMaskLine),ee=!0,re&&(qe(Z,Z.capsMaskLine),qe(Z,Z.lineFace))),["markerWidth","markerHeight"].forEach((function(t){var n="capsMaskMarker_"+t+"SE";Xe(Z,J[n],e,Y=Q[n][e])&&(Z.capsMaskMarkerSE[e][t].baseVal.value=Y,ee=!0)})))})))),Q.lineOutline_enabled&&["x","y"].forEach((function(e){var t="lineOutlineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineOutlineMask[e].baseVal.value=Y,ee=!0)})),ee),n.effect&&(ue=(te=t).curStats,ce=te.aplStats,Object.keys(e).forEach((function(t){var n=e[t],s=t+"_enabled",r=t+"_options",i=ue[r];Xe(te,ce,s,ne=ue[s])?(ne&&(ce[r]=_e(i)),n[ne?"init":"remove"](te)):ne&&Se(i,ce[r])&&(n.remove(te),ce[s]=!0,ce[r]=_e(i),n.init(te))}))),(ie||ae)&&he.line&&!he.path&&qe(t,t.lineShape),ie&&he.plug&&!he.line&&qe(t,t.plugsFace),je(t)}function tt(e,t){return{duration:ce(e.duration)&&0t.x2&&(t.x2=s.x2),s.y2>t.y2&&(t.y2=s.y2),["x","y"].forEach((function(n){var s,a="dropShadow_"+n;r[a]=s=t[n+"1"],Xe(e,i,a,s)&&(e.efc_dropShadow_elmFilter[n].baseVal.value=s)})))}}},Object.keys(e).forEach((function(t){var n=e[t],s=n.stats;s[t+"_enabled"]={iniValue:!1},s[t+"_options"]={hasProps:!0},n.anim&&(s[t+"_animOptions"]={},s[t+"_animId"]={})})),t={none:{defaultAnimOptions:{},init:function(e,n){var s=e.curStats;s.show_animId&&(he.remove(s.show_animId),s.show_animId=null),t.none.start(e,n)},start:function(e,n){t.none.stop(e,!0)},stop:function(e,t,n){var s=e.curStats;return n=null!=n?n:e.aplStats.show_on,s.show_inAnim=!1,t&&Je(e,n),n?1:0}},fade:{defaultAnimOptions:{duration:300,timing:"linear"},init:function(e,n){var s=e.curStats,r=e.aplStats;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){return e}),(function(n,s){s?t.fade.stop(e,!0):(e.svg.style.opacity=n+"",se&&(qe(e,e.svg),je(e)))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.fade.start(e,n)},start:function(e,t){var n,s=e.curStats;s.show_inAnim&&(n=he.stop(s.show_animId)),Je(e,1),s.show_inAnim=!0,he.start(s.show_animId,!e.aplStats.show_on,null!=t?t:n)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.svg.style.opacity=n?"":"0",Je(e,n)),s}},draw:{defaultAnimOptions:{duration:500,timing:[.58,0,.42,1]},init:function(e,n){var s=e.curStats,r=e.aplStats,i=e.pathList.baseVal,a=Pe(i),o=a.segsLen,l=a.lenAll;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){var t,n,s,r,a=-1;if(0===e)n=[[i[0][0],i[0][0]]];else if(1===e)n=i;else{for(t=l*e,n=[];t>=o[++a];)n.push(i[a]),t-=o[a];t&&(2===(s=i[a]).length?n.push([s[0],De(s[0],s[1],t/o[a])]):(r=Fe(s[0],s[1],s[2],s[3],ze(s[0],s[1],s[2],s[3],t)),n.push([s[0],r.fromP1,r.fromP2,r])))}return n}),(function(n,s){s?t.draw.stop(e,!0):(e.pathList.animVal=n,et(e,{path:!0}))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.draw.start(e,n)},start:function(e,n){var s,r=e.curStats;r.show_inAnim&&(s=he.stop(r.show_animId)),Je(e,1),r.show_inAnim=!0,We(e,"apl_position",t.draw.update),he.start(r.show_animId,!e.aplStats.show_on,null!=n?n:s)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.pathList.animVal=n?null:[[e.pathList.baseVal[0][0],e.pathList.baseVal[0][0]]],et(e,{path:!0}),Je(e,n)),s},update:function(e){Ge(e,"apl_position",t.draw.update),e.curStats.show_inAnim?t.draw.init(e,t.draw.stop(e)):e.aplStats.show_animOptions={}}}},[["start","anchorSE",0],["end","anchorSE",1],["color","lineColor"],["size","lineSize"],["startSocketGravity","socketGravitySE",0],["endSocketGravity","socketGravitySE",1],["startPlugColor","plugColorSE",0],["endPlugColor","plugColorSE",1],["startPlugSize","plugSizeSE",0],["endPlugSize","plugSizeSE",1],["outline","lineOutlineEnabled"],["outlineColor","lineOutlineColor"],["outlineSize","lineOutlineSize"],["startPlugOutline","plugOutlineEnabledSE",0],["endPlugOutline","plugOutlineEnabledSE",1],["startPlugOutlineColor","plugOutlineColorSE",0],["endPlugOutlineColor","plugOutlineColorSE",1],["startPlugOutlineSize","plugOutlineSizeSE",0],["endPlugOutlineSize","plugOutlineSizeSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2];Object.defineProperty(at.prototype,t,{get:function(){var e=null!=s?be[this._id].options[n][s]:n?be[this._id].options[n]:be[this._id].options[t];return null==e?G:_e(e)},set:ot(t),enumerable:!0})})),[["path",M],["startSocket",I,"socketSE",0],["endSocket",I,"socketSE",1],["startPlug",P,"plugSE",0],["endPlug",P,"plugSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2],r=e[3];Object.defineProperty(at.prototype,t,{get:function(){var e,i=null!=r?be[this._id].options[s][r]:s?be[this._id].options[s]:be[this._id].options[t];return i?Object.keys(n).some((function(t){return n[t]===i&&(e=t,!0)}))?e:new Error("It's broken"):G},set:ot(t),enumerable:!0})})),Object.keys(e).forEach((function(t){var n=e[t];Object.defineProperty(at.prototype,t,{get:function(){var e,s,r=be[this._id].options[t];return ue(r)?(e=r,s=n.optionsConf.reduce((function(t,n){var s,r=n[0],i=n[1],a=n[2],o=n[3],l=n[4],u=null!=l?e[o][l]:o?e[o]:e[i];return t[i]="id"===r?u?Object.keys(a).some((function(e){return a[e]===u&&(s=e,!0)}))?s:new Error("It's broken"):G:null==u?G:_e(u),t}),{}),n.anim&&(s.animation=_e(e.animation)),s):r},set:ot(t),enumerable:!0})})),["startLabel","endLabel","middleLabel"].forEach((function(e,t){Object.defineProperty(at.prototype,e,{get:function(){var e=be[this._id],n=e.options;return n.labelSEM[t]&&!e.optionIsAttach.labelSEM[t]?ve[n.labelSEM[t]._id].text:n.labelSEM[t]||""},set:ot(e),enumerable:!0})})),at.prototype.setOptions=function(e){return it(be[this._id],e),this},at.prototype.position=function(){return et(be[this._id],{position:!0}),this},at.prototype.remove=function(){var t=be[this._id],n=t.curStats;Object.keys(e).forEach((function(e){var t=e+"_animId";n[t]&&he.remove(n[t])})),n.show_animId&&he.remove(n.show_animId),t.attachments.slice().forEach((function(e){rt(t,e)})),t.baseWindow&&t.svg&&t.baseWindow.document.body.removeChild(t.svg),delete be[this._id]},at.prototype.show=function(e,t){return nt(be[this._id],!0,e,t),this},at.prototype.hide=function(e,t){return nt(be[this._id],!1,e,t),this},i=function(e){e&&ve[e._id]&&(e.boundTargets.slice().forEach((function(t){rt(t.props,e,!0)})),e.conf.remove&&e.conf.remove(e),delete ve[e._id])},lt.prototype.remove=function(){var e=this,t=ve[e._id];t&&(t.boundTargets.slice().forEach((function(e){t.conf.removeOption(t,e)})),Ue((function(){var t=ve[e._id];t&&i(t)})))},s=lt,window.LeaderLineAttachment=s,r=function(e,t){return e instanceof s&&(!(e.isRemoved||t&&ve[e._id].conf.type!==t)||null)},n={pointAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie}],init:function(e,t){return e.element=n.pointAnchor.checkElement(t.element),e.x=n.pointAnchor.parsePercent(t.x,!0)||[.5,!0],e.y=n.pointAnchor.parsePercent(t.y,!0)||[.5,!0],!0},removeOption:function(e,t){var r=t.props,i={},a=e.element,o=r.options.anchorSE["start"===t.optionName?1:0];a===o&&(a=o===document.body?new s(n.pointAnchor,[a]):document.body),i[t.optionName]=a,it(r,i)},getBBoxNest:function(e,t){var n=Oe(e.element,t.baseWindow),s=n.width,r=n.height;return n.width=n.height=0,n.left=n.right=n.left+e.x[0]*(e.x[1]?s:1),n.top=n.bottom=n.top+e.y[0]*(e.y[1]?r:1),n},parsePercent:function(e,t){var n,s,r=!1;return ce(e)?s=e:"string"==typeof e&&(n=ee.exec(e))&&n[2]&&(r=0!=(s=parseFloat(n[1])/100)),null!=s&&(t||0<=s)?[s,r]:null},checkElement:function(e){if(null==e)e=document.body;else if(!Ie(e))throw new Error("`element` must be Element");return e}},areaAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"shape",type:"string"}],stats:{color:{},strokeWidth:{},elementWidth:{},elementHeight:{},elementLeft:{},elementTop:{},pathListRel:{},bBoxRel:{},pathData:{},viewBoxBBox:{hasProps:!0},dashLen:{},dashGap:{}},init:function(e,t){var s,r,i,a=[];return e.element=n.pointAnchor.checkElement(t.element),"string"==typeof t.color&&(e.color=t.color.trim()),"string"==typeof t.fillColor&&(e.fill=t.fillColor.trim()),ce(t.size)&&0<=t.size&&(e.size=t.size),t.dash&&(e.dash=!0,ce(t.dash.len)&&0s.right&&(s.right=n),is.bottom&&(s.bottom=i)):s={left:n,right:n,top:i,bottom:i},r?D.pathListRel.push([r,{x:n,y:i}]):D.pathListRel=[],r={x:n,y:i}})),D.pathListRel.push([]),i=D.strokeWidth/2,a=[{x:s.left-i,y:s.top-i},{x:s.right+i,y:s.bottom+i}],D.bBoxRel={left:a[0].x,top:a[0].y,right:a[1].x,bottom:a[1].y,width:a[1].x-a[0].x,height:a[1].y-a[0].y}}B.pathListRel=B.bBoxRel=!0}return(B.pathListRel||B.elementLeft||B.elementTop)&&(D.pathData=Le(D.pathListRel,(function(e){e.x+=t.left,e.y+=t.top}))),Xe(e,M,"strokeWidth",n=D.strokeWidth)&&(e.path.style.strokeWidth=n+"px"),Ve(n=D.pathData,M.pathData)&&(e.path.setPathData(n),M.pathData=n,B.pathData=!0),e.dash&&(!B.pathData&&(!B.strokeWidth||e.dashLen&&e.dashGap)||(D.dashLen=e.dashLen||2*D.strokeWidth,D.dashGap=e.dashGap||D.strokeWidth),B.dash=Xe(e,M,"dashLen",D.dashLen)||B.dash,B.dash=Xe(e,M,"dashGap",D.dashGap)||B.dash,B.dash&&(e.path.style.strokeDasharray=M.dashLen+","+M.dashGap)),T=D.viewBoxBBox,N=M.viewBoxBBox,O=e.svg.viewBox.baseVal,R=e.svg.style,T.x=D.bBoxRel.left+t.left,T.y=D.bBoxRel.top+t.top,T.width=D.bBoxRel.width,T.height=D.bBoxRel.height,["x","y","width","height"].forEach((function(t){(n=T[t])!==N[t]&&(O[t]=N[t]=n,R[U[t]]=n+("x"===t||"y"===t?e.bodyOffset[t]:0)+"px")})),B.strokeWidth||B.pathListRel||B.bBoxRel}},mouseHoverAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"showEffectName",type:"string"}],style:{backgroundImage:"url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg==')",backgroundSize:"",backgroundRepeat:"no-repeat",backgroundColor:"#f8f881",cursor:"default"},hoverStyle:{backgroundImage:"none",backgroundColor:"#fadf8f"},padding:{top:1,right:15,bottom:1,left:2},minHeight:15,backgroundPosition:{right:2,top:2},backgroundSize:{width:12,height:12},dirKeys:[["top","Top"],["right","Right"],["bottom","Bottom"],["left","Left"]],init:function(e,s){var r,i,a,o,l,u,c,h,d,p,f,m=n.mouseHoverAnchor,g={};if(e.element=n.pointAnchor.checkElement(s.element),!((p=(h=e.element).ownerDocument)&&(d=p.defaultView)&&d.HTMLElement&&h instanceof d.HTMLElement))throw new Error("`element` must be HTML element");return m.style.backgroundSize=m.backgroundSize.width+"px "+m.backgroundSize.height+"px",["style","hoverStyle"].forEach((function(t){var n=m[t];e[t]=Object.keys(n).reduce((function(e,t){return e[t]=n[t],e}),{})})),"inline"===(r=e.element.ownerDocument.defaultView.getComputedStyle(e.element,"")).display?e.style.display="inline-block":"none"===r.display&&(e.style.display="block"),n.mouseHoverAnchor.dirKeys.forEach((function(t){var n=t[0],s="padding"+t[1];parseFloat(r[s])e.x2&&(e.x2=s.x2),s.y2>e.y2&&(e.y2=s.y2)},newText:function(e,t,n,s,r){var i,a,o,u,c,h=t.createElementNS(te,"text");return h.textContent=e,[h.x,h.y].forEach((function(e){var t=n.createSVGLength();t.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),e.baseVal.initialize(t)})),"boolean"!=typeof l&&(l="paintOrder"in h.style),r&&!l?(a=t.createElementNS(te,"defs"),h.id=s,a.appendChild(h),(u=(i=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(o=i.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(c=u.style).strokeLinejoin="round",{elmPosition:h,styleText:h.style,styleFill:o.style,styleStroke:c,styleShow:i.style,elmsAppend:[a,i]}):(c=h.style,r&&(c.strokeLinejoin="round",c.paintOrder="stroke"),{elmPosition:h,styleText:c,styleFill:c,styleStroke:r?c:null,styleShow:c,elmsAppend:[h]})},getMidPoint:function(e,t){var n,s,r=Pe(e),i=r.segsLen,a=r.lenAll,o=-1,l=a/2+(t||0);if(l<=0)return 2===(n=e[0]).length?De(n[0],n[1],0):Fe(n[0],n[1],n[2],n[3],0);if(a<=l)return 2===(n=e[e.length-1]).length?De(n[0],n[1],1):Fe(n[0],n[1],n[2],n[3],1);for(s=[];l>i[++o];)s.push(e[o]),l-=i[o];return 2===(n=e[o]).length?De(n[0],n[1],l/i[o]):Fe(n[0],n[1],n[2],n[3],ze(n[0],n[1],n[2],n[3],l))},initSvg:function(e,t){var s,r,i=n.captionLabel.newText(e.text,t.baseWindow.document,t.svg,C+"-captionLabel-"+e._id,e.outlineColor);["elmPosition","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),s=i.elmPosition.getBBox(),e.width=s.width,e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,i.styleStroke.strokeWidth=r+"px",i.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.captionLabel.stats),e.updateColor(t),e.refSocketXY?e.updateSocketXY(t):e.updatePath(t),ae&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),(e.refSocketXY="startLabel"===t.optionName||"endLabel"===t.optionName)?(e.socketIndex="startLabel"===t.optionName?0:1,We(s,"apl_position",e.updateSocketXY),e.offset||(We(s,"cur_attach_plugSideLenSE",e.updateSocketXY),We(s,"cur_line_strokeWidth",e.updateSocketXY))):We(s,"apl_path",e.updatePath),We(s,"svgShow",e.updateShow),ae&&We(s,"new_edge4viewBox",e.adjustEdge),n.captionLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.captionLabel.stats),Ke(e.aplStats,n.captionLabel.stats),e.color||Ge(s,"cur_line_color",e.updateColor),e.refSocketXY?(Ge(s,"apl_position",e.updateSocketXY),e.offset||(Ge(s,"cur_attach_plugSideLenSE",e.updateSocketXY),Ge(s,"cur_line_strokeWidth",e.updateSocketXY))):Ge(s,"apl_path",e.updatePath),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.captionLabel.unbind(e,t)}))}},pathLabel:{type:"label",argOptions:[{optionName:"text",type:"string"}],stats:{color:{},startOffset:{},pathData:{}},init:function(e,t){return"string"==typeof t.text&&(e.text=t.text.trim()),!!e.text&&("string"==typeof t.color&&(e.color=t.color.trim()),e.outlineColor="string"==typeof t.outlineColor?t.outlineColor.trim():"#fff",ce(t.lineOffset)&&(e.lineOffset=t.lineOffset),n.captionLabel.textStyleProps.forEach((function(n){null!=t[n]&&(e[n]=t[n])})),e.updateColor=function(t){n.captionLabel.updateColor(e,t)},e.updatePath=function(t){var s,r=e.curStats,i=e.aplStats,a=t.curStats,o=t.pathList.animVal||t.pathList.baseVal;o&&(r.pathData=s=n.pathLabel.getOffsetPathData(o,a.line_strokeWidth/2+e.strokeWidth/2+e.height/4,1.25*e.height),Ve(s,i.pathData)&&(e.elmPath.setPathData(s),i.pathData=s,e.bBox=e.elmPosition.getBBox(),e.updateStartOffset(t)))},e.updateStartOffset=function(t){var n,s,r,i,a=e.curStats,o=e.aplStats,l=t.curStats;a.pathData&&(2===e.semIndex&&!e.lineOffset||(r=a.pathData.reduce((function(e,t){var n,r=t.values;switch(t.type){case"M":s={x:r[0],y:r[1]};break;case"L":n={x:r[0],y:r[1]},s&&(e+=Re(s,n)),s=n;break;case"C":n={x:r[4],y:r[5]},s&&(e+=Be(s,{x:r[0],y:r[1]},{x:r[2],y:r[3]},n)),s=n}return e}),0),i=0===e.semIndex?0:1===e.semIndex?r:r/2,2!==e.semIndex&&(n=Math.max(l.attach_plugBackLenSE[e.semIndex]||0,l.line_strokeWidth/2)+e.strokeWidth/2+e.height/4,i=(i+=0===e.semIndex?n:-n)<0?0:rt?((r=s.points)[1]=Me(r[0],r[1],-t),s.len=Re(r[0],r[1])):(s.points=null,s.len=0),e.len>t+n?((r=e.points)[0]=Me(r[1],r[0],-(t+n)),e.len=Re(r[0],r[1])):(e.points=null,e.len=0)),e):null})),i.reduce((function(e,t){var n=t.points;return n&&(r&&a(n[0],r)||e.push({type:"M",values:[n[0].x,n[0].y]}),"line"===t.type?e.push({type:"L",values:[n[1].x,n[1].y]}):(n.shift(),n.forEach((function(t){e.push({type:"L",values:[t.x,t.y]})}))),r=n[n.length-1]),e}),[])},newText:function(e,t,n,s){var r,i,a,o,u,c,h,d,p=t.createElementNS(te,"defs"),f=p.appendChild(t.createElementNS(te,"path"));return f.id=r=n+"-path",(o=(a=t.createElementNS(te,"text")).appendChild(t.createElementNS(te,"textPath"))).href.baseVal="#"+r,o.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),o.textContent=e,"boolean"!=typeof l&&(l="paintOrder"in a.style),s&&!l?(a.id=i=n+"-text",p.appendChild(a),(h=(u=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(c=u.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(d=h.style).strokeLinejoin="round",{elmPosition:a,elmPath:f,elmOffset:o,styleText:a.style,styleFill:c.style,styleStroke:d,styleShow:u.style,elmsAppend:[p,u]}):(d=a.style,s&&(d.strokeLinejoin="round",d.paintOrder="stroke"),{elmPosition:a,elmPath:f,elmOffset:o,styleText:d,styleFill:d,styleStroke:s?d:null,styleShow:d,elmsAppend:[p,a]})},initSvg:function(e,t){var s,r,i=n.pathLabel.newText(e.text,t.baseWindow.document,C+"-pathLabel-"+e._id,e.outlineColor);["elmPosition","elmPath","elmOffset","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),i.elmPath.setPathData([{type:"M",values:[0,100]},{type:"h",values:[100]}]),s=i.elmPosition.getBBox(),i.styleText.textAnchor=["start","end","middle"][e.semIndex],2!==e.semIndex||e.lineOffset||i.elmOffset.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE,50),e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,i.styleStroke.strokeWidth=r+"px",i.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.pathLabel.stats),e.updateColor(t),e.updatePath(t),e.updateStartOffset(t),ae&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),We(s,"cur_line_strokeWidth",e.updatePath),We(s,"apl_path",e.updatePath),e.semIndex="startLabel"===t.optionName?0:"endLabel"===t.optionName?1:2,2===e.semIndex&&!e.lineOffset||We(s,"cur_attach_plugBackLenSE",e.updateStartOffset),We(s,"svgShow",e.updateShow),ae&&We(s,"new_edge4viewBox",e.adjustEdge),n.pathLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.elmPath=e.elmOffset=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.pathLabel.stats),Ke(e.aplStats,n.pathLabel.stats),e.color||Ge(s,"cur_line_color",e.updateColor),Ge(s,"cur_line_strokeWidth",e.updatePath),Ge(s,"apl_path",e.updatePath),2===e.semIndex&&!e.lineOffset||Ge(s,"cur_attach_plugBackLenSE",e.updateStartOffset),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.pathLabel.unbind(e,t)}))}}},Object.keys(n).forEach((function(e){at[e]=function(){return new s(n[e],Array.prototype.slice.call(arguments))}})),at.positionByWindowResize=!0,window.addEventListener("resize",pe.add((function(){at.positionByWindowResize&&Object.keys(be).forEach((function(e){et(be[e],{position:!0})}))})),!1),at}();e.exports=t},7503:function(e,t,n){var s;e=n.nmd(e),function(){"use strict";var r={function:!0,object:!0},i=r[typeof window]&&window||this,a=r[typeof t]&&t,o=r.object&&e&&!e.nodeType&&e,l=a&&o&&"object"==typeof n.g&&n.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(i=l);var u=Math.pow(2,53)-1,c=/\bOpera/,h=Object.prototype,d=h.hasOwnProperty,p=h.toString;function f(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function m(e){return e=v(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:f(e)}function g(e,t){for(var n in e)d.call(e,n)&&t(e[n],n,e)}function y(e){return null==e?f(e):p.call(e).slice(8,-1)}function b(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function w(e,t){var n=null;return function(e,t){var n=-1,s=e?e.length:0;if("number"==typeof s&&s>-1&&s<=u)for(;++n3?"WebKit":/\bOpera\b/.test(P)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(L)&&"WebKit"||!L&&/\bMSIE\b/i.test(t)&&("Mac OS"==G?"Tasman":"Trident")||"WebKit"==L&&/\bPlayStation\b(?! Vita\b)/i.test(P)&&"NetFront")&&(L=[o]),"IE"==P&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(P+=" Mobile",G="Windows Phone "+(/\+$/.test(o)?o:o+".x"),M.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(P="IE Mobile",G="Windows Phone 8.x",M.unshift("desktop mode"),z||(z=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=P&&"Trident"==L&&(o=/\brv:([\d.]+)/.exec(t))&&(P&&M.push("identifying as "+P+(z?" "+z:"")),P="IE",z=o[1]),B){if(h="global",d=null!=(u=n)?typeof u[h]:"number",/^(?:boolean|number|string|undefined)$/.test(d)||"object"==d&&!u[h])y(o=n.runtime)==x?(P="Adobe AIR",G=o.flash.system.Capabilities.os):y(o=n.phantom)==S?(P="PhantomJS",z=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof N.documentMode&&(o=/\bTrident\/(\d+)/i.exec(t))?(z=[z,N.documentMode],(o=+o[1]+4)!=z[1]&&(M.push("IE "+z[1]+" mode"),L&&(L[1]=""),z[1]=o),z="IE"==P?String(z[1].toFixed(1)):z[0]):"number"==typeof N.documentMode&&/^(?:Chrome|Firefox)\b/.test(P)&&(M.push("masking as "+P+" "+z),P="IE",z="11.0",L=["Trident"],G="Windows");else if(_&&(D=(o=_.lang.System).getProperty("os.arch"),G=G||o.getProperty("os.name")+" "+o.getProperty("os.version")),E){try{z=n.require("ringo/engine").version.join("."),P="RingoJS"}catch(e){(o=n.system)&&o.global.system==n.system&&(P="Narwhal",G||(G=o[0].os||null))}P||(P="Rhino")}else"object"==typeof n.process&&!n.process.browser&&(o=n.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(M.push("Node "+o.versions.node),P="Electron",z=o.versions.electron):"string"==typeof o.versions.nw&&(M.push("Chromium "+z,"Node "+o.versions.node),P="NW.js",z=o.versions.nw)),P||(P="Node.js",D=o.arch,G=o.platform,z=(z=/[\d.]+/.exec(o.version))?z[0]:null));G=G&&m(G)}if(z&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(z)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(B&&r.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(F=/b/i.test(o)?"beta":"alpha",z=z.replace(RegExp(o+"\\+?$"),"")+("beta"==F?T:I)+(/\d+\+?/.exec(o)||"")),"Fennec"==P||"Firefox"==P&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(G))P="Firefox Mobile";else if("Maxthon"==P&&z)z=z.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(V))"Xbox 360"==V&&(G=null),"Xbox 360"==V&&/\bIEMobile\b/.test(t)&&M.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(P)&&(!P||V||/Browser|Mobi/.test(P))||"Windows CE"!=G&&!/Mobi/i.test(t))if("IE"==P&&B)try{null===n.external&&M.unshift("platform preview")}catch(e){M.unshift("embedded")}else(/\bBlackBerry\b/.test(V)||/\bBB10\b/.test(t))&&(o=(RegExp(V.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||z)?(G=((o=[o,/BB10/.test(t)])[1]?(V=null,W="BlackBerry"):"Device Software")+" "+o[0],z=null):this!=g&&"Wii"!=V&&(B&&O||/Opera/.test(P)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==P&&/\bOS X (?:\d+\.){2,}/.test(G)||"IE"==P&&(G&&!/^Win/.test(G)&&z>5.5||/\bWindows XP\b/.test(G)&&z>8||8==z&&!/\bTrident\b/.test(t)))&&!c.test(o=e.call(g,t.replace(c,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),c.test(P)?(/\bIE\b/.test(o)&&"Mac OS"==G&&(G=null),o="identify"+o):(o="mask"+o,P=R?m(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(G=null),B||(z=null)),L=["Presto"],M.push(o));else P+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==P&&"+"==o[1].slice(-1)?(P="WebKit Nightly",F="alpha",z=o[1].slice(0,-1)):z!=o[1]&&z!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(z=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==L&&(L=["Blink"]),B&&(f||o[1])?(L&&(L[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=L?"27":"28")):(L&&(L[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),L&&(L[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==P&&(!z||parseInt(z)>45)?z=o:"Chrome"==P&&/\bHeadlessChrome/i.test(t)&&M.unshift("headless")),"Opera"==P&&(o=/\bzbov|zvav$/.exec(G))?(P+=" ",M.unshift("desktop mode"),"zvav"==o?(P+="Mini",z=null):P+="Mobile",G=G.replace(RegExp(" *"+o+"$"),"")):"Safari"==P&&/\bChrome\b/.exec(L&&L[1])?(M.unshift("desktop mode"),P="Chrome Mobile",z=null,/\bOS X\b/.test(G)?(W="Apple",G="iOS 4.3+"):G=null):/\bSRWare Iron\b/.test(P)&&!z&&(z=q("Chrome")),z&&0==z.indexOf(o=/[\d.]+$/.exec(G))&&t.indexOf("/"+o+"-")>-1&&(G=v(G.replace(o,""))),G&&-1!=G.indexOf(P)&&!RegExp(P+" OS").test(G)&&(G=G.replace(RegExp(" *"+b(P)+" *"),"")),L&&!/\b(?:Avant|Nook)\b/.test(P)&&(/Browser|Lunascape|Maxthon/.test(P)||"Safari"!=P&&/^iOS/.test(G)&&/\bSafari\b/.test(L[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(P)&&L[1])&&(o=L[L.length-1])&&M.push(o),M.length&&(M=["("+M.join("; ")+")"]),W&&V&&V.indexOf(W)<0&&M.push("on "+W),V&&M.push((/^on /.test(M[M.length-1])?"":"on ")+V),G&&(o=/ ([\d.+]+)$/.exec(G),l=o&&"/"==G.charAt(G.length-o[0].length-1),G={architecture:32,family:o&&!l?G.replace(o[0],""):G,version:o?o[1]:null,toString:function(){var e=this.version;return this.family+(e&&!l?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(D))&&!/\bi686\b/i.test(D)?(G&&(G.architecture=64,G.family=G.family.replace(RegExp(" *"+o),"")),P&&(/\bWOW64\b/i.test(t)||B&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(t))&&M.unshift("32-bit")):G&&/^OS X/.test(G.family)&&"Chrome"==P&&parseFloat(z)>=39&&(G.architecture=64),t||(t=null);var j={};return j.description=t,j.layout=L&&L[0],j.manufacturer=W,j.name=P,j.prerelease=F,j.product=V,j.ua=t,j.version=P&&z,j.os=G||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=e,j.toString=function(){return this.description||""},j.version&&M.unshift(z),j.name&&M.unshift(P),G&&P&&(G!=String(G).split(" ")[0]||G!=P.split(" ")[0]&&!V)&&M.push(V?"("+G+")":"on "+G),M.length&&(j.description=M.join(" ")),j}();i.platform=A,void 0===(s=function(){return A}.call(t,n,t,e))||(e.exports=s)}.call(this)},115:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,s="function"==typeof Set,r="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var o,l,u,c;if(Array.isArray(e)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(!i(e[l],a[l]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!a.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!i(l.value[1],a.get(l.value[0])))return!1;return!0}if(s&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(e[l]!==a[l])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((o=(u=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(l=o;0!=l--;)if(!Object.prototype.hasOwnProperty.call(a,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!i(e[u[l]],a[u[l]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return!1;throw e}}},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,s=0;s{"use strict";var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,r&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},402:e=>{e.exports=''},3389:e=>{e.exports=''},627:e=>{e.exports=''},8110:e=>{e.exports=''},980:e=>{e.exports=''},3890:e=>{e.exports=''},880:e=>{e.exports=''},3282:e=>{e.exports=''},4948:function(e){e.exports=function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function s(e,n,s){t(e,n),n.set(e,s)}function r(t,n,s){return t.set(e(t,n),s),s}const i=100,a={},o=()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus()},l=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;a.restoreFocusTimeout=setTimeout((()=>{o(),t()}),i),window.scrollTo(n,s)})),u="swal2-",c=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=u+t,e)),{}),h=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=u+t,e)),{}),d=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>{},f=e=>{},m=[],g=e=>{m.includes(e)||(m.push(e),p(e))},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},b=e=>"function"==typeof e?e():e,w=e=>e&&"function"==typeof e.toPromise,v=e=>w(e)?e.toPromise():Promise.resolve(e),A=e=>e&&Promise.resolve(e)===e,x=()=>document.body.querySelector(`.${c.container}`),C=e=>{const t=x();return t?t.querySelector(e):null},k=e=>C(`.${e}`),S=()=>k(c.popup),_=()=>k(c.icon),E=()=>k(c["icon-content"]),I=()=>k(c.title),T=()=>k(c["html-container"]),N=()=>k(c.image),O=()=>k(c["progress-steps"]),R=()=>k(c["validation-message"]),D=()=>C(`.${c.actions} .${c.confirm}`),M=()=>C(`.${c.actions} .${c.cancel}`),F=()=>C(`.${c.actions} .${c.deny}`),B=()=>k(c["input-label"]),z=()=>C(`.${c.loader}`),L=()=>k(c.actions),P=()=>k(c.footer),V=()=>k(c["timer-progress-bar"]),W=()=>k(c.close),G='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n',U=()=>{const e=S();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>ue(e)))},q=()=>K(document.body,c.shown)&&!K(document.body,c["toast-shown"])&&!K(document.body,c["no-backdrop"]),j=()=>{const e=S();return!!e&&K(e,c.toast)},H=()=>{const e=S();return!!e&&e.hasAttribute("data-loading")},$=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},K=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach((n=>{Object.values(c).includes(n)||Object.values(h).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))},Z=(e,t,n)=>{if(X(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?ee(e,s):p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${c.popup} > .${c[t]}`);case"checkbox":return e.querySelector(`.${c.popup} > .${c.checkbox} input`);case"radio":return e.querySelector(`.${c.popup} > .${c.radio} input:checked`)||e.querySelector(`.${c.popup} > .${c.radio} input:first-child`);case"range":return e.querySelector(`.${c.popup} > .${c.range} input`);default:return e.querySelector(`.${c.popup} > .${c.input}`)}},Q=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},J=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},ee=(e,t)=>{J(e,t,!0)},te=(e,t)=>{J(e,t,!1)},ne=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},ie=e=>{e&&(e.style.display="none")},ae=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{le(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},oe=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},le=function(e,t){t?re(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ie(e)},ue=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ce=()=>!ue(D())&&!ue(F())&&!ue(M()),he=e=>!!(e.scrollHeight>e.clientHeight),de=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},pe=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=V();n&&ue(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},fe=()=>{const e=V();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},me=()=>"undefined"==typeof window||"undefined"==typeof document,ge=`\n
\n \n
    \n
    \n \n

    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n`.replace(/(^|\n)\s*/g,""),ye=()=>{const e=x();return!!e&&(e.remove(),te([document.documentElement,document.body],[c["no-backdrop"],c["toast-shown"],c["has-column"]]),!0)},be=()=>{a.currentInstance.resetValidationMessage()},we=()=>{const e=S(),t=ne(e,c.input),n=ne(e,c.file),s=e.querySelector(`.${c.range} input`),r=e.querySelector(`.${c.range} output`),i=ne(e,c.select),a=e.querySelector(`.${c.checkbox} input`),o=ne(e,c.textarea);t.oninput=be,n.onchange=be,i.onchange=be,a.onchange=be,o.oninput=be,s.oninput=()=>{be(),r.value=s.value},s.onchange=()=>{be(),r.value=s.value}},ve=e=>"string"==typeof e?document.querySelector(e):e,Ae=e=>{const t=S();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},xe=e=>{"rtl"===window.getComputedStyle(e).direction&&ee(x(),c.rtl)},Ce=e=>{const t=ye();if(me())return void f("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=c.container,t&&ee(n,c["no-transition"]),$(n,ge);const s=ve(e.target);s.appendChild(n),Ae(e),xe(s),we()},ke=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?Se(e,t):e&&$(t,e)},Se=(e,t)=>{e.jquery?_e(t,e):$(t,e.toString())},_e=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Ee=(()=>{if(me())return!1;const e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"})(),Ie=(e,t)=>{const n=L(),s=z();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?re(n):ie(n),Z(n,t,"actions"),Te(n,s,t),$(s,t.loaderHtml||""),Z(s,t,"loader"))};function Te(e,t,n){const s=D(),r=F(),i=M();s&&r&&i&&(Oe(s,"confirm",n),Oe(r,"deny",n),Oe(i,"cancel",n),Ne(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function Ne(e,t,n,s){s.buttonsStyling?(ee([e,t,n],c.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,ee(e,c["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,ee(t,c["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,ee(n,c["default-outline"]))):te([e,t,n],c.styled)}function Oe(e,t,n){const s=d(t);le(e,n[`show${s}Button`],"inline-block"),$(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=c[t],Z(e,n,`${t}Button`)}const Re=(e,t)=>{const n=W();n&&($(n,t.closeButtonHtml||""),Z(n,t,"closeButton"),le(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},De=(e,t)=>{const n=x();n&&(Me(n,t.backdrop),Fe(n,t.position),Be(n,t.grow),Z(n,t,"container"))};function Me(e,t){"string"==typeof t?e.style.background=t:t||ee([document.documentElement,document.body],c["no-backdrop"])}function Fe(e,t){t&&(t in c?ee(e,c[t]):(p('The "position" parameter is not valid, defaulting to "center"'),ee(e,c.center)))}function Be(e,t){t&&ee(e,c[`grow-${t}`])}var ze={innerParams:new WeakMap,domCache:new WeakMap};const Le=["input","file","range","select","radio","checkbox","textarea"],Pe=(e,t)=>{const n=S();if(!n)return;const s=ze.innerParams.get(e),r=!s||t.input!==s.input;Le.forEach((e=>{const s=ne(n,c[e]);s&&(Ge(e,t.inputAttributes),s.className=c[e],r&&ie(s))})),t.input&&(r&&Ve(t),Ue(t))},Ve=e=>{if(!e.input)return;if(!Ke[e.input])return void f(`Unexpected type of input! Expected ${Object.keys(Ke).join(" | ")}, got "${e.input}"`);const t=He(e.input);if(!t)return;const n=Ke[e.input](t,e);re(t),e.inputAutoFocus&&setTimeout((()=>{Q(n)}))},We=e=>{for(let t=0;t{const n=S();if(!n)return;const s=Y(n,e);if(s){We(s);for(const e in t)s.setAttribute(e,t[e])}},Ue=e=>{if(!e.input)return;const t=He(e.input);t&&Z(t,e,"input")},qe=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},je=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=c["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&ee(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},He=e=>{const t=S();if(t)return ne(t,c[e]||c.input)},$e=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:A(t)||p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Ke={};Ke.text=Ke.email=Ke.password=Ke.number=Ke.tel=Ke.url=Ke.search=Ke.date=Ke["datetime-local"]=Ke.time=Ke.week=Ke.month=(e,t)=>($e(e,t.inputValue),je(e,e,t),qe(e,t),e.type=t.input,e),Ke.file=(e,t)=>(je(e,e,t),qe(e,t),e),Ke.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return $e(n,t.inputValue),n.type=t.input,$e(s,t.inputValue),je(n,e,t),e},Ke.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");$(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return je(e,e,t),e},Ke.radio=e=>(e.textContent="",e),Ke.checkbox=(e,t)=>{const n=Y(S(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return $(s,t.inputPlaceholder||t.inputLabel),n},Ke.textarea=(e,t)=>{$e(e,t.inputValue),qe(e,t),je(e,e,t);const n=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout((()=>{if("MutationObserver"in window){const s=parseInt(window.getComputedStyle(S()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const r=e.offsetWidth+n(e);r>s?S().style.width=`${r}px`:se(S(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Xe=(e,t)=>{const n=T();n&&(ae(n),Z(n,t,"htmlContainer"),t.html?(ke(t.html,n),re(n,"block")):t.text?(n.textContent=t.text,re(n,"block")):ie(n),Pe(e,t))},Ze=(e,t)=>{const n=P();n&&(ae(n),le(n,t.footer,"block"),t.footer&&ke(t.footer,n),Z(n,t,"footer"))},Ye=(e,t)=>{const n=ze.innerParams.get(e),s=_();if(s){if(n&&t.icon===n.icon)return nt(s,t),void Qe(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(h).indexOf(t.icon))return f(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void ie(s);re(s),nt(s,t),Qe(s,t),ee(s,t.showClass&&t.showClass.icon)}else ie(s)}},Qe=(e,t)=>{for(const[n,s]of Object.entries(h))t.icon!==n&&te(e,s);ee(e,t.icon&&h[t.icon]),st(e,t),Je(),Z(e,t,"icon")},Je=()=>{const e=S();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e\n \n
    \n
    \n',tt='\n \n \n \n \n',nt=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";t.iconHtml?s=rt(t.iconHtml):"success"===t.icon?(s=et,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=tt:t.icon&&(s=rt({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&$(e,s)},st=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"background-color",t.iconColor);oe(e,".swal2-success-ring","border-color",t.iconColor)}},rt=e=>`
    ${e}
    `,it=(e,t)=>{const n=N();n&&(t.imageUrl?(re(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),se(n,"width",t.imageWidth),se(n,"height",t.imageHeight),n.className=c.image,Z(n,t,"image")):ie(n))},at=(e,t)=>{const n=x(),s=S();if(n&&s){if(t.toast){se(n,"width",t.width),s.style.width="100%";const e=z();e&&s.insertBefore(e,_())}else se(s,"width",t.width);se(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),ie(R()),ot(s,t)}},ot=(e,t)=>{const n=t.showClass||{};e.className=`${c.popup} ${ue(e)?n.popup:""}`,t.toast?(ee([document.documentElement,document.body],c["toast-shown"]),ee(e,c.toast)):ee(e,c.modal),Z(e,t,"popup"),"string"==typeof t.customClass&&ee(e,t.customClass),t.icon&&ee(e,c[`icon-${t.icon}`])},lt=(e,t)=>{const n=O();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(re(n),n.textContent="",r>=s.length&&p("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach(((e,i)=>{const a=ut(e);if(n.appendChild(a),i===r&&ee(a,c["active-progress-step"]),i!==s.length-1){const e=ct(t);n.appendChild(e)}}))):ie(n)},ut=e=>{const t=document.createElement("li");return ee(t,c["progress-step"]),$(t,e),t},ct=e=>{const t=document.createElement("li");return ee(t,c["progress-step-line"]),e.progressStepsDistance&&se(t,"width",e.progressStepsDistance),t},ht=(e,t)=>{const n=I();n&&(ae(n),le(n,t.title||t.titleText,"block"),t.title&&ke(t.title,n),t.titleText&&(n.innerText=t.titleText),Z(n,t,"title"))},dt=(e,t)=>{at(e,t),De(e,t),lt(e,t),Ye(e,t),it(e,t),ht(e,t),Re(e,t),Xe(e,t),Ie(e,t),Ze(e,t);const n=S();"function"==typeof t.didRender&&n&&t.didRender(n),a.eventEmitter.emit("didRender",n)},pt=()=>ue(S()),ft=()=>{var e;return null===(e=D())||void 0===e?void 0:e.click()},mt=()=>{var e;return null===(e=F())||void 0===e?void 0:e.click()},gt=()=>{var e;return null===(e=M())||void 0===e?void 0:e.click()},yt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),bt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},wt=(e,t,n)=>{bt(e),t.toast||(e.keydownHandler=e=>Ct(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:S(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},vt=(e,t)=>{var n;const s=U();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=S())||void 0===n||n.focus()},At=["ArrowRight","ArrowDown"],xt=["ArrowLeft","ArrowUp"],Ct=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?kt(t,e):"Tab"===t.key?St(t):[...At,...xt].includes(t.key)?_t(t.key):"Escape"===t.key&&Et(t,e,n)))},kt=(e,t)=>{if(!b(t.allowEnterKey))return;const n=Y(S(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;ft(),e.preventDefault()}},St=e=>{const t=e.target,n=U();let s=-1;for(let e=0;e{const t=L(),n=D(),s=F(),r=M();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=At.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{b(t.allowEscapeKey)&&(e.preventDefault(),n(yt.esc))};var It={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Tt=()=>{const e=x();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))},Nt=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Ot="undefined"!=typeof window&&!!window.GestureEvent,Rt=()=>{if(Ot&&!K(document.body,c.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",ee(document.body,c.iosfix),Dt()}},Dt=()=>{const e=x();if(!e)return;let t;e.ontouchstart=e=>{t=Mt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Mt=e=>{const t=e.target,n=x(),s=T();return!(!n||!s||Ft(e)||Bt(e)||t!==n&&(he(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||he(s)&&s.contains(t)))},Ft=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Bt=e=>e.touches&&e.touches.length>1,zt=()=>{if(K(document.body,c.iosfix)){const e=parseInt(document.body.style.top,10);te(document.body,c.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},Lt=()=>{const e=document.createElement("div");e.className=c["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Pt=null;const Vt=e=>{null===Pt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Pt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Pt+Lt()}px`)},Wt=()=>{null!==Pt&&(document.body.style.paddingRight=`${Pt}px`,Pt=null)};function Gt(e,t,n,s){j()?Yt(e,s):(l(n).then((()=>Yt(e,s))),bt(a)),Ot?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),q()&&(Wt(),zt(),Nt()),Ut()}function Ut(){te([document.documentElement,document.body],[c.shown,c["height-auto"],c["no-backdrop"],c["toast-shown"]])}function qt(e){e=Kt(e);const t=It.swalPromiseResolve.get(this),n=jt(this);this.isAwaitingPromise?e.isDismissed||($t(this),t(e)):n&&t(e)}const jt=e=>{const t=S();if(!t)return!1;const n=ze.innerParams.get(e);if(!n||K(t,n.hideClass.popup))return!1;te(t,n.showClass.popup),ee(t,n.hideClass.popup);const s=x();return te(s,n.showClass.backdrop),ee(s,n.hideClass.backdrop),Xt(e,t,n),!0};function Ht(e){const t=It.swalPromiseReject.get(this);$t(this),t&&t(e)}const $t=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,ze.innerParams.get(e)||e._destroy())},Kt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Xt=(e,t,n)=>{const s=x(),r=Ee&&de(t);"function"==typeof n.willClose&&n.willClose(t),a.eventEmitter.emit("willClose",t),r?Zt(e,t,s,n.returnFocus,n.didClose):Gt(e,s,n.returnFocus,n.didClose)},Zt=(e,t,n,s,r)=>{Ee&&(a.swalCloseEventFinishedCallback=Gt.bind(null,e,n,s,r),t.addEventListener(Ee,(function(e){e.target===t&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback)})))},Yt=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),a.eventEmitter.emit("didClose"),e._destroy&&e._destroy()}))},Qt=e=>{let t=S();if(t||new nr,t=S(),!t)return;const n=z();j()?ie(_()):Jt(t,e),re(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},Jt=(e,t)=>{const n=L(),s=z();n&&s&&(!t&&ue(D())&&(t=D()),re(n),t&&(ie(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),ee([e,n],c.loading))},en=(e,t)=>{"select"===t.input||"radio"===t.input?an(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(w(t.inputValue)||A(t.inputValue))&&(Qt(D()),on(e,t))},tn=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return nn(n);case"radio":return sn(n);case"file":return rn(n);default:return t.inputAutoTrim?n.value.trim():n.value}},nn=e=>e.checked?1:0,sn=e=>e.checked?e.value:null,rn=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,an=(e,t)=>{const n=S();if(!n)return;const s=e=>{"select"===t.input?ln(n,cn(e),t):"radio"===t.input&&un(n,cn(e),t)};w(t.inputOptions)||A(t.inputOptions)?(Qt(D()),v(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):f("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},on=(e,t)=>{const n=e.getInput();n&&(ie(n),v(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,re(n),n.focus(),e.hideLoading()})).catch((t=>{f(`Error in inputValue promise: ${t}`),n.value="",re(n),n.focus(),e.hideLoading()})))};function ln(e,t,n){const s=ne(e,c.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,$(r,t),r.selected=hn(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}function un(e,t,n){const s=ne(e,c.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=c.radio,i.value=t,hn(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");$(o,r),o.className=c.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}const cn=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=cn(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=cn(s)),t.push([n,s])})),t},hn=(e,t)=>!!t&&t.toString()===e.toString(),dn=e=>{const t=ze.innerParams.get(e);e.disableButtons(),t.input?mn(e,"confirm"):vn(e,!0)},pn=e=>{const t=ze.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?mn(e,"deny"):yn(e,!1)},fn=(e,t)=>{e.disableButtons(),t(yt.cancel)},mn=(e,t)=>{const n=ze.innerParams.get(e);if(!n.input)return void f(`The "input" parameter is needed to be set when using returnInputValueOn${d(t)}`);const s=e.getInput(),r=tn(e,n);n.inputValidator?gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?yn(e,r):vn(e,r)},gn=(e,t,n)=>{const s=ze.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>v(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?yn(e,t):vn(e,t)}))},yn=(e,t)=>{const n=ze.innerParams.get(e||void 0);n.showLoaderOnDeny&&Qt(F()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),$t(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>wn(e||void 0,t)))):e.close({isDenied:!0,value:t})},bn=(e,t)=>{e.close({isConfirmed:!0,value:t})},wn=(e,t)=>{e.rejectPromise(t)},vn=(e,t)=>{const n=ze.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Qt(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preConfirm(t,n.validationMessage)))).then((n=>{ue(R())||!1===n?(e.hideLoading(),$t(e)):bn(e,void 0===n?t:n)})).catch((t=>wn(e||void 0,t)))):bn(e,t)};function An(){const e=ze.innerParams.get(this);if(!e)return;const t=ze.domCache.get(this);ie(t.loader),j()?e.icon&&re(_()):xn(t),te([t.popup,t.actions],c.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const xn=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?re(t[0],"inline-block"):ce()&&ie(e.actions)};function Cn(){const e=ze.innerParams.get(this),t=ze.domCache.get(this);return t?Y(t.popup,e.input):null}function kn(e,t,n){const s=ze.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function Sn(e,t){const n=S();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${c.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(Rn,e),zn=e=>-1!==Dn.indexOf(e),Ln=e=>Mn[e],Pn=e=>{Bn(e)||p(`Unknown parameter "${e}"`)},Vn=e=>{Fn.includes(e)&&p(`The parameter "${e}" is incompatible with toasts`)},Wn=e=>{const t=Ln(e);t&&y(e,t)},Gn=e=>{!1===e.backdrop&&e.allowOutsideClick&&p('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Pn(t),e.toast&&Vn(t),Wn(t)};function Un(e){const t=S(),n=ze.innerParams.get(this);if(!t||K(t,n.hideClass.popup))return void p("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=qn(e),r=Object.assign({},n,s);dt(this,r),ze.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const qn=e=>{const t={};return Object.keys(e).forEach((n=>{zn(n)?t[n]=e[n]:p(`Invalid parameter to update: ${n}`)})),t};function jn(){const e=ze.domCache.get(this),t=ze.innerParams.get(this);t?(e.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),a.eventEmitter.emit("didDestroy"),Hn(this)):$n(this)}const Hn=e=>{$n(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},$n=e=>{e.isAwaitingPromise?(Kn(ze,e),e.isAwaitingPromise=!0):(Kn(It,e),Kn(ze,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Kn=(e,t)=>{for(const n in e)e[n].delete(t)};var Xn=Object.freeze({__proto__:null,_destroy:jn,close:qt,closeModal:qt,closePopup:qt,closeToast:qt,disableButtons:En,disableInput:Tn,disableLoading:An,enableButtons:_n,enableInput:In,getInput:Cn,handleAwaitingPromise:$t,hideLoading:An,rejectPromise:Ht,resetValidationMessage:On,showValidationMessage:Nn,update:Un});const Zn=(e,t,n)=>{e.toast?Yn(e,t,n):(es(t),ts(t),ns(e,t,n))},Yn=(e,t,n)=>{t.popup.onclick=()=>{e&&(Qn(e)||e.timer||e.input)||n(yt.close)}},Qn=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Jn=!1;const es=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Jn=!0)}}},ts=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Jn=!0)}}},ns=(e,t,n)=>{t.container.onclick=s=>{Jn?Jn=!1:s.target===t.container&&b(e.allowOutsideClick)&&n(yt.backdrop)}},ss=e=>"object"==typeof e&&e.jquery,rs=e=>e instanceof Element||ss(e),is=e=>{const t={};return"object"!=typeof e[0]||rs(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];"string"==typeof r||rs(r)?t[n]=r:void 0!==r&&f(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof r}`)})):Object.assign(t,e[0]),t};function as(){for(var e=arguments.length,t=new Array(e),n=0;na.timeout&&a.timeout.getTimerLeft(),us=()=>{if(a.timeout)return fe(),a.timeout.stop()},cs=()=>{if(a.timeout){const e=a.timeout.start();return pe(e),e}},hs=()=>{const e=a.timeout;return e&&(e.running?us():cs())},ds=e=>{if(a.timeout){const t=a.timeout.increase(e);return pe(t,!0),t}},ps=()=>!(!a.timeout||!a.timeout.isRunning());let fs=!1;const ms={};function gs(){ms[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,fs||(document.body.addEventListener("click",ys),fs=!0)}const ys=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in ms){const n=t.getAttribute(e);if(n)return void ms[e].fire({template:n})}};class bs{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}}a.eventEmitter=new bs;const ws=(e,t)=>{a.eventEmitter.on(e,t)},vs=(e,t)=>{a.eventEmitter.once(e,t)},As=(e,t)=>{e?t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e):a.eventEmitter.reset()};var xs=Object.freeze({__proto__:null,argsToParams:is,bindClickHandler:gs,clickCancel:gt,clickConfirm:ft,clickDeny:mt,enableLoading:Qt,fire:as,getActions:L,getCancelButton:M,getCloseButton:W,getConfirmButton:D,getContainer:x,getDenyButton:F,getFocusableElements:U,getFooter:P,getHtmlContainer:T,getIcon:_,getIconContent:E,getImage:N,getInputLabel:B,getLoader:z,getPopup:S,getProgressSteps:O,getTimerLeft:ls,getTimerProgressBar:V,getTitle:I,getValidationMessage:R,increaseTimer:ds,isDeprecatedParameter:Ln,isLoading:H,isTimerRunning:ps,isUpdatableParameter:zn,isValidParameter:Bn,isVisible:pt,mixin:os,off:As,on:ws,once:vs,resumeTimer:cs,showLoading:Qt,stopTimer:us,toggleTimer:hs});class Cs{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const ks=["swal-title","swal-html","swal-footer"],Ss=e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Ds(n),Object.assign(_s(n),Es(n),Is(n),Ts(n),Ns(n),Os(n),Rs(n,ks))},_s=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{Ms(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&("boolean"==typeof Rn[n]?t[n]="false"!==s:"object"==typeof Rn[n]?t[n]=JSON.parse(s):t[n]=s)})),t},Es=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},Is=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{Ms(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${d(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},Ts=e=>{const t={},n=e.querySelector("swal-image");return n&&(Ms(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},Ns=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Ms(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Os=e=>{const t={},n=e.querySelector("swal-input");n&&(Ms(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{Ms(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},Rs=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(Ms(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},Ds=e=>{const t=ks.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||p(`Unrecognized element <${n}>`)}))},Ms=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])}))},Fs=10,Bs=e=>{const t=x(),n=S();"function"==typeof e.willOpen&&e.willOpen(n),a.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;Vs(t,n,e),setTimeout((()=>{Ls(t,n)}),Fs),q()&&(Ps(t,e.scrollbarPadding,s),Tt()),j()||a.previousActiveElement||(a.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),a.eventEmitter.emit("didOpen",n),te(t,c["no-transition"])},zs=e=>{const t=S();if(e.target!==t||!Ee)return;const n=x();t.removeEventListener(Ee,zs),n.style.overflowY="auto"},Ls=(e,t)=>{Ee&&de(t)?(e.style.overflowY="hidden",t.addEventListener(Ee,zs)):e.style.overflowY="auto"},Ps=(e,t,n)=>{Rt(),t&&"hidden"!==n&&Vt(n),setTimeout((()=>{e.scrollTop=0}))},Vs=(e,t,n)=>{ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),re(t,"grid"),setTimeout((()=>{ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),Fs)):re(t,"grid"),ee([document.documentElement,document.body],c.shown),n.heightAuto&&n.backdrop&&!n.toast&&ee([document.documentElement,document.body],c["height-auto"])};var Ws={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function Gs(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Ws.email),"url"===e.input&&(e.inputValidator=Ws.url))}function Us(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(p('Target parameter is not valid, defaulting to "body"'),e.target="body")}function qs(e){Gs(e),e.showLoaderOnConfirm&&!e.preConfirm&&p("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),Us(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
    ")),Ce(e)}let js;var Hs=new WeakMap;class $s{constructor(){if(s(this,Hs,void 0),"undefined"==typeof window)return;js=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(Gn(Object.assign({},t,e)),a.currentInstance){const e=It.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),q()&&Nt()}a.currentInstance=js;const n=Xs(e,t);qs(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);const s=Zs(js);return dt(js,n),ze.innerParams.set(js,n),Ks(js,s,n)}then(e){return n(Hs,this).then(e)}finally(e){return n(Hs,this).finally(e)}}const Ks=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};It.swalPromiseResolve.set(e,s),It.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{dn(e)},t.denyButton.onclick=()=>{pn(e)},t.cancelButton.onclick=()=>{fn(e,i)},t.closeButton.onclick=()=>{i(yt.close)},Zn(n,t,i),wt(a,n,i),en(e,n),Bs(n),Ys(a,n,i),Qs(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Xs=(e,t)=>{const n=Ss(e),s=Object.assign({},Rn,t,n,e);return s.showClass=Object.assign({},Rn.showClass,s.showClass),s.hideClass=Object.assign({},Rn.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Zs=e=>{const t={popup:S(),container:x(),actions:L(),confirmButton:D(),denyButton:F(),cancelButton:M(),loader:z(),closeButton:W(),validationMessage:R(),progressSteps:O()};return ze.domCache.set(e,t),t},Ys=(e,t,n)=>{const s=V();ie(s),t.timer&&(e.timeout=new Cs((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(re(s),Z(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&pe(t.timer)}))))},Qs=(e,t)=>{if(!t.toast)return b(t.allowEnterKey)?void(Js(e)||er(e,t)||vt(-1,1)):(y("allowEnterKey"),void tr())},Js=e=>{const t=e.popup.querySelectorAll("[autofocus]");for(const e of t)if(e instanceof HTMLElement&&ue(e))return e.focus(),!0;return!1},er=(e,t)=>t.focusDeny&&ue(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ue(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ue(e.confirmButton)||(e.confirmButton.focus(),0)),tr=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}$s.prototype.disableButtons=En,$s.prototype.enableButtons=_n,$s.prototype.getInput=Cn,$s.prototype.disableInput=Tn,$s.prototype.enableInput=In,$s.prototype.hideLoading=An,$s.prototype.disableLoading=An,$s.prototype.showValidationMessage=Nn,$s.prototype.resetValidationMessage=On,$s.prototype.close=qt,$s.prototype.closePopup=qt,$s.prototype.closeModal=qt,$s.prototype.closeToast=qt,$s.prototype.rejectPromise=Ht,$s.prototype.update=Un,$s.prototype._destroy=jn,Object.assign($s,xs),Object.keys(Xn).forEach((e=>{$s[e]=function(){return js&&js[e]?js[e](...arguments):null}})),$s.DismissReason=yt,$s.version="11.14.0";const nr=$s;return nr.default=nr,nr}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2)},9171:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AMOscillator:()=>fa,AMSynth:()=>Ha,Abs:()=>Na,Add:()=>Aa,AmplitudeEnvelope:()=>Ua,Analyser:()=>ml,AudioToGain:()=>da,AutoFilter:()=>Ro,AutoPanner:()=>Mo,AutoWah:()=>Bo,BaseContext:()=>Kr,BiquadFilter:()=>$a,BitCrusher:()=>Lo,Buffer:()=>Xl,BufferSource:()=>Yl,Buffers:()=>Zl,Channel:()=>Cl,Chebyshev:()=>Vo,Chorus:()=>jo,Clock:()=>zi,Compressor:()=>Tl,Context:()=>Xr,Convolver:()=>Fl,CrossFade:()=>To,DCMeter:()=>wl,Delay:()=>Li,Destination:()=>Vl,Distortion:()=>Ho,Draw:()=>jl,DuoSynth:()=>Ya,EQ3:()=>Ml,Emitter:()=>$r,Envelope:()=>Pa,FFT:()=>bl,FMOscillator:()=>ma,FMSynth:()=>Qa,FatOscillator:()=>ya,FeedbackCombFilter:()=>lo,FeedbackDelay:()=>Ko,Filter:()=>Ka,Follower:()=>Fo,Freeverb:()=>Jo,Frequency:()=>wi,FrequencyClass:()=>gi,FrequencyEnvelope:()=>Xa,FrequencyShifter:()=>Zo,Gain:()=>Ti,GainToAudio:()=>Oa,Gate:()=>Nl,GrainPlayer:()=>Ta,GreaterThan:()=>Fa,GreaterThanZero:()=>Ma,IntervalTimeline:()=>Hi,JCReverb:()=>sl,LFO:()=>ka,Limiter:()=>Ol,Listener:()=>Ul,Loop:()=>go,LowpassCombFilter:()=>co,Master:()=>Wl,MembraneSynth:()=>to,Merge:()=>Go,MetalSynth:()=>eo,Meter:()=>yl,MidSideCompressor:()=>Rl,MidSideMerge:()=>cl,MidSideSplit:()=>ul,Midi:()=>Gi,MidiClass:()=>Wi,Mono:()=>kl,MonoSynth:()=>Za,MultibandCompressor:()=>Dl,MultibandSplit:()=>Sl,Multiply:()=>pa,Negate:()=>Ra,Noise:()=>na,NoiseSynth:()=>no,Offline:()=>Pi,OfflineContext:()=>ei,OmniOscillator:()=>va,OnePoleFilter:()=>uo,Oscillator:()=>ua,PWMOscillator:()=>ba,PanVol:()=>xl,Panner:()=>Do,Panner3D:()=>El,Param:()=>ki,Part:()=>yo,Pattern:()=>Eo,Phaser:()=>ol,PingPongDelay:()=>il,PitchShift:()=>al,Player:()=>Ea,Players:()=>Ia,PluckSynth:()=>ho,PolySynth:()=>po,Pow:()=>Ba,PulseOscillator:()=>ga,Recorder:()=>Il,Reverb:()=>ll,Sampler:()=>fo,Scale:()=>xa,ScaleExp:()=>za,Sequence:()=>Io,Signal:()=>Ri,Solo:()=>Al,Split:()=>Wo,StateTimeline:()=>Ci,StereoWidener:()=>dl,Subtract:()=>Da,SyncedSignal:()=>La,Synth:()=>qa,Ticks:()=>qi,TicksClass:()=>Ui,Time:()=>mi,TimeClass:()=>fi,Timeline:()=>Gr,ToneAudioBuffer:()=>Jr,ToneAudioBuffers:()=>Vi,ToneAudioNode:()=>Si,ToneBufferSource:()=>ta,ToneEvent:()=>mo,ToneOscillatorNode:()=>la,Transport:()=>Ll,TransportTime:()=>Ai,TransportTimeClass:()=>vi,Tremolo:()=>pl,Unit:()=>r,UserMedia:()=>aa,Vibrato:()=>fl,Volume:()=>Ki,WaveShaper:()=>ha,Waveform:()=>vl,Zero:()=>Ca,connect:()=>Ei,connectSeries:()=>_i,connectSignal:()=>Di,context:()=>$l,dbToGain:()=>ai,debug:()=>s,defaultArg:()=>Dr,disconnect:()=>Ii,ftom:()=>ci,gainToDb:()=>oi,getContext:()=>si,getDestination:()=>Gl,getDraw:()=>Hl,getListener:()=>ql,getTransport:()=>Pl,immediate:()=>zl,intervalToFrequencyRatio:()=>li,isArray:()=>yr,isBoolean:()=>gr,isDefined:()=>dr,isFunction:()=>pr,isNote:()=>wr,isNumber:()=>fr,isObject:()=>mr,isString:()=>br,isUndef:()=>hr,loaded:()=>Kl,mtof:()=>di,now:()=>Bl,optionsFromArguments:()=>Rr,setContext:()=>ri,start:()=>ii,supported:()=>sr,version:()=>i});var s={};n.r(s),n.d(s,{assert:()=>rr,assertContextRunning:()=>ar,assertRange:()=>ir,log:()=>ur,setLogger:()=>lr,warn:()=>cr});var r={};n.r(r);const i="14.7.77",a=(e,t,n)=>({endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}),o=(e,t,n)=>({endTime:t,insertTime:n,type:"linearRampToValue",value:e}),l=(e,t)=>({startTime:t,type:"setValue",value:e}),u=(e,t,n)=>({duration:n,startTime:t,type:"setValueCurve",values:e}),c=(e,t,{startTime:n,target:s,timeConstant:r})=>s+(t-s)*Math.exp((n-e)/r),h=e=>"exponentialRampToValue"===e.type,d=e=>"linearRampToValue"===e.type,p=e=>h(e)||d(e),f=e=>"setValue"===e.type,m=e=>"setValueCurve"===e.type,g=(e,t,n,s)=>{const r=e[t];return void 0===r?s:p(r)||f(r)?r.value:m(r)?r.values[r.values.length-1]:c(n,g(e,t-1,r.startTime,s),r)},y=(e,t,n,s,r)=>void 0===n?[s.insertTime,r]:p(n)?[n.endTime,n.value]:f(n)?[n.startTime,n.value]:m(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,g(e,t-1,n.startTime,r)],b=e=>"cancelAndHold"===e.type,w=e=>"cancelScheduledValues"===e.type,v=e=>b(e)||w(e)?e.cancelTime:h(e)||d(e)?e.endTime:e.startTime,A=(e,t,n,{endTime:s,value:r})=>n===r?r:0n+(e-t)/(s-t)*(r-n),C=(e,{duration:t,startTime:n,values:s})=>((e,t)=>{const n=Math.floor(t),s=Math.ceil(t);return n===s?e[n]:(1-(t-n))*e[n]+(1-(s-t))*e[s]})(s,(e-n)/t*(s.length-1)),k=e=>"setTarget"===e.type;class S{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=v(e);if(b(e)||w(e)){const n=this._automationEvents.findIndex((n=>w(e)&&m(n)?n.startTime+n.duration>=t:v(n)>=t)),s=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),b(e)){const e=this._automationEvents[this._automationEvents.length-1];if(void 0!==s&&p(s)){if(void 0!==e&&k(e))throw new Error("The internal list is malformed.");const n=void 0===e?s.insertTime:m(e)?e.startTime+e.duration:v(e),r=void 0===e?this._defaultValue:m(e)?e.values[e.values.length-1]:e.value,i=h(s)?A(t,n,r,s):x(t,n,r,s),l=h(s)?a(i,t,this._currenTime):o(i,t,this._currenTime);this._automationEvents.push(l)}if(void 0!==e&&k(e)&&this._automationEvents.push(l(this.getValue(t),t)),void 0!==e&&m(e)&&e.startTime+e.duration>t){const n=t-e.startTime,s=(e.values.length-1)/e.duration,r=Math.max(2,1+Math.ceil(n*s)),i=n/(r-1)*s,a=e.values.slice(0,r);if(i<1)for(let t=1;tv(e)>t)),s=-1===n?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[n-1];if(void 0!==s&&m(s)&&v(s)+s.duration>t)return!1;const r=h(e)?a(e.value,e.endTime,this._currenTime):d(e)?o(e.value,t,this._currenTime):e;if(-1===n)this._automationEvents.push(r);else{if(m(e)&&t+e.duration>v(this._automationEvents[n]))return!1;this._automationEvents.splice(n,0,r)}}return!0}flush(e){const t=this._automationEvents.findIndex((t=>v(t)>e));if(t>1){const e=this._automationEvents.slice(t-1),n=e[0];k(n)&&e.unshift(l(g(this._automationEvents,t-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=e}}getValue(e){if(0===this._automationEvents.length)return this._defaultValue;const t=this._automationEvents.findIndex((t=>v(t)>e)),n=this._automationEvents[t],s=(-1===t?this._automationEvents.length:t)-1,r=this._automationEvents[s];if(void 0!==r&&k(r)&&(void 0===n||!p(n)||n.insertTime>e))return c(e,g(this._automationEvents,s-1,r.startTime,this._defaultValue),r);if(void 0!==r&&f(r)&&(void 0===n||!p(n)))return r.value;if(void 0!==r&&m(r)&&(void 0===n||!p(n)||r.startTime+r.duration>e))return eB},z=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,L=(e,t)=>{const n=[];let s=e.replace(/^[\s]+/,""),r=s.match(z);for(;null!==r;){const e=r[1].slice(1,-1),i=r[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(i),s=s.slice(r[0].length).replace(/^[\s]+/,""),r=s.match(z)}return[n.join(";"),s]},P=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},V=e=>{if(!(e=>{try{new new Proxy(e,B)}catch{return!1}return!0})(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},W=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},G=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[s]=n;return e.delete(s),s},U=(e,t,n,s)=>{const r=W(e,t),i=G(r,(e=>e[0]===n&&e[1]===s));return 0===r.size&&e.delete(t),i},q=e=>W(R,e),j=e=>{if(_.has(e))throw new Error("The AudioNode is already stored.");_.add(e),q(e).forEach((e=>e(!0)))},H=e=>"port"in e,$=e=>{if(!_.has(e))throw new Error("The AudioNode is not stored.");_.delete(e),q(e).forEach((e=>e(!1)))},K=(e,t)=>{!H(e)&&t.every((e=>0===e.size))&&$(e)},X={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Z=(e,t)=>e.context===t,Y=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Q=()=>new DOMException("","IndexSizeError"),J=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Q();throw e}})},ee={numberOfChannels:1},te=-34028234663852886e22,ne=-te,se=e=>_.has(e),re={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},ie=e=>W(E,e),ae=e=>W(T,e),oe=(e,t)=>{const{activeInputs:n}=ie(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||oe(n,[...t,e])}))));const s=(e=>"playbackRate"in e)(e)?[e.playbackRate]:H(e)?Array.from(e.parameters.values()):(e=>"frequency"in e&&"gain"in e)(e)?[e.Q,e.detune,e.frequency,e.gain]:(e=>"offset"in e)(e)?[e.offset]:(e=>!("frequency"in e)&&"gain"in e)(e)?[e.gain]:(e=>"detune"in e&&"frequency"in e)(e)?[e.detune,e.frequency]:(e=>"pan"in e)(e)?[e.pan]:[];for(const e of s){const n=ae(e);void 0!==n&&n.activeInputs.forEach((([e])=>oe(e,t)))}se(e)&&$(e)},le=e=>{oe(e.destination,[])},ue=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ce=e=>"context"in e,he=e=>ce(e[0]),de=(e,t,n,s)=>{for(const t of e)if(n(t)){if(s)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},pe=(e,t,[n,s],r)=>{de(e,[t,n,s],(e=>e[0]===t&&e[1]===n),r)},fe=(e,[t,n,s],r)=>{const i=e.get(t);void 0===i?e.set(t,new Set([[n,s]])):de(i,[n,s],(e=>e[0]===n),r)},me=e=>"inputs"in e,ge=(e,t,n,s)=>{if(me(t)){const r=t.inputs[s];return e.connect(r,n,0),[r,n,0]}return e.connect(t,n,s),[t,n,s]},ye=(e,t,n)=>{for(const s of e)if(s[0]===t&&s[1]===n)return e.delete(s),s;return null},be=(e,t)=>{if(!q(e).delete(t))throw new Error("Missing the expected event listener.")},we=(e,t,n)=>{const s=W(e,t),r=G(s,(e=>e[0]===n));return 0===s.size&&e.delete(t),r},ve=(e,t,n,s)=>{me(t)?e.disconnect(t.inputs[s],n,0):e.disconnect(t,n,s)},Ae=e=>W(I,e),xe=e=>W(N,e),Ce=e=>D.has(e),ke=e=>!_.has(e),Se=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),s=e.createGain(),r=e.createBuffer(1,2,44100),i=r.getChannelData(0);i[0]=1,i[1]=1;const a=e.createBufferSource();a.buffer=r,a.loop=!0,a.connect(t).connect(e.destination),a.connect(s),a.disconnect(s),t.onaudioprocess=s=>{const r=s.inputBuffer.getChannelData(0);Array.prototype.some.call(r,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.start()}})),_e=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},Ee=e=>"context"in e,Ie=e=>{const t=new Map;e.connect=(e=>(n,s=0,r=0)=>{const i=Ee(n)?e(n,s,r):e(n,s),a=t.get(n);return void 0===a?t.set(n,[{input:r,output:s}]):a.every((e=>e.input!==r||e.output!==s))&&a.push({input:r,output:s}),i})(e.connect.bind(e)),e.disconnect=(n=>(s,r,i)=>{if(n.apply(e),void 0===s)t.clear();else if("number"==typeof s)for(const[e,n]of t){const r=n.filter((e=>e.output!==s));0===r.length?t.delete(e):t.set(e,r)}else if(t.has(s))if(void 0===r)t.delete(s);else{const e=t.get(s);if(void 0!==e){const n=e.filter((e=>e.output!==r&&(e.input!==i||void 0===i)));0===n.length?t.delete(s):t.set(s,n)}}for(const[n,s]of t)s.forEach((t=>{Ee(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})(e.disconnect)},Te=(e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ae(t),{outputs:a}=ie(e),o=q(e),l=a=>{const o=Ae(e),l=xe(t);if(a){const t=we(i,e,n);pe(r,e,t,!1),s||Ce(e)||o.connect(l,n)}else{const t=((e,t,n)=>G(e,(e=>e[0]===t&&e[1]===n)))(r,e,n);fe(i,t,!1),s||Ce(e)||o.disconnect(l,n)}};return!!de(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(o.add(l),se(e)?pe(r,e,[n,l],!0):fe(i,[e,n,l],!0),!0)},Ne=(e,t,n,s,r)=>{const[i,a]=((e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ie(t),a=ye(r[s],e,n);if(null===a)return[U(i,e,n,s)[2],!1];return[a[2],!0]})(e,n,s,r);if(null!==i&&(be(e,i),!a||t||Ce(e)||ve(Ae(e),Ae(n),s,r)),se(n)){const{activeInputs:e}=ie(n);K(n,e)}},Oe=(e,t,n,s)=>{const[r,i]=((e,t,n)=>{const{activeInputs:s,passiveInputs:r}=ae(t),i=ye(s,e,n);if(null===i)return[we(r,e,n)[1],!1];return[i[2],!0]})(e,n,s);null!==r&&(be(e,r),!i||t||Ce(e)||Ae(e).disconnect(xe(n),s))};class Re{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,s)=>e.call(t,n,s,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const De={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function Me(e,t,n,s,r){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],s,r);else{const i=e.getChannelData(s);if(0===t[n].byteLength)t[n]=i.slice(r,r+128);else{const e=new Float32Array(i.buffer,r*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const Fe=(e,t,n,s,r)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],s,r):0!==t[n].byteLength&&e.getChannelData(s).set(t[n],r)},Be=(e,t)=>{const n=[];for(let s=0;s{const o=null===t?128*Math.ceil(e.context.length/128):t.length,l=s.channelCount*s.numberOfInputs,u=r.reduce(((e,t)=>e+t),0),c=0===u?null:n.createBuffer(u,o,n.sampleRate);if(void 0===i)throw new Error("Missing the processor constructor.");const h=ie(e),d=await((e,t)=>{const n=W(F,e),s=Ae(t);return W(n,s)})(n,e),p=Be(s.numberOfInputs,s.channelCount),f=Be(s.numberOfOutputs,r),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let u=0;u0&&null!==t)for(let e=0;e{Me(t,m,e,l+n,u)}));for(let e=0;e0===h.activeInputs[t].size?[]:e)),t=a(u/n.sampleRate,n.sampleRate,(()=>d.process(e,f,m)));if(null!==c)for(let e=0,t=0;e{const{port1:t,port2:n}=new MessageChannel;return new Promise((s=>{const r=()=>{n.onmessage=null,t.close(),n.close(),s()};n.onmessage=()=>r();try{t.postMessage(e,[e])}catch{}finally{r()}}))},qe={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},je=(e,t,n)=>{const s=t[n];if(void 0===s)throw e();return s},He={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},$e={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ke=()=>new DOMException("","InvalidStateError"),Xe=()=>new DOMException("","InvalidAccessError"),Ze={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Ye=(e,t,n,s,r,i,a,o,l,u,c)=>{const h=u.length;let d=o;for(let o=0;o{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},et={numberOfChannels:1},tt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n]&&(e[n]=s)},nt=(e,t)=>{tt(e,t,"channelCount"),tt(e,t,"channelCountMode"),tt(e,t,"channelInterpretation")},st=e=>"function"==typeof e.getFloatTimeDomainData,rt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n].value&&(e[n].value=s)},it=e=>{e.start=(t=>(n=0,s=0,r)=>{if("number"==typeof r&&r<0||s<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,s,r)})(e.start)},at=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},ot=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),lt=async(e,t)=>{const n=await(e=>new Promise(((t,n)=>{const{port1:s,port2:r}=new MessageChannel;s.onmessage=({data:e})=>{s.close(),r.close(),t(e)},s.onmessageerror=({data:e})=>{s.close(),r.close(),n(e)},r.postMessage(e)})))(t);return new e(n)},ut=(e,t)=>{const n=e.createBiquadFilter();return nt(n,t),rt(n,t,"Q"),rt(n,t,"detune"),rt(n,t,"frequency"),rt(n,t,"gain"),tt(n,t,"type"),n},ct=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return nt(n,t),(e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Ke()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw Ke()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw Ke()}})})(n),n},ht=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),dt=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return nt(n,t),rt(n,t,"delayTime"),n},pt=(e,t)=>{const n=e.createGain();return nt(n,t),rt(n,t,"gain"),n};function ft(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function mt(e,t){let n=[0,0];for(let i=e.length-1;i>=0;i-=1)r=t,n=[(s=n)[0]*r[0]-s[1]*r[1],s[0]*r[1]+s[1]*r[0]],n[0]+=e[i];var s,r;return n}const gt=(e,t,n,s)=>e.createScriptProcessor(t,n,s),yt=()=>new DOMException("","NotSupportedError"),bt={numberOfChannels:1},wt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},vt={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},At={disableNormalization:!1},xt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Ct=()=>new DOMException("","UnknownError"),kt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},St=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),_t=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},Et=(e,t,n,s)=>{let r=e;for(;!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);const{get:i,set:a}=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,{get:n(i),set:s(a)})},It=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(s){if(9!==s.code)throw s;It(e,t,n+1e-7)}},Tt=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Nt=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Ot=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},Rt=()=>{try{new DOMException}catch{return!1}return!0},Dt=()=>new Promise((e=>{const t=new ArrayBuffer(0),{port1:n,port2:s}=new MessageChannel;n.onmessage=({data:t})=>e(null!==t),s.postMessage(t,[t])})),Mt=(e,t)=>{const n=t.createGain();e.connect(n);const s=(t=>()=>{t.call(e,n),e.removeEventListener("ended",s)})(e.disconnect);e.addEventListener("ended",s),ht(e,n),e.stop=(t=>{let s=!1;return(r=0)=>{if(s)try{t.call(e,r)}catch{n.gain.setValueAtTime(0,r)}else t.call(e,r),s=!0}})(e.stop)},Ft=(e,t)=>n=>{const s={value:e};return Object.defineProperties(n,{currentTarget:s,target:s}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Bt=(e=>(t,n,[s,r,i],a)=>{e(t[r],[n,s,i],(e=>e[0]===n&&e[1]===s),a)})(de),zt=(e=>(t,n,[s,r,i],a)=>{const o=t.get(s);void 0===o?t.set(s,new Set([[r,n,i]])):e(o,[r,n,i],(e=>e[0]===r&&e[1]===n),a)})(de),Lt=(e=>(t,n,s,r)=>e(t[r],(e=>e[0]===n&&e[1]===s)))(G),Pt=new WeakMap,Vt=(e=>t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:0})(Pt),Wt=(Gt=new Map,Ut=new WeakMap,(e,t)=>{const n=Ut.get(e);if(void 0!==n)return n;const s=Gt.get(e);if(void 0!==s)return s;try{const n=t();return n instanceof Promise?(Gt.set(e,n),n.catch((()=>!1)).then((t=>(Gt.delete(e),Ut.set(e,t),t)))):(Ut.set(e,n),n)}catch{return Ut.set(e,!1),!1}});var Gt,Ut;const qt="undefined"==typeof window?null:window,jt=((e,t)=>(n,s)=>{const r=n.createAnalyser();if(nt(r,s),!(s.maxDecibels>s.minDecibels))throw t();return tt(r,s,"fftSize"),tt(r,s,"maxDecibels"),tt(r,s,"minDecibels"),tt(r,s,"smoothingTimeConstant"),e(st,(()=>st(r)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const s=Math.max(n.length,e.fftSize);for(let e=0;et=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer})(ie),$t=((e,t,n)=>async(s,r,i)=>{const a=e(s);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,o])=>{const l=t(e),u=await l.render(e,r),c=s.context.destination;n(e)||s===c&&n(s)||u.connect(i,o,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(ie,Ht,Ce),Kt=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(jt,Ae,$t),Xt=(Zt=O,e=>{const t=Zt.get(e);if(void 0===t)throw Ke();return t});var Zt;const Yt=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(qt),Qt=(e=>t=>null!==e&&t instanceof e)(Yt),Jt=new WeakMap,en=(e=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(t,n,s){if(null!==n){let r=this._listeners.get(n);void 0===r&&(r=e(this,n),"function"==typeof n&&this._listeners.set(n,r)),this._nativeEventTarget.addEventListener(t,r,s)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const s=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===s?null:s,n)}})(Ft),tn=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(qt),nn=(e=>t=>null!==e&&t instanceof e)(tn),sn=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(qt),rn=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(qt),an=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(qt),on=((e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m)=>class extends u{constructor(t,s,r,i){super(r),this._context=t,this._nativeAudioNode=r;const a=c(t);h(a)&&!0!==n(Se,(()=>Se(a,m)))&&Ie(r),I.set(this,r),R.set(this,new Set),"closed"!==t.state&&s&&j(this),e(this,i,r)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,o=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw r();const u=c(this._context),h=f(u);if(d(e)||p(e))throw i();if(ce(e)){const r=Ae(e);try{const t=ge(this._nativeAudioNode,r,n,o),s=ke(this);(h||s)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!s&&ke(e)&&j(e)}catch(e){if(12===e.code)throw i();throw e}if(t(this,e,n,o,h)){const t=l([this],e);_e(t,s(h))}return e}const m=xe(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(h||ke(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw i();throw e}if(Te(this,e,n,h)){const t=l([this],e);_e(t,s(h))}}disconnect(e,t,n){let s;const a=c(this._context),u=f(a);if(void 0===e)s=((e,t)=>{const n=ie(e),s=[];for(const r of n.outputs)he(r)?Ne(e,t,...r):Oe(e,t,...r),s.push(r[0]);return n.outputs.clear(),s})(this,u);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw r();s=((e,t,n)=>{const s=ie(e),r=[];for(const i of s.outputs)i[1]===n&&(he(i)?Ne(e,t,...i):Oe(e,t,...i),r.push(i[0]),s.outputs.delete(i));return r})(this,u,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw r();if(ce(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw r();if(s=((e,t,n,s,r)=>{const i=ie(e);return Array.from(i.outputs).filter((e=>!(e[0]!==n||void 0!==s&&e[1]!==s||void 0!==r&&e[2]!==r))).map((n=>(he(n)?Ne(e,t,...n):Oe(e,t,...n),i.outputs.delete(n),n[0])))})(this,u,e,t,n),0===s.length)throw i()}for(const e of s){const t=l([this],e);_e(t,o)}}})((ln=E,(e,t,n)=>{const s=[];for(let e=0;e{const p=new WeakMap;return(f,m,g,y,b)=>{const{activeInputs:w,passiveInputs:v}=i(m),{outputs:A}=i(f),x=o(f),C=i=>{const o=l(m),u=l(f);if(i){const t=U(v,f,g,y);e(w,f,t,!1),b||h(f)||n(u,o,g,y),d(m)&&j(m)}else{const e=s(w,f,g,y);t(v,y,e,!1),b||h(f)||r(u,o,g,y);const n=a(m);if(0===n)c(m)&&K(m,w);else{const e=p.get(m);void 0!==e&&clearTimeout(e),p.set(m,setTimeout((()=>{c(m)&&K(m,w)}),1e3*n))}}};return!!u(A,[m,g,y],(e=>e[0]===m&&e[1]===g&&e[2]===y),!0)&&(x.add(C),c(f)?e(w,f,[g,y,C],!0):t(v,y,[f,g,C],!0),!0)}})(Bt,zt,ge,Lt,ve,ie,Vt,q,Ae,de,se,Ce,ke),Wt,((e,t,n,s,r,i)=>a=>(o,l)=>{const u=e.get(o);if(void 0===u){if(!a&&i(o)){const e=s(o),{outputs:i}=n(o);for(const n of i)if(he(n)){const r=s(n[0]);t(e,r,n[1],n[2])}else{const t=r(n[0]);e.disconnect(t,n[1])}}e.set(o,l)}else e.set(o,u+l)})(D,ve,ie,Ae,xe,se),Q,Xe,yt,((e,t,n,s,r,i,a,o)=>(l,u)=>{const c=t.get(l);if(void 0===c)throw new Error("Missing the expected cycle count.");const h=i(l.context),d=o(h);if(c===u){if(t.delete(l),!d&&a(l)){const t=s(l),{outputs:i}=n(l);for(const n of i)if(he(n)){const r=s(n[0]);e(t,r,n[1],n[2])}else{const e=r(n[0]);t.connect(e,n[1])}}}else t.set(l,c-u)})(ge,D,ie,Ae,xe,Xt,se,Qt),((e,t,n)=>function s(r,i){const a=ce(i)?i:n(e,i);if((e=>"delayTime"in e)(a))return[];if(r[0]===a)return[r];if(r.includes(a))return[];const{outputs:o}=t(a);return Array.from(o).map((e=>s([...r,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Jt,ie,W),en,Xt,nn,sn,rn,Qt,an);var ln;const un=((e,t,n,s,r,i)=>class extends e{constructor(e,n){const a=r(e),o={...X,...n},l=s(a,o);super(e,!1,l,i(a)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(on,Kt,Q,jt,Xt,Qt),cn=new WeakSet,hn=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(qt),dn=(pn=new Uint32Array(1),e=>(pn[0]=e,pn[0]));var pn;const fn=((e,t)=>n=>{n.copyFromChannel=(s,r,i=0)=>{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=a<0?-a:0;e+a{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=a<0?-a:0;e+at=>{t.copyFromChannel=(n=>(s,r,i=0)=>{const a=e(i),o=e(r);if(a(s,r,i=0)=>{const a=e(i),o=e(r);if(a{let l=null;return class u{constructor(u){if(null===r)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:c,numberOfChannels:h,sampleRate:d}={...ee,...u};null===l&&(l=new r(1,1,44100));const p=null!==s&&t(i,i)?new s({length:c,numberOfChannels:h,sampleRate:d}):l.createBuffer(h,c,d);if(0===p.numberOfChannels)throw n();return"function"!=typeof p.copyFromChannel?(a(p),J(p)):t(Y,(()=>Y(p)))||o(p),e.add(p),p}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===u.prototype||e.has(t)}}})(cn,Wt,yt,hn,Yt,(e=>()=>{if(null===e)return!1;try{new e({length:1,sampleRate:44100})}catch{return!1}return!0})(hn),fn,mn),yn=(e=>(t,n)=>{const s=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(s).connect(t.destination);const r=()=>{n.removeEventListener("ended",r),n.disconnect(s),s.disconnect()};n.addEventListener("ended",r)})(pt),bn=((e,t,n)=>async(s,r,i)=>{const a=t(s);await Promise.all(Array.from(a.activeInputs).map((async([t,s])=>{const a=e(t),o=await a.render(t,r);n(t)||o.connect(i,s)})))})(Ht,ae,Ce),wn=(e=>(t,n,s)=>e(n,t,s))(bn),vn=((e,t,n,s,r,i,a,o,l,u,c)=>(h,d)=>{const p=h.createBufferSource();return nt(p,d),rt(p,d,"playbackRate"),tt(p,d,"buffer"),tt(p,d,"loop"),tt(p,d,"loopEnd"),tt(p,d,"loopStart"),t(n,(()=>n(h)))||(e=>{e.start=(t=>{let n=!1;return(s=0,r=0,i)=>{if(n)throw Ke();t.call(e,s,r,i),n=!0}})(e.start)})(p),t(s,(()=>s(h)))||l(p),t(r,(()=>r(h)))||u(p,h),t(i,(()=>i(h)))||it(p),t(a,(()=>a(h)))||c(p,h),t(o,(()=>o(h)))||at(p),e(h,p),p})(yn,Wt,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),Tt,Nt,Ot,(e=>{e.start=(t=>(n=0,s=0,r)=>{const i=e.buffer,a=null===i?s:Math.min(i.duration,s);null!==i&&a>i.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,r)})(e.start)}),(e=>(t,n)=>{const s=n.createBuffer(1,1,44100);null===t.buffer&&(t.buffer=s),e(t,"buffer",(e=>()=>{const n=e.call(t);return n===s?null:n}),(e=>n=>e.call(t,null===n?s:n)))})(Et),Mt),An=((e,t)=>(n,s,r)=>(e(s).replay(r),t(s,n,r)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(ae),bn),xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,u){const c=i.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={buffer:c.buffer,channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,loop:c.loop,loopEnd:c.loopEnd,loopStart:c.loopStart,playbackRate:c.playbackRate.value};c=t(u,e),null!==a&&c.start(...a),null!==o&&c.stop(o)}return i.set(u,c),h?await e(u,l.playbackRate,c.playbackRate):await s(u,l.playbackRate,c.playbackRate),await r(l,u,c),c})(l,u)}}})(wn,vn,Ae,An,$t),Cn=((e,t,n,s,r,i,a,o,l,u,c,h,d)=>(p,f,m,g=null,y=null)=>{const b=m.value,w=new S(b),v=f?s(w):null,A={get defaultValue(){return b},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===y?m.minValue:y},get value(){return m.value},set value(e){m.value=e,A.setValueAtTime(e,p.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===v&&w.flush(p.context.currentTime),w.add(r(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(w).pop();null===v&&w.flush(p.context.currentTime),w.add(r(e));const n=Array.from(w).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return A},cancelScheduledValues:e=>(null===v&&w.flush(p.context.currentTime),w.add(i(e)),m.cancelScheduledValues(e),A),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),A},linearRampToValueAtTime(e,t){const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(o(e,t)),m.linearRampToValueAtTime(e,t),A},setTargetAtTime:(e,t,n)=>(null===v&&w.flush(p.context.currentTime),w.add(l(e,t,n)),m.setTargetAtTime(e,t,n),A),setValueAtTime:(e,t)=>(null===v&&w.flush(p.context.currentTime),w.add(u(e,t)),m.setValueAtTime(e,t),A),setValueCurveAtTime(e,t,n){const s=e instanceof Float32Array?e:new Float32Array(e);if(null!==h&&"webkitAudioContext"===h.name){const e=t+n,r=p.context.sampleRate,i=Math.ceil(t*r),a=Math.floor(e*r),o=a-i,l=new Float32Array(o);for(let e=0;e{kn.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),Jt,N,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:s}=n;t.exponentialRampToValueAtTime(s,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:s}=n;t.linearRampToValueAtTime(s,e)}else if("setTarget"===n.type){const{startTime:e,target:s,timeConstant:r}=n;t.setTargetAtTime(s,e,r)}else if("setValue"===n.type){const{startTime:e,value:s}=n;t.setValueAtTime(s,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:s,values:r}=n;t.setValueCurveAtTime(r,s,e)}}}})),(e=>({cancelTime:e,type:"cancelAndHold"})),(e=>({cancelTime:e,type:"cancelScheduledValues"})),((e,t)=>({endTime:t,type:"exponentialRampToValue",value:e})),((e,t)=>({endTime:t,type:"linearRampToValue",value:e})),((e,t,n)=>({startTime:t,target:e,timeConstant:n,type:"setTarget"})),l,u,tn,It);var kn;const Sn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const o=i(e),l={...re,...s},u=r(o,l),c=a(o),h=c?t():null;super(e,!1,u,h),this._audioBufferSourceNodeRenderer=h,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=u,this._onended=null,this._playbackRate=n(this,c,u.playbackRate,ne,te)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?o(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){j(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(on,xn,Cn,Ke,vn,Xt,Qt,Ft),_n=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,n){const s=i(e),l=a(s),u=r(s,n,l);super(e,!1,u,l?t(o):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=u}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(on,(e=>{const t=new WeakMap;return{render(n,s){const r=t.get(s);return void 0!==r?Promise.resolve(r):(async(n,s)=>{const r=s.destination;return t.set(s,r),await e(n,s,r),r})(n,s)}}}),Q,Ke,((e,t)=>(n,s,r)=>{const i=n.destination;if(i.channelCount!==s)try{i.channelCount=s}catch{}r&&"explicit"!==i.channelCountMode&&(i.channelCountMode="explicit"),0===i.maxChannelCount&&Object.defineProperty(i,"maxChannelCount",{value:s});const a=e(n,{channelCount:s,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{i.channelCount=t}catch(e){if(t>i.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>i.maxChannelCount}),a.connect(i),a})(pt,Et),Xt,Qt,$t),En=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(o,e)}return i.set(o,l),u?(await e(o,a.Q,l.Q),await e(o,a.detune,l.detune),await e(o,a.frequency,l.frequency),await e(o,a.gain,l.gain)):(await s(o,a.Q,l.Q),await s(o,a.detune,l.detune),await s(o,a.frequency,l.frequency),await s(o,a.gain,l.gain)),await r(a,o,l),l})(a,o)}}})(wn,ut,Ae,An,$t),In=(e=>(t,n)=>e.set(t,n))(Pt),Tn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const l=i(e),u={...Le,...s},c=r(l,u),h=a(l);super(e,!1,c,h?n():null),this._Q=t(this,h,c.Q,ne,te),this._detune=t(this,h,c.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,h,c.frequency,e.sampleRate/2,0),this._gain=t(this,h,c.gain,40*Math.log10(ne),te),this._nativeBiquadFilterNode=c,o(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw s();throw e}if(e.length!==t.length||t.length!==n.length)throw s()}})(on,Cn,En,Xe,ut,Xt,Qt,In),Nn=((e,t)=>(n,s,r)=>{const i=new Set;return n.connect=(r=>(a,o=0,l=0)=>{const u=0===i.size;if(t(a))return r.call(n,a,o,l),e(i,[a,o,l],(e=>e[0]===a&&e[1]===o&&e[2]===l),!0),u&&s(),a;r.call(n,a,o),e(i,[a,o],(e=>e[0]===a&&e[1]===o),!0),u&&s()})(n.connect),n.disconnect=(e=>(s,a,o)=>{const l=i.size>0;if(void 0===s)e.apply(n),i.clear();else if("number"==typeof s){e.call(n,s);for(const e of i)e[1]===s&&i.delete(e)}else{t(s)?e.call(n,s,a,o):e.call(n,s,a);for(const e of i)e[0]!==s||void 0!==a&&e[1]!==a||void 0!==o&&e[2]!==o||i.delete(e)}const u=0===i.size;l&&u&&r()})(n.disconnect),n})(de,sn),On=((e,t)=>(n,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw e()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw e()}});const r=n.createBufferSource();t(s,(()=>{const e=s.numberOfInputs;for(let t=0;tr.disconnect(s)))})(Ke,Nn),Rn=((e,t)=>(n,s)=>{const r=n.createChannelMerger(s.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,r),nt(r,s),r})(tn,On),Dn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(Rn,Ae,$t),Mn=((e,t,n,s,r)=>class extends e{constructor(e,i){const a=s(e),o={...Pe,...i};super(e,!1,n(a,o),r(a)?t():null)}})(on,Dn,Rn,Xt,Qt),Fn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(ct,Ae,$t),Bn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l=i({...Ve,...a});super(e,!1,n(o,l),r(o)?t():null)}})(on,Fn,ct,Xt,Qt,(e=>({...e,channelCount:e.numberOfOutputs}))),zn=((e,t,n,s)=>(r,{offset:i,...a})=>{const o=r.createBuffer(1,2,44100),l=t(r,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),u=n(r,{...a,gain:i}),c=o.getChannelData(0);c[0]=1,c[1]=1,l.buffer=o,l.loop=!0;const h={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get offset(){return u.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(r,l),s(ht(h,u),(()=>l.connect(u)),(()=>l.disconnect(u)))})(yn,vn,pt,Nn),Ln=((e,t,n,s,r)=>(i,a)=>{if(void 0===i.createConstantSource)return n(i,a);const o=i.createConstantSource();return nt(o,a),rt(o,a,"offset"),t(s,(()=>s(i)))||it(o),t(r,(()=>r(i)))||at(o),e(i,o),o})(yn,Wt,zn,Tt,Ot),Pn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,u){const c=i.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,offset:c.offset.value};c=t(u,e),null!==a&&c.start(a),null!==o&&c.stop(o)}return i.set(u,c),h?await e(u,l.offset,c.offset):await s(u,l.offset,c.offset),await r(l,u,c),c})(l,u)}}})(wn,Ln,Ae,An,$t),Vn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...We,...a},u=s(o,l),c=i(o),h=c?n():null;super(e,!1,u,h),this._constantSourceNodeRenderer=h,this._nativeConstantSourceNode=u,this._offset=t(this,c,u.offset,ne,te),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(on,Cn,Pn,Ln,Xt,Qt,Ft),Wn=((e,t)=>(n,s)=>{const r=n.createConvolver();if(nt(r,s),s.disableNormalization===r.normalize&&(r.normalize=!s.disableNormalization),tt(r,s,"buffer"),s.channelCount>2)throw e();if(t(r,"channelCount",(e=>()=>e.call(r)),(t=>n=>{if(n>2)throw e();return t.call(r,n)})),"max"===s.channelCountMode)throw e();return t(r,"channelCountMode",(e=>()=>e.call(r)),(t=>n=>{if("max"===n)throw e();return t.call(r,n)})),r})(yt,Et),Gn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(Wn,Ae,$t),Un=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l={...Ge,...a},u=n(o,l);super(e,!1,u,r(o)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=u,null!==l.buffer&&i(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,i(this,0)}else this._isBufferNullified=!1,i(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(on,Gn,Wn,Xt,Qt,In),qn=((e,t,n,s,r)=>i=>{const a=new WeakMap;return{render(o,l){const u=a.get(l);return void 0!==u?Promise.resolve(u):(async(o,l)=>{let u=n(o);const c=Z(u,l);if(!c){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:i};u=t(l,e)}return a.set(l,u),c?await e(l,o.delayTime,u.delayTime):await s(l,o.delayTime,u.delayTime),await r(o,l,u),u})(o,l)}}})(wn,dt,Ae,An,$t),jn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),u={...qe,...o},c=s(l,u),h=i(l);super(e,!1,c,h?n(u.maxDelayTime):null),this._delayTime=t(this,h,c.delayTime),a(this,u.maxDelayTime)}get delayTime(){return this._delayTime}})(on,Cn,qn,dt,Xt,Qt,In),Hn=(e=>(t,n)=>{const s=t.createDynamicsCompressor();if(nt(s,n),n.channelCount>2)throw e();if("max"===n.channelCountMode)throw e();return rt(s,n,"attack"),rt(s,n,"knee"),rt(s,n,"ratio"),rt(s,n,"release"),rt(s,n,"threshold"),s})(yt),$n=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(o,e)}return i.set(o,l),u?(await e(o,a.attack,l.attack),await e(o,a.knee,l.knee),await e(o,a.ratio,l.ratio),await e(o,a.release,l.release),await e(o,a.threshold,l.threshold)):(await s(o,a.attack,l.attack),await s(o,a.knee,l.knee),await s(o,a.ratio,l.ratio),await s(o,a.release,l.release),await s(o,a.threshold,l.threshold)),await r(a,o,l),l})(a,o)}}})(wn,Hn,Ae,An,$t),Kn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,r){const l=i(e),u={...He,...r},c=s(l,u),h=a(l);super(e,!1,c,h?n():null),this._attack=t(this,h,c.attack),this._knee=t(this,h,c.knee),this._nativeDynamicsCompressorNode=c,this._ratio=t(this,h,c.ratio),this._release=t(this,h,c.release),this._threshold=t(this,h,c.threshold),o(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,r()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,r()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(on,Cn,$n,Hn,yt,Xt,Qt,In),Xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(o,e)}return i.set(o,l),u?await e(o,a.gain,l.gain):await s(o,a.gain,l.gain),await r(a,o,l),l})(a,o)}}})(wn,pt,Ae,An,$t),Zn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...$e,...a},u=s(o,l),c=i(o);super(e,!1,u,c?n():null),this._gain=t(this,c,u.gain,ne,te)}get gain(){return this._gain}})(on,Cn,Xn,pt,Xt,Qt),Yn=((e,t,n,s)=>(r,i,{channelCount:a,channelCountMode:o,channelInterpretation:l,feedback:u,feedforward:c})=>{const h=ot(i,r.sampleRate),d=u instanceof Float64Array?u:new Float64Array(u),p=c instanceof Float64Array?c:new Float64Array(c),f=d.length,m=p.length,g=Math.min(f,m);if(0===f||f>20)throw s();if(0===d[0])throw t();if(0===m||m>20)throw s();if(0===p[0])throw t();if(1!==d[0]){for(let e=0;e{const t=e.inputBuffer,n=e.outputBuffer,s=t.numberOfChannels;for(let e=0;ey.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>y.dispatchEvent(e[0]),getFrequencyResponse(t,n,s){if(t.length!==n.length||n.length!==s.length)throw e();const r=t.length;for(let e=0;ey.removeEventListener(e[0],e[1],e[2])},y)})(Xe,Ke,gt,yt),Qn=((e,t,n,s)=>r=>e(Je,(()=>Je(r)))?Promise.resolve(e(s,s)).then((e=>{if(!e){const e=n(r,512,0,1);r.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>r.currentTime,e.connect(r.destination)}return r.startRendering()})):new Promise((e=>{const n=t(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});r.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(r.destination),r.startRendering()})))(Wt,pt,gt,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),s=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{s.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(pt,Yt)),Jn=((e,t,n,s,r)=>(i,a)=>{const o=new WeakMap;let l=null;const u=async(u,c)=>{let h=null,d=t(u);const p=Z(d,c);if(void 0===c.createIIRFilter?h=e(c,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(d=c.createIIRFilter(a,i)),o.set(c,null===h?d:h),null!==h){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(u.context.destination.channelCount,u.context.length,c.sampleRate);l=(async()=>{await s(u,e,e.destination);return((e,t,n,s)=>{const r=n instanceof Float64Array?n:new Float64Array(n),i=s instanceof Float64Array?s:new Float64Array(s),a=r.length,o=i.length,l=Math.min(a,o);if(1!==r[0]){for(let e=0;e(t,n,s)=>{if(void 0===t.createIIRFilter)return e(t,n,s);const r=t.createIIRFilter(s.feedforward,s.feedback);return nt(r,s),r})(Yn),ts=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l=r(o),u={...Ze,...a},c=t(o,l?null:e.baseLatency,u);super(e,!1,c,l?n(u.feedback,u.feedforward):null),(e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,s,r)=>{if(n.length!==s.length||s.length!==r.length)throw Xe();return t.call(e,n,s,r)})})(c),this._nativeIIRFilterNode=c,i(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(on,es,Jn,Xt,Qt,In),ns=((e,t,n,s,r,i,a,o)=>(l,u)=>{const c=u.listener,{forwardX:h,forwardY:d,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:y,upY:b,upZ:w}=void 0===c.forwardX?(()=>{const h=new Float32Array(1),d=t(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=a(u);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const y=()=>{if(f)return;f=!0;const e=s(u,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[i(e,h,0),i(e,h,1),i(e,h,2),i(e,h,3),i(e,h,4),i(e,h,5)];t.some(((e,t)=>e!==m[t]))&&(c.setOrientation(...t),m=t);const n=[i(e,h,6),i(e,h,7),i(e,h,8)];n.some(((e,t)=>e!==g[t]))&&(c.setPosition(...n),g=n)},d.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,c.setOrientation(...m))},w=e=>t=>{t!==g[e]&&(g[e]=t,c.setPosition(...g))},v=(t,s,i)=>{const a=n(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:s});a.connect(d,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>s});const c=e({context:l},p,a.offset,ne,te);var h,f,m,g,b,w,v;return o(c,"value",(e=>()=>e.call(c)),(e=>t=>{try{e.call(c,t)}catch(e){if(9!==e.code)throw e}y(),p&&i(t)})),c.cancelAndHoldAtTime=(h=c.cancelAndHoldAtTime,p?()=>{throw r()}:(...e)=>{const t=h.apply(c,e);return y(),t}),c.cancelScheduledValues=(f=c.cancelScheduledValues,p?()=>{throw r()}:(...e)=>{const t=f.apply(c,e);return y(),t}),c.exponentialRampToValueAtTime=(m=c.exponentialRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=m.apply(c,e);return y(),t}),c.linearRampToValueAtTime=(g=c.linearRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=g.apply(c,e);return y(),t}),c.setTargetAtTime=(b=c.setTargetAtTime,p?()=>{throw r()}:(...e)=>{const t=b.apply(c,e);return y(),t}),c.setValueAtTime=(w=c.setValueAtTime,p?()=>{throw r()}:(...e)=>{const t=w.apply(c,e);return y(),t}),c.setValueCurveAtTime=(v=c.setValueCurveAtTime,p?()=>{throw r()}:(...e)=>{const t=v.apply(c,e);return y(),t}),c};return{forwardX:v(0,0,b(0)),forwardY:v(1,0,b(1)),forwardZ:v(2,-1,b(2)),positionX:v(6,0,w(0)),positionY:v(7,0,w(1)),positionZ:v(8,0,w(2)),upX:v(3,0,b(3)),upY:v(4,1,b(4)),upZ:v(5,0,b(5))}})():c;return{get forwardX(){return h},get forwardY(){return d},get forwardZ(){return p},get positionX(){return f},get positionY(){return m},get positionZ(){return g},get upX(){return y},get upY(){return b},get upZ(){return w}}})(Cn,Rn,Ln,gt,yt,St,Qt,Et),ss=new WeakMap,rs=((e,t,n,s,r,i)=>class extends n{constructor(n,i){super(n),this._nativeContext=n,O.set(this,n),s(n)&&r.set(n,new Set),this._destination=new e(this,i),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?i(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(_n,ns,en,Qt,ss,Ft),is=((e,t,n,s,r,i)=>(a,o)=>{const l=a.createOscillator();return nt(l,o),rt(l,o,"detune"),rt(l,o,"frequency"),void 0!==o.periodicWave?l.setPeriodicWave(o.periodicWave):tt(l,o,"type"),t(n,(()=>n(a)))||it(l),t(s,(()=>s(a)))||i(l,a),t(r,(()=>r(a)))||at(l),e(a,l),l})(yn,Wt,Tt,Nt,Ot,Mt),as=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null,l=null;return{set periodicWave(e){a=e},set start(e){o=e},set stop(e){l=e},render(u,c){const h=i.get(c);return void 0!==h?Promise.resolve(h):(async(u,c)=>{let h=n(u);const d=Z(h,c);if(!d){const e={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,detune:h.detune.value,frequency:h.frequency.value,periodicWave:null===a?void 0:a,type:h.type};h=t(c,e),null!==o&&h.start(o),null!==l&&h.stop(l)}return i.set(c,h),d?(await e(c,u.detune,h.detune),await e(c,u.frequency,h.frequency)):(await s(c,u.detune,h.detune),await s(c,u.frequency,h.frequency)),await r(u,c,h),h})(u,c)}}})(wn,is,Ae,An,$t),os=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...wt,...a},u=n(o,l),c=i(o),h=c?s():null,d=e.sampleRate/2;super(e,!1,u,h),this._detune=t(this,c,u.detune,153600,-153600),this._frequency=t(this,c,u.frequency,d,-d),this._nativeOscillatorNode=u,this._onended=null,this._oscillatorNodeRenderer=h,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(on,Cn,is,as,Xt,Qt,Ft),ls=(e=>(t,n)=>{const s=e(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=t.createBuffer(1,2,44100);return s.buffer=r,s.loop=!0,s.connect(n),s.start(),()=>{s.stop(),s.disconnect(n)}})(vn),us=((e,t,n,s,r)=>(i,{curve:a,oversample:o,...l})=>{const u=i.createWaveShaper(),c=i.createWaveShaper();nt(u,l),nt(c,l);const h=n(i,{...l,gain:1}),d=n(i,{...l,gain:-1}),p=n(i,{...l,gain:1}),f=n(i,{...l,gain:-1});let m=null,g=!1,y=null;const b={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){h.channelCount=e,d.channelCount=e,u.channelCount=e,p.channelCount=e,c.channelCount=e,f.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){h.channelCountMode=e,d.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e,c.channelCountMode=e,f.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){h.channelInterpretation=e,d.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e,c.channelInterpretation=e,f.channelInterpretation=e},get context(){return u.context},get curve(){return y},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)u.curve=n,c.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),s=new Float32Array(e+2-e%2);t[0]=n[0],s[0]=-n[e-1];const r=Math.ceil((e+1)/2),i=(e+1)/2-1;for(let a=1;ah.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>h.dispatchEvent(e[0]),removeEventListener:(...e)=>h.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),o!==b.oversample&&(b.oversample=o);return r(ht(b,p),(()=>{h.connect(u).connect(p),h.connect(d).connect(c).connect(f).connect(p),g=!0,s(y)&&(m=e(i,h))}),(()=>{h.disconnect(u),u.disconnect(p),h.disconnect(d),d.disconnect(c),c.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))})(ls,Ke,pt,_t,Nn),cs=((e,t,n,s,r,i,a)=>(o,l)=>{const u=o.createWaveShaper();if(null!==i&&"webkitAudioContext"===i.name&&void 0===o.createGain().gain.automationRate)return n(o,l);nt(u,l);const c=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==c&&c.length<2)throw t();tt(u,{curve:c},"curve"),tt(u,l,"oversample");let h=null,d=!1;a(u,"curve",(e=>()=>e.call(u)),(t=>n=>(t.call(u,n),d&&(s(n)&&null===h?h=e(o,u):s(n)||null===h||(h(),h=null)),n)));return r(u,(()=>{d=!0,s(u.curve)&&(h=e(o,u))}),(()=>{d=!1,null!==h&&(h(),h=null)}))})(ls,Ke,us,_t,Nn,tn,Et),hs=((e,t,n,s,r,i,a,o,l,u)=>(c,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:y,orientationZ:b,panningModel:w,positionX:v,positionY:A,positionZ:x,refDistance:C,rolloffFactor:k,...S})=>{const _=c.createPanner();if(S.channelCount>2)throw a();if("max"===S.channelCountMode)throw a();nt(_,S);const E={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},I=n(c,{...E,channelInterpretation:"speakers",numberOfInputs:6}),T=s(c,{...S,gain:1}),N=s(c,{...E,gain:1}),O=s(c,{...E,gain:0}),R=s(c,{...E,gain:0}),D=s(c,{...E,gain:0}),M=s(c,{...E,gain:0}),F=s(c,{...E,gain:0}),B=r(c,256,6,1),z=i(c,{...E,curve:new Float32Array([1,1]),oversample:"none"});let L=[g,y,b],P=[v,A,x];const V=new Float32Array(1);B.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,V,0),l(e,V,1),l(e,V,2)];t.some(((e,t)=>e!==L[t]))&&(_.setOrientation(...t),L=t);const n=[l(e,V,3),l(e,V,4),l(e,V,5)];n.some(((e,t)=>e!==P[t]))&&(_.setPosition(...n),P=n)},Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(D.gain,"defaultValue",{get:()=>0}),Object.defineProperty(M.gain,"defaultValue",{get:()=>0}),Object.defineProperty(F.gain,"defaultValue",{get:()=>0});const W={get bufferSize(){},get channelCount(){return _.channelCount},set channelCount(e){if(e>2)throw a();T.channelCount=e,_.channelCount=e},get channelCountMode(){return _.channelCountMode},set channelCountMode(e){if("max"===e)throw a();T.channelCountMode=e,_.channelCountMode=e},get channelInterpretation(){return _.channelInterpretation},set channelInterpretation(e){T.channelInterpretation=e,_.channelInterpretation=e},get coneInnerAngle(){return _.coneInnerAngle},set coneInnerAngle(e){_.coneInnerAngle=e},get coneOuterAngle(){return _.coneOuterAngle},set coneOuterAngle(e){_.coneOuterAngle=e},get coneOuterGain(){return _.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();_.coneOuterGain=e},get context(){return _.context},get distanceModel(){return _.distanceModel},set distanceModel(e){_.distanceModel=e},get inputs(){return[T]},get maxDistance(){return _.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;_.maxDistance=e},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},get orientationX(){return N.gain},get orientationY(){return O.gain},get orientationZ(){return R.gain},get panningModel(){return _.panningModel},set panningModel(e){_.panningModel=e},get positionX(){return D.gain},get positionY(){return M.gain},get positionZ(){return F.gain},get refDistance(){return _.refDistance},set refDistance(e){if(e<0)throw new RangeError;_.refDistance=e},get rolloffFactor(){return _.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;_.rolloffFactor=e},addEventListener:(...e)=>T.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>T.dispatchEvent(e[0]),removeEventListener:(...e)=>T.removeEventListener(e[0],e[1],e[2])};h!==W.coneInnerAngle&&(W.coneInnerAngle=h),d!==W.coneOuterAngle&&(W.coneOuterAngle=d),p!==W.coneOuterGain&&(W.coneOuterGain=p),f!==W.distanceModel&&(W.distanceModel=f),m!==W.maxDistance&&(W.maxDistance=m),g!==W.orientationX.value&&(W.orientationX.value=g),y!==W.orientationY.value&&(W.orientationY.value=y),b!==W.orientationZ.value&&(W.orientationZ.value=b),w!==W.panningModel&&(W.panningModel=w),v!==W.positionX.value&&(W.positionX.value=v),A!==W.positionY.value&&(W.positionY.value=A),x!==W.positionZ.value&&(W.positionZ.value=x),C!==W.refDistance&&(W.refDistance=C),k!==W.rolloffFactor&&(W.rolloffFactor=k),1===L[0]&&0===L[1]&&0===L[2]||_.setOrientation(...L),0===P[0]&&0===P[1]&&0===P[2]||_.setPosition(...P);return u(ht(W,_),(()=>{T.connect(_),e(T,z,0,0),z.connect(N).connect(I,0,0),z.connect(O).connect(I,0,1),z.connect(R).connect(I,0,2),z.connect(D).connect(I,0,3),z.connect(M).connect(I,0,4),z.connect(F).connect(I,0,5),I.connect(B).connect(c.destination)}),(()=>{T.disconnect(_),o(T,z,0,0),z.disconnect(N),N.disconnect(I),z.disconnect(O),O.disconnect(I),z.disconnect(R),R.disconnect(I),z.disconnect(D),D.disconnect(I),z.disconnect(M),M.disconnect(I),z.disconnect(F),F.disconnect(I),I.disconnect(B),B.disconnect(c.destination)}))})(ge,Ke,Rn,pt,gt,cs,yt,ve,St,Nn),ds=(e=>(t,n)=>{const s=t.createPanner();return void 0===s.orientationX?e(t,n):(nt(s,n),rt(s,n,"orientationX"),rt(s,n,"orientationY"),rt(s,n,"orientationZ"),rt(s,n,"positionX"),rt(s,n,"positionY"),rt(s,n,"positionZ"),tt(s,n,"coneInnerAngle"),tt(s,n,"coneOuterAngle"),tt(s,n,"coneOuterGain"),tt(s,n,"distanceModel"),tt(s,n,"maxDistance"),tt(s,n,"panningModel"),tt(s,n,"refDistance"),tt(s,n,"rolloffFactor"),s)})(hs),ps=((e,t,n,s,r,i,a,o,l,u)=>()=>{const c=new WeakMap;let h=null;return{render(d,p){const f=c.get(p);return void 0!==f?Promise.resolve(f):(async(d,p)=>{let f=null,m=i(d);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},y={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=Z(m,p);if("bufferSize"in m)f=s(p,{...g,gain:1});else if(!b){const e={...y,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=r(p,e)}if(c.set(p,null===f?m:f),null!==f){if(null===h){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(6,d.context.length,p.sampleRate),s=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});s.connect(e.destination),h=(async()=>{const t=await Promise.all([d.orientationX,d.orientationY,d.orientationZ,d.positionX,d.positionY,d.positionZ].map((async(t,s)=>{const r=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===s?1:0});return await o(e,t,r.offset),r})));for(let e=0;e<6;e+=1)t[e].connect(s,0,e),t[e].start(0);return u(e)})()}const e=await h,i=s(p,{...g,gain:1});await l(d,p,i);const c=[];for(let t=0;te!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/p.sampleRate;w.gain.setValueAtTime(0,a),w=s(p,{...g,gain:0}),v=r(p,{...y,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),w.gain.setValueAtTime(1,a),i.connect(w).connect(v.inputs[0]),v.connect(f)}}return f}return b?(await e(p,d.orientationX,m.orientationX),await e(p,d.orientationY,m.orientationY),await e(p,d.orientationZ,m.orientationZ),await e(p,d.positionX,m.positionX),await e(p,d.positionY,m.positionY),await e(p,d.positionZ,m.positionZ)):(await o(p,d.orientationX,m.orientationX),await o(p,d.orientationY,m.orientationY),await o(p,d.orientationZ,m.orientationZ),await o(p,d.positionX,m.positionX),await o(p,d.positionY,m.positionY),await o(p,d.positionZ,m.positionZ)),me(m)?await l(d,p,m.inputs[0]):await l(d,p,m),m})(d,p)}}})(wn,Rn,Ln,pt,ds,Ae,Yt,An,$t,Qn),fs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),u={...vt,...o},c=n(l,u),h=i(l);super(e,!1,c,h?s():null),this._nativePannerNode=c,this._orientationX=t(this,h,c.orientationX,ne,te),this._orientationY=t(this,h,c.orientationY,ne,te),this._orientationZ=t(this,h,c.orientationZ,ne,te),this._positionX=t(this,h,c.positionX,ne,te),this._positionY=t(this,h,c.positionY,ne,te),this._positionZ=t(this,h,c.positionZ,ne,te),a(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(on,Cn,ds,ps,Xt,Qt,In),ms=(e=>(t,{disableNormalization:n,imag:s,real:r})=>{const i=s instanceof Float32Array?s:new Float32Array(s),a=r instanceof Float32Array?r:new Float32Array(r),o=t.createPeriodicWave(a,i,{disableNormalization:n});if(Array.from(s).length<2)throw e();return o})(Q),gs=((e,t,n,s)=>class r{constructor(r,i){const a=t(r),o=s({...At,...i}),l=e(a,o);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===r.prototype||n.has(e)}})(ms,Xt,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),ys=((e,t,n,s,r,i)=>{const a=16385,o=new Float32Array([1,1]),l=Math.PI/2,u={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},c={...u,oversample:"none"},h=(e,i,h,d,p)=>{if(1===i)return((e,t,r,i)=>{const h=new Float32Array(a),d=new Float32Array(a);for(let e=0;e{const d=new Float32Array(a),p=new Float32Array(a),f=new Float32Array(a),m=new Float32Array(a),g=Math.floor(8192.5);for(let e=0;eg){const t=(e-g)/(16384-g)*l;d[e]=Math.cos(t),p[e]=Math.sin(t),f[e]=0,m[e]=1}else{const t=e/(16384-g)*l;d[e]=1,p[e]=0,f[e]=Math.cos(t),m[e]=Math.sin(t)}const y=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...u,gain:0}),w=s(e,{...c,curve:d}),v=n(e,{...u,gain:0}),A=s(e,{...c,curve:p}),x=s(e,{...c,curve:o}),C=n(e,{...u,gain:0}),k=s(e,{...c,curve:f}),S=n(e,{...u,gain:0}),_=s(e,{...c,curve:m});return{connectGraph(){r.connect(y),r.connect(void 0===x.inputs?x:x.inputs[0]),y.connect(b,0),y.connect(v,0),y.connect(C,1),y.connect(S,1),x.connect(i),i.connect(void 0===w.inputs?w:w.inputs[0]),i.connect(void 0===A.inputs?A:A.inputs[0]),i.connect(void 0===k.inputs?k:k.inputs[0]),i.connect(void 0===_.inputs?_:_.inputs[0]),w.connect(b.gain),A.connect(v.gain),k.connect(C.gain),_.connect(S.gain),b.connect(h,0,0),C.connect(h,0,0),v.connect(h,0,1),S.connect(h,0,1)},disconnectGraph(){r.disconnect(y),r.disconnect(void 0===x.inputs?x:x.inputs[0]),y.disconnect(b,0),y.disconnect(v,0),y.disconnect(C,1),y.disconnect(S,1),x.disconnect(i),i.disconnect(void 0===w.inputs?w:w.inputs[0]),i.disconnect(void 0===A.inputs?A:A.inputs[0]),i.disconnect(void 0===k.inputs?k:k.inputs[0]),i.disconnect(void 0===_.inputs?_:_.inputs[0]),w.disconnect(b.gain),A.disconnect(v.gain),k.disconnect(C.gain),_.disconnect(S.gain),b.disconnect(h,0,0),C.disconnect(h,0,0),v.disconnect(h,0,1),S.disconnect(h,0,1)}}})(e,h,d,p);throw r()};return(t,{channelCount:s,channelCountMode:a,pan:o,...l})=>{if("max"===a)throw r();const u=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),c=n(t,{...l,channelCount:s,channelCountMode:a,gain:1}),d=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:o});let{connectGraph:p,disconnectGraph:f}=h(t,s,c,d,u);Object.defineProperty(d.gain,"defaultValue",{get:()=>0}),Object.defineProperty(d.gain,"maxValue",{get:()=>1}),Object.defineProperty(d.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount!==e&&(g&&f(),({connectGraph:p,disconnectGraph:f}=h(t,e,c,d,u)),g&&p()),c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw r();c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[c]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get pan(){return d.gain},addEventListener:(...e)=>c.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>c.dispatchEvent(e[0]),removeEventListener:(...e)=>c.removeEventListener(e[0],e[1],e[2])};let g=!1;return i(ht(m,u),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}})(Rn,ct,pt,cs,yt,Nn),bs=((e,t)=>(n,s)=>{const r=s.channelCountMode;if("clamped-max"===r)throw t();if(void 0===n.createStereoPanner)return e(n,s);const i=n.createStereoPanner();return nt(i,s),rt(i,s,"pan"),Object.defineProperty(i,"channelCountMode",{get:()=>r,set:e=>{if(e!==r)throw t()}}),i})(ys,yt),ws=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(o,e)}return i.set(o,l),u?await e(o,a.pan,l.pan):await s(o,a.pan,l.pan),me(l)?await r(a,o,l.inputs[0]):await r(a,o,l),l})(a,o)}}})(wn,bs,Ae,An,$t),vs=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...xt,...a},u=n(o,l),c=i(o);super(e,!1,u,c?s():null),this._pan=t(this,c,u.pan)}get pan(){return this._pan}})(on,Cn,bs,ws,Xt,Qt),As=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(cs,Ae,$t),xs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,t){const o=r(e),l={...kt,...t},u=n(o,l);super(e,!0,u,i(o)?s():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=u,a(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(on,Ke,cs,As,Xt,Qt,In),Cs=(e=>null!==e&&e.isSecureContext)(qt),ks=(e=>(t,n,s)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return s()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(qt),Ss=new WeakMap,_s=((e,t)=>n=>{let s=e.get(n);if(void 0!==s)return s;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),e.set(n,s),s})(Ss,Yt),Es=Cs?((e,t,n,s,r,i,a,o,l,u,c,h,d)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const y=c.get(f);if(void 0!==y&&y.has(m))return Promise.resolve();const b=u.get(f);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const w=i(f),v=void 0===w.audioWorklet?r(m).then((([e,t])=>{const[s,r]=L(e,t);return n(`${s};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${r}\n})})(window,'_AWGS')`)})).then((()=>{const e=d._AWGS.pop();if(void 0===e)throw new SyntaxError;s(w.currentTime,w.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const s=M.get(w);if(void 0!==s){if(s.has(e))throw t();V(n),P(n.parameterDescriptors),s.set(e,n)}else V(n),P(n.parameterDescriptors),M.set(w,new Map([[e,n]]))}),w.sampleRate,void 0,void 0)))})):Promise.all([r(m),Promise.resolve(e(h,h))]).then((([[e,t],n])=>{const s=p+1;p=s;const[r,i]=L(e,t),u=new Blob([`${r};((AudioWorkletProcessor,registerProcessor)=>{${i}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${s}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),c=URL.createObjectURL(u);return w.audioWorklet.addModule(c,g).then((()=>{if(o(w))return w;const e=a(w);return e.audioWorklet.addModule(c,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${s}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(c)))}));return void 0===b?u.set(f,new Map([[m,v]])):b.set(m,v),v.then((()=>{const e=c.get(f);void 0===e?c.set(f,new Set([m])):e.add(m)})).finally((()=>{const e=u.get(f);void 0!==e&&e.delete(m)})),v}})(Wt,yt,(e=>t=>new Promise(((n,s)=>{if(null===e)return void s(new SyntaxError);const r=e.document.head;if(null===r)s(new SyntaxError);else{const i=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(a),l=e.onerror,u=()=>{e.onerror=l,URL.revokeObjectURL(o)};e.onerror=(t,n,r,i,a)=>n===o||n===e.location.href&&1===r&&1===i?(u(),s(a),!1):null!==l?l(t,n,r,i,a):void 0,i.onerror=()=>{u(),s(new SyntaxError)},i.onload=()=>{u(),n()},i.src=o,i.type="module",r.appendChild(i)}})))(qt),ks,(e=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw e()})((()=>new DOMException("","AbortError"))),Xt,_s,Qt,an,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new t(1,128,44100),r=URL.createObjectURL(n);let i=!1,a=!1;try{await s.audioWorklet.addModule(r);const t=new e(s,"a",{numberOfOutputs:0}),n=s.createOscillator();t.port.onmessage=()=>i=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await s.startRendering(),await new Promise((e=>setTimeout(e)))}catch{}finally{URL.revokeObjectURL(r)}return i&&!a})(an,Yt),qt):void 0,Is=((e,t)=>n=>e(n)||t(n))(nn,Qt),Ts=((e,t,n,s,r,i,a,o,l,u,c)=>(h,d)=>{const p=a(h)?h:i(h);if(r.has(d)){const e=n();return Promise.reject(e)}try{r.add(d)}catch{}return t(l,(()=>l(p)))?p.decodeAudioData(d).then((n=>(Ue(d).catch((()=>{})),t(o,(()=>o(n)))||c(n),e.add(n),n))):new Promise(((t,n)=>{const r=async()=>{try{await Ue(d)}catch{}},i=e=>{n(e),r()};try{p.decodeAudioData(d,(n=>{"function"!=typeof n.copyFromChannel&&(u(n),J(n)),e.add(n),r().then((()=>t(n)))}),(e=>{i(null===e?s():e)}))}catch(e){i(e)}}))})(cn,Wt,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,Xt,Is,Y,Je,fn,mn),Ns=((e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m,g,y,b,w)=>class extends f{constructor(t,n){super(t,n),this._nativeContext=t,this._audioWorklet=void 0===e?void 0:{addModule:(t,n)=>e(this,t,n)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new r(this)}createBuffer(e,t,s){return new n({length:t,numberOfChannels:e,sampleRate:s})}createBufferSource(){return new s(this)}createChannelMerger(e=6){return new i(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new a(this,{numberOfOutputs:e})}createConstantSource(){return new o(this)}createConvolver(){return new l(this)}createDelay(e=1){return new c(this,{maxDelayTime:e})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(e,t){return new p(this,{feedback:t,feedforward:e})}createOscillator(){return new m(this)}createPanner(){return new g(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new y(this,{...n,imag:t,real:e})}createStereoPanner(){return new b(this)}createWaveShaper(){return new w(this)}decodeAudioData(e,t,n){return u(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}})(Es,un,gn,Sn,Tn,Mn,Bn,Vn,Un,Ts,jn,Kn,Zn,ts,rs,os,fs,gs,vs,xs),Os=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(on,((e,t)=>e.createMediaElementSource(t.mediaElement)),Xt,Qt),Rs=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e);if(s(i))throw new TypeError;const a={...Qe,...r},o=t(i,a);super(e,!1,o,null),this._nativeMediaStreamAudioDestinationNode=o}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(on,((e,t)=>{const n=e.createMediaStreamDestination();return nt(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),Xt,Qt),Ds=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(on,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.idt.id?1:0));const s=n.slice(0,1),r=e.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(r,"mediaStream",{value:t}),r}),Xt,Qt),Ms=((e,t)=>(n,{mediaStreamTrack:s})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(s);const r=new MediaStream([s]),i=n.createMediaStreamSource(r);if("audio"!==s.kind)throw e();if(t(n))throw new TypeError;return i})(Ke,Qt),Fs=((e,t,n)=>class extends e{constructor(e,s){const r=n(e);super(e,!0,t(r,s),null)}})(on,Ms,Xt),Bs=((e,t,n,s,r,i,a,o,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw s();if(!ue(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:r}=e,{sampleRate:i}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===r?512/i:"interactive"===r||void 0===r?256/i:"playback"===r?1024/i:128*Math.max(2,Math.min(128,Math.round(r*i/128)))/i,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),le(this)})))}createMediaElementSource(e){return new r(this,{mediaElement:e})}createMediaStreamDestination(){return new i(this)}createMediaStreamSource(e){return new a(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new o(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(Ns,Ke,yt,Ct,Os,Rs,Ds,Fs,tn),zs=(e=>t=>{const n=e.get(t);if(void 0===n)throw new Error("The context has no set of AudioWorkletNodes.");return n})(ss),Ls=(e=>(t,n)=>{e(t).add(n)})(zs),Ps=(e=>(t,n,s=0,r=0)=>{const i=t[s];if(void 0===i)throw e();return Ee(n)?i.connect(n,0,r):i.connect(n,0)})(Q),Vs=(e=>(t,n)=>{e(t).delete(n)})(zs),Ws=(e=>(t,n=void 0,s=void 0,r=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?je(e,t,n).disconnect():Ee(n)?void 0===s?t.forEach((e=>e.disconnect(n))):void 0===r?je(e,t,s).disconnect(n,0):je(e,t,s).disconnect(n,0,r):void 0===s?t.forEach((e=>e.disconnect(n))):je(e,t,s).disconnect(n,0))(Q),Gs=new WeakMap,Us=((e,t)=>n=>t(e,n))(Gs,W),qs=((e,t,n,s,r,i,a,o,l,u,c,h,d)=>(p,f,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const y=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(y.some((e=>e<1)))throw l();if(y.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,w=y.reduce(((e,t)=>e+t),0),v=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+v>6||w>6)throw l();const A=new MessageChannel,x=[],C=[];for(let e=0;evoid 0===e?0:e},maxValue:{get:()=>void 0===t?ne:t},minValue:{get:()=>void 0===n?te:n}}),k.push(r)}const S=s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+v)}),_=ot(f,p.sampleRate),E=o(p,_,b+v,Math.max(1,w)),I=r(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),T=[];for(let e=0;e{const n=k[t];return n.connect(S,0,b+t),n.start(0),[e,n.offset]})));S.connect(E);let O=g.channelInterpretation,R=null;const D=0===g.numberOfOutputs?[E]:T,M={get bufferSize(){return _},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return O},set channelInterpretation(e){for(const t of x)t.channelInterpretation=e;O=e},get context(){return E.context},get inputs(){return x},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return R},set onprocessorerror(e){"function"==typeof R&&M.removeEventListener("processorerror",R),R="function"==typeof e?e:null,"function"==typeof R&&M.addEventListener("processorerror",R)},get parameters(){return N},get port(){return A.port2},addEventListener:(...e)=>E.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,D),disconnect:u.bind(null,D),dispatchEvent:(...e)=>E.dispatchEvent(e[0]),removeEventListener:(...e)=>E.removeEventListener(e[0],e[1],e[2])},B=new Map;var z,L;A.port1.addEventListener=(z=A.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=B.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{c(p.currentTime,p.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return z.call(A.port1,e[0],e[1],e[2])}),A.port1.removeEventListener=(L=A.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=B.get(e[1]);void 0!==t&&(B.delete(e[1]),e[1]=t)}return L.call(A.port1,e[0],e[1],e[2])});let P=null;Object.defineProperty(A.port1,"onmessage",{get:()=>P,set:e=>{"function"==typeof P&&A.port1.removeEventListener("message",P),P="function"==typeof e?e:null,"function"==typeof P&&(A.port1.addEventListener("message",P),A.port1.start())}}),m.prototype.port=A.port1;let V=null;const W=((e,t,n,s)=>{let r=F.get(e);void 0===r&&(r=new WeakMap,F.set(e,r));const i=lt(n,s);return r.set(t,i),i})(p,M,m,g);W.then((e=>V=e));const G=Be(g.numberOfInputs,g.channelCount),U=Be(g.numberOfOutputs,y),q=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let j=!0;const H=()=>{g.numberOfOutputs>0&&E.disconnect(I);for(let e=0,t=0;e{if(null!==V){const n=h(M);for(let s=0;s<_;s+=128){for(let t=0;t{Me(e,q,t,b+n,s)}));for(let e=0;e{if(n[t].size>0)return $.set(t,_/128),e;const s=$.get(t);return void 0===s?[]:(e.every((e=>e.every((e=>0===e))))&&(1===s?$.delete(t):$.set(t,s-1)),e)})),r=c(p.currentTime+s/p.sampleRate,p.sampleRate,(()=>V.process(e,U,q)));j=r;for(let e=0,n=0;eE.connect(X).connect(p.destination),Y=()=>{E.disconnect(X),X.disconnect()};return Z(),d(M,(()=>{if(j){Y(),g.numberOfOutputs>0&&E.connect(I);for(let e=0,t=0;e{j&&(Z(),H()),K=!1}))})(Ps,Q,Ke,Rn,ct,Ln,pt,gt,yt,Ws,ks,Us,Nn),js=((e,t,n,s,r)=>(i,a,o,l,u,c)=>{if(null!==o)try{const t=new o(i,l,c),s=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>c.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),t.addEventListener=(d=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=s.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},s.set(t,e[1]))}}return d.call(t,"error",e[1],e[2]),d.call(t,...e)}),t.removeEventListener=(h=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=s.get(e[1]);void 0!==t&&(s.delete(e[1]),e[1]=t)}return h.call(t,"error",e[1],e[2]),h.call(t,e[0],e[1],e[2])}),0!==c.numberOfOutputs){const e=n(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(i.destination);return r(t,(()=>e.disconnect()),(()=>e.connect(i.destination)))}return t}catch(e){if(11===e.code)throw s();throw e}var h,d;if(void 0===u)throw s();return(e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}})(c),t(i,a,u,c)})(Ke,qs,pt,yt,Nn),Hs=((e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m)=>(g,y,b)=>{const w=new WeakMap;let v=null;return{render(A,x){o(x,A);const C=w.get(x);return void 0!==C?Promise.resolve(C):(async(o,A)=>{let x=c(o),C=null;const k=Z(x,A),S=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(null===h){const e=S.reduce(((e,t)=>e+t),0),n=r(A,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),i=[];for(let e=0;e{const l=new d(n,128*Math.ceil(o.context.length/128),A.sampleRate),u=[],c=[];for(let e=0;e{const t=i(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await p(l,e,t.offset),t}))),g=s(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;ef(o,l,e)))),m(l)};v=ze(o,0===n?null:await l(),A,y,S,b,u)}const e=await v,t=n(A,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,c,h]=C;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;et=>e.get(t))(Ss),Ks=(e=>(t,n)=>{e.set(t,n)})(Gs),Xs=Cs?((e,t,n,s,r,i,a,o,l,u,c,h,d,p)=>class extends t{constructor(t,p,f){var m;const g=o(t),y=l(g),b=c({...De,...f});d(b);const w=M.get(g),v=null==w?void 0:w.get(p),A=y||"closed"!==g.state?g:null!==(m=a(g))&&void 0!==m?m:g,x=r(A,y?null:t.baseLatency,u,p,v,b);super(t,!0,x,y?s(p,b,v):null);const C=[];x.parameters.forEach(((e,t)=>{const s=n(this,y,e);C.push([t,s])})),this._nativeAudioWorkletNode=x,this._onprocessorerror=null,this._parameters=new Re(C),y&&e(g,this);const{activeInputs:k}=i(this);h(x,k)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(e){const t="function"==typeof e?p(this,e):null;this._nativeAudioWorkletNode.onprocessorerror=t;const n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==n&&n===t?e:n}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}})(Ls,on,Cn,Hs,js,ie,$s,Xt,Qt,an,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),Ks,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),Ft):void 0,Zs=(((e,t,n,s,r)=>{})(Ke,yt,Ct,rs,tn),((e,t)=>(n,s,r)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,s,r)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(yt,Yt)),Ys=((e,t,n,s,r,i,a,o)=>(l,u)=>n(l).render(l,u).then((()=>Promise.all(Array.from(s(u)).map((e=>n(e).render(e,u)))))).then((()=>r(u))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),J(n)):t(i,(()=>i(n)))||o(n),e.add(n),n))))(cn,Wt,Ht,zs,Qn,Y,fn,mn),Qs=(((e,t,n,s,r)=>{})(Wt,Ke,Zs,rs,Ys),((e,t,n,s,r)=>class extends e{constructor(e,n,r){let i;if("number"==typeof e&&void 0!==n&&void 0!==r)i={length:n,numberOfChannels:e,sampleRate:r};else{if("object"!=typeof e)throw new Error("The given parameters are not valid.");i=e}const{length:a,numberOfChannels:o,sampleRate:l}={...bt,...i},u=s(o,a,l);t(Je,(()=>Je(u)))||u.addEventListener("statechange",(()=>{let e=0;const t=n=>{"running"===this._state&&(e>0?(u.removeEventListener("statechange",t),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):e+=1)};return t})()),super(u,o),this._length=a,this._nativeOfflineAudioContext=u,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(n()):(this._state="running",r(this.destination,this._nativeOfflineAudioContext).finally((()=>{this._state=null,le(this)})))}_waitForThePromiseToSettle(e){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(e):setTimeout((()=>this._waitForThePromiseToSettle(e)))}})(Ns,Wt,Ke,Zs,Ys)),Js=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,nn),er=((e,t)=>n=>e.has(n)||t(n))(I,sn),tr=((e,t)=>n=>e.has(n)||t(n))(N,rn),nr=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,Qt),sr=()=>(async(e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m)=>{if(e(t,t)&&e(n,n)&&e(r,r)&&e(i,i)&&e(o,o)&&e(l,l)&&e(u,u)&&e(c,c)&&e(h,h)&&e(d,d)&&e(p,p))return(await Promise.all([e(s,s),e(a,a),e(f,f),e(m,m)])).every((e=>e));return!1})(Wt,(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createBuffer(1,1,44100);if(void 0===t.copyToChannel)return!0;const n=new Float32Array(2);try{t.copyFromChannel(n,0,0)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;if(void 0!==e.prototype&&void 0!==e.prototype.close)return!0;const t=new e,n=void 0!==t.close;try{t.close()}catch{}return n})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);return new Promise((e=>{let n=!0;const s=s=>{n&&(n=!1,t.startRendering(),e(s instanceof TypeError))};let r;try{r=t.decodeAudioData(null,(()=>{}),s)}catch(e){s(e)}void 0!==r&&r.catch(s)}))})(Yt),(e=>()=>{if(null===e)return!1;let t;try{t=new e({latencyHint:"balanced"})}catch{return!1}return t.close(),!0})(tn),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createGain(),n=t.connect(t)===t;return t.disconnect(t),n})(Yt),((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new MessageChannel,r=new t(1,128,44100),i=URL.createObjectURL(n);let a=!1;try{await r.audioWorklet.addModule(i);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();await new Promise((e=>{t.port.onmessage=()=>e(),t.port.postMessage(s.port2,[s.port2])})),t.port.onmessage=()=>a=!0,n.connect(t),n.start(0),await r.startRendering(),a=await new Promise((e=>{s.port1.onmessage=({data:t})=>e(1===t),s.port1.postMessage(0)}))}catch{}finally{s.port1.close(),URL.revokeObjectURL(i)}return a})(an,Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createChannelMerger();if("max"===t.channelCountMode)return!0;try{t.channelCount=2}catch{return!0}return!1})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100);return void 0===t.createConstantSource||t.createConstantSource().offset.maxValue!==Number.POSITIVE_INFINITY})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100),n=t.createConvolver();n.buffer=t.createBuffer(1,1,t.sampleRate);try{n.buffer=t.createBuffer(1,1,t.sampleRate)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createConvolver();try{t.channelCount=1}catch{return!1}return!0})(Yt),Rt,(e=>()=>null!==e&&e.hasOwnProperty("isSecureContext"))(qt),(e=>()=>{if(null===e)return!1;const t=new e;try{return t.createMediaStreamSource(new MediaStream),!1}catch(e){return!0}finally{t.close()}})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);if(void 0===t.createStereoPanner)return Promise.resolve(!0);if(void 0===t.createConstantSource)return Promise.resolve(!0);const n=t.createConstantSource(),s=t.createStereoPanner();return n.channelCount=1,n.offset.value=1,s.channelCount=1,n.start(),n.connect(s).connect(t.destination),t.startRendering().then((e=>1!==e.getChannelData(0)[0]))})(Yt),Dt);function rr(e,t){if(!e)throw new Error(t)}function ir(e,t,n=1/0){if(!(t<=e&&e<=n))throw new RangeError(`Value must be within [${t}, ${n}], got: ${e}`)}function ar(e){e.isOffline||"running"===e.state||cr('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let or=console;function lr(e){or=e}function ur(...e){or.log(...e)}function cr(...e){or.warn(...e)}function hr(e){return void 0===e}function dr(e){return!hr(e)}function pr(e){return"function"==typeof e}function fr(e){return"number"==typeof e}function mr(e){return"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object}function gr(e){return"boolean"==typeof e}function yr(e){return Array.isArray(e)}function br(e){return"string"==typeof e}function wr(e){return br(e)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(e)}const vr="object"==typeof self?self:null,Ar=vr&&(vr.hasOwnProperty("AudioContext")||vr.hasOwnProperty("webkitAudioContext"));function xr(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function Cr(e,t,n,s){return new(n||(n=Promise))((function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;class kr{constructor(e,t,n){this._callback=e,this._type=t,this._updateInterval=n,this._createClock()}_createWorker(){const e=new Blob([`\n\t\t\t// the initial timeout time\n\t\t\tlet timeoutTime = ${(1e3*this._updateInterval).toFixed(1)};\n\t\t\t// onmessage callback\n\t\t\tself.onmessage = function(msg){\n\t\t\t\ttimeoutTime = parseInt(msg.data);\n\t\t\t};\n\t\t\t// the tick function which posts a message\n\t\t\t// and schedules a new tick\n\t\t\tfunction tick(){\n\t\t\t\tsetTimeout(tick, timeoutTime);\n\t\t\t\tself.postMessage('tick');\n\t\t\t}\n\t\t\t// call tick initially\n\t\t\ttick();\n\t\t\t`],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);n.onmessage=this._callback.bind(this),this._worker=n}_createTimeout(){this._timeout=setTimeout((()=>{this._createTimeout(),this._callback()}),1e3*this._updateInterval)}_createClock(){if("worker"===this._type)try{this._createWorker()}catch(e){this._type="timeout",this._createClock()}else"timeout"===this._type&&this._createTimeout()}_disposeClock(){this._timeout&&(clearTimeout(this._timeout),this._timeout=0),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){this._updateInterval=Math.max(e,128/44100),"worker"===this._type&&this._worker.postMessage(Math.max(1e3*e,1))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}}function Sr(e){return tr(e)}function _r(e){return er(e)}function Er(e){return nr(e)}function Ir(e){return Js(e)}function Tr(e){return e instanceof AudioBuffer}function Nr(e,t){return"value"===e||Sr(t)||_r(t)||Tr(t)}function Or(e,...t){if(!t.length)return e;const n=t.shift();if(mr(e)&&mr(n))for(const t in n)Nr(t,n[t])?e[t]=n[t]:mr(n[t])?(e[t]||Object.assign(e,{[t]:{}}),Or(e[t],n[t])):Object.assign(e,{[t]:n[t]});return Or(e,...t)}function Rr(e,t,n=[],s){const r={},i=Array.from(t);if(mr(i[0])&&s&&!Reflect.has(i[0],s)){Object.keys(i[0]).some((t=>Reflect.has(e,t)))||(Or(r,{[s]:i[0]}),n.splice(n.indexOf(s),1),i.shift())}if(1===i.length&&mr(i[0]))Or(r,i[0]);else for(let e=0;e{Reflect.has(e,t)&&delete e[t]})),e}class Fr{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||vr&&this.toString()===vr.TONE_DEBUG_CLASS)&&ur(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Fr.version=i;const Br=1e-6;function zr(e,t){return e>t+Br}function Lr(e,t){return zr(e,t)||Vr(e,t)}function Pr(e,t){return e+Brthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(e){const t=this._timeline.indexOf(e);return-1!==t&&this._timeline.splice(t,1),this}get(e,t="time"){const n=this._search(e,t);return-1!==n?this._timeline[n]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t="time"){const n=this._search(e,t);return n+10&&this._timeline[t-1].time=0?this._timeline[n-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(Vr(this._timeline[t].time,e)){for(let n=t;n>=0&&Vr(this._timeline[n].time,e);n--)t=n;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else 1===this._timeline.length&&Lr(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){const t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){const t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t="time"){if(0===this._timeline.length)return-1;let n=0;const s=this._timeline.length;let r=s;if(s>0&&this._timeline[s-1][t]<=e)return s-1;for(;n=0&&this._timeline[n].time>=e;)n--;return this._iterate(t,n+1),this}forEachAtTime(e,t){const n=this._search(e);if(-1!==n&&Vr(this._timeline[n].time,e)){let s=n;for(let t=n;t>=0&&Vr(this._timeline[t].time,e);t--)s=t;this._iterate((e=>{t(e)}),s,n)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Ur=[];function qr(e){Ur.push(e)}const jr=[];function Hr(e){jr.push(e)}class $r extends Fr{constructor(){super(...arguments),this.name="Emitter"}on(e,t){return e.split(/\W+/).forEach((e=>{hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e)||(this._events[e]=[]),this._events[e].push(t)})),this}once(e,t){const n=(...s)=>{t(...s),this.off(e,n)};return this.on(e,n),this}off(e,t){return e.split(/\W+/).forEach((n=>{if(hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e))if(hr(t))this._events[e]=[];else{const n=this._events[e];for(let e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1)}})),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){const n=this._events[e].slice(0);for(let e=0,s=n.length;e{const n=Object.getOwnPropertyDescriptor($r.prototype,t);Object.defineProperty(e.prototype,t,n)}))}dispose(){return super.dispose(),this._events=void 0,this}}class Kr extends $r{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}class Xr extends Kr{constructor(){super(),this.name="Context",this._constants=new Map,this._timeouts=new Gr,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;const e=Rr(Xr.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=function(e){return new Bs(e)}({latencyHint:e.latencyHint}),this._ticker=new kr(this.emit.bind(this,"tick"),e.clockSource,e.updateInterval),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this._setLatencyHint(e.latencyHint),this.lookAhead=e.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){var e;return this._initialized||(e=this,Ur.forEach((t=>t(e))),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,t,n){return this._context.createBuffer(e,t,n)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,n){return this._context.createPeriodicWave(e,t,n)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamSource(e)}createMediaElementSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaElementSource(e)}createMediaStreamDestination(){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){rr(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){rr(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){rr(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){rr(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,t){return function(e,t,n){return rr(dr(Xs),"This node only works in a secure context (https or localhost)"),new Xs(e,t,n)}(this.rawContext,e,t)}addAudioWorkletModule(e,t){return Cr(this,void 0,void 0,(function*(){rr(dr(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(t)||this._workletModules.set(t,this.rawContext.audioWorklet.addModule(e)),yield this._workletModules.get(t)}))}workletsAreReady(){return Cr(this,void 0,void 0,(function*(){const e=[];this._workletModules.forEach((t=>e.push(t))),yield Promise.all(e)}))}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get latencyHint(){return this._latencyHint}_setLatencyHint(e){let t=0;if(this._latencyHint=e,br(e))switch(e){case"interactive":t=.1;break;case"playback":t=.5;break;case"balanced":t=.25}this.lookAhead=t,this.updateInterval=t/2}get rawContext(){return this._context}now(){return this._context.currentTime+this.lookAhead}immediate(){return this._context.currentTime}resume(){return Ir(this._context)?this._context.resume():Promise.resolve()}close(){return Cr(this,void 0,void 0,(function*(){var e;Ir(this._context)&&(yield this._context.close()),this._initialized&&(e=this,jr.forEach((t=>t(e))))}))}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),n=t.getChannelData(0);for(let t=0;tthis._constants[e].disconnect())),this}_timeoutLoop(){const e=this.now();let t=this._timeouts.peek();for(;this._timeouts.length&&t&&t.time<=e;)t.callback(),this._timeouts.shift(),t=this._timeouts.peek()}setTimeout(e,t){this._timeoutIds++;const n=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:n+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach((t=>{t.id===e&&this._timeouts.remove(t)})),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){const n=++this._timeoutIds,s=()=>{const r=this.now();this._timeouts.add({callback:()=>{e(),s()},id:n,time:r+t})};return s(),n}}function Zr(e,t){yr(t)?t.forEach((t=>Zr(e,t))):Object.defineProperty(e,t,{enumerable:!0,writable:!1})}function Yr(e,t){yr(t)?t.forEach((t=>Yr(e,t))):Object.defineProperty(e,t,{writable:!0})}const Qr=()=>{};class Jr extends Fr{constructor(){super(),this.name="ToneAudioBuffer",this.onload=Qr;const e=Rr(Jr.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,e.url&&Tr(e.url)||e.url instanceof Jr?this.set(e.url):br(e.url)&&this.load(e.url).catch(e.onerror)}static getDefaults(){return{onerror:Qr,onload:Qr,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:si().sampleRate}set(e){return e instanceof Jr?e.loaded?this._buffer=e.get():e.onload=()=>{this.set(e),this.onload(this)}:this._buffer=e,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return Cr(this,void 0,void 0,(function*(){const t=Jr.load(e).then((e=>{this.set(e),this.onload(this)}));Jr.downloads.push(t);try{yield t}finally{const e=Jr.downloads.indexOf(t);Jr.downloads.splice(e,1)}return this}))}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){const t=yr(e)&&e[0].length>0,n=t?e.length:1,s=t?e[0].length:e.length,r=si(),i=r.createBuffer(n,s,r.sampleRate),a=t||1!==n?e:[e];for(let e=0;ee/t)),this.fromArray(e)}return this}toArray(e){if(fr(e))return this.getChannelData(e);if(1===this.numberOfChannels)return this.toArray(0);{const e=[];for(let t=0;t0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(e){return(new Jr).fromArray(e)}static fromUrl(e){return Cr(this,void 0,void 0,(function*(){const t=new Jr;return yield t.load(e)}))}static load(e){return Cr(this,void 0,void 0,(function*(){const t=e.match(/\[([^\]\[]+\|.+)\]$/);if(t){const n=t[1].split("|");let s=n[0];for(const e of n)if(Jr.supportsType(e)){s=e;break}e=e.replace(t[0],s)}const n=""===Jr.baseUrl||Jr.baseUrl.endsWith("/")?Jr.baseUrl:Jr.baseUrl+"/",s=yield fetch(n+e);if(!s.ok)throw new Error(`could not load url: ${e}`);const r=yield s.arrayBuffer();return yield si().decodeAudioData(r)}))}static supportsType(e){const t=e.split("."),n=t[t.length-1];return""!==document.createElement("audio").canPlayType("audio/"+n)}static loaded(){return Cr(this,void 0,void 0,(function*(){for(yield Promise.resolve();Jr.downloads.length;)yield Jr.downloads[0]}))}}Jr.baseUrl="",Jr.downloads=[];class ei extends Xr{constructor(){var e,t,n;super({clockSource:"offline",context:Er(arguments[0])?arguments[0]:(e=arguments[0],t=arguments[1]*arguments[2],n=arguments[2],new Qs(e,t,n)),lookAhead:0,updateInterval:Er(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Er(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return Cr(this,void 0,void 0,(function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,t++;const n=Math.floor(this.sampleRate/128);e&&t%n==0&&(yield new Promise((e=>setTimeout(e,1))))}}))}render(e=!0){return Cr(this,void 0,void 0,(function*(){yield this.workletsAreReady(),yield this._renderClock(e);const t=yield this._context.startRendering();return new Jr(t)}))}close(){return Promise.resolve()}}const ti=new class extends Kr{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,n){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,n){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e,t){return Cr(this,void 0,void 0,(function*(){return Promise.resolve()}))}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}};let ni=ti;function si(){return ni===ti&&Ar&&ri(new Xr),ni}function ri(e){ni=Ir(e)?new Xr(e):Er(e)?new ei(e):e}function ii(){return ni.resume()}if(vr&&!vr.TONE_SILENCE_LOGGING){let e="v";"dev"===i&&(e="")}function ai(e){return Math.pow(10,e/20)}function oi(e){return Math.log(e)/Math.LN10*20}function li(e){return Math.pow(2,e/12)}let ui=440;function ci(e){return Math.round(hi(e))}function hi(e){return 69+12*Math.log2(e/ui)}function di(e){return ui*Math.pow(2,(e-69)/12)}class pi extends Fr{constructor(e,t,n){super(),this.defaultUnits="s",this._val=t,this._units=n,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{const n=parseInt(e,10),s="."===t?1.5:1;return 1===n?this._beatsToUnits(this._getTimeSignature())*s:this._beatsToUnits(4/n)*s},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{const t=parseInt(e,10);return this._beatsToUnits(8/(3*Math.floor(t)))},regexp:/^(\d+)t$/i},tr:{method:(e,t,n)=>{let s=0;return e&&"0"!==e&&(s+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s+=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s+=this._beatsToUnits(parseFloat(n)/4)),s},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof pi&&this.fromType(this._val),hr(this._val))return this._noArg();if(br(this._val)&&hr(this._units)){for(const e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(mr(this._val)){let e=0;for(const t in this._val)if(dr(this._val[t])){const n=this._val[t];e+=new this.constructor(this.context,t).valueOf()*n}return e}if(dr(this._units)){const e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}return br(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi()}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return 1e3*this.toSeconds()}}class fi extends pi{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{const t=new fi(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(e,t=1){const n=new this.constructor(this.context,e).valueOf(),s=this.valueOf();return s+(Math.round(s/n)*n-s)*t}toNotation(){const e=this.toSeconds(),t=["1m"];for(let e=1;e<9;e++){const n=Math.pow(2,e);t.push(n+"n."),t.push(n+"n"),t.push(n+"t")}t.push("0");let n=t[0],s=new fi(this.context,t[0]).toSeconds();return t.forEach((t=>{const r=new fi(this.context,t).toSeconds();Math.abs(r-e)3&&(s=parseFloat(parseFloat(r).toFixed(3)));return[n,t,s].join(":")}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.round(t*this._getPPQ())}toSeconds(){return this.valueOf()}toMidi(){return ci(this.toFrequency())}_now(){return this.context.now()}}function mi(e,t){return new fi(si(),e,t)}class gi extends fi{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return ui}static set A4(e){!function(e){ui=e}(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return"midi"===this.defaultUnits?e:gi.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(e,t){const n=yi[e.toLowerCase()]+12*(parseInt(t,10)+1);return"midi"===this.defaultUnits?n:gi.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,n){let s=1;return e&&"0"!==e&&(s*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s*=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s*=this._beatsToUnits(parseFloat(n)/4)),s}}})}transpose(e){return new gi(this.context,this.valueOf()*li(e))}harmonize(e){return e.map((e=>this.transpose(e)))}toMidi(){return ci(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/gi.A4);let n=Math.round(12*t)+57;const s=Math.floor(n/12);s<0&&(n+=-12*s);return bi[n%12]+s.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(60*e/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return di(e)}static ftom(e){return ci(e)}}const yi={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},bi=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function wi(e,t){return new gi(si(),e,t)}class vi extends fi{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}function Ai(e,t){return new vi(si(),e,t)}class xi extends Fr{constructor(){super();const e=Rr(xi.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:si()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return new fi(this.context,e).toSeconds()}toFrequency(e){return new gi(this.context,e).toFrequency()}toTicks(e){return new vi(this.context,e).toTicks()}_getPartialProperties(e){const t=this.get();return Object.keys(t).forEach((n=>{hr(e[n])&&delete t[n]})),t}get(){const e=this.constructor.getDefaults();return Object.keys(e).forEach((t=>{if(Reflect.has(this,t)){const n=this[t];dr(n)&&dr(n.value)&&dr(n.setValueAtTime)?e[t]=n.value:n instanceof xi?e[t]=n._getPartialProperties(e[t]):yr(n)||fr(n)||br(n)||gr(n)?e[t]=n:delete e[t]}})),e}set(e){return Object.keys(e).forEach((t=>{Reflect.has(this,t)&&dr(this[t])&&(this[t]&&dr(this[t].value)&&dr(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof xi?this[t].set(e[t]):this[t]=e[t])})),this}}class Ci extends Gr{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){const t=this.get(e);return null!==t?t.state:this._initial}setStateAtTime(e,t,n){return ir(t,0),this.add(Object.assign({},n,{state:e,time:t})),this}getLastState(e,t){for(let n=this._search(t);n>=0;n--){const t=this._timeline[n];if(t.state===e)return t}}getNextState(e,t){const n=this._search(t);if(-1!==n)for(let t=n;t0,"timeConstant must be a number greater than 0");const r=this.toSeconds(t);return this._assertRange(s),rr(isFinite(s)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:n,time:r,type:"setTargetAtTime",value:s}),this.log(this.units,"setTargetAtTime",e,r,n),this._param.setTargetAtTime(s,r,n),this}setValueCurveAtTime(e,t,n,s=1){n=this.toSeconds(n),t=this.toSeconds(t);const r=this._fromType(e[0])*s;this.setValueAtTime(this._toType(r),t);const i=n/(e.length-1);for(let n=1;n{"cancelScheduledValues"===t.type?e.cancelScheduledValues(t.time):"setTargetAtTime"===t.type?e.setTargetAtTime(t.value,t.time,t.constant):e[t.type](t.value,t.time)})),this}setParam(e){rr(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,n,s,r){return n+(t-n)*Math.exp(-(r-e)/s)}_linearInterpolate(e,t,n,s,r){return t+(r-e)/(n-e)*(s-t)}_exponentialInterpolate(e,t,n,s,r){return t*Math.pow(s/t,(r-e)/(n-e))}}class Si extends xi{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return dr(this.input)?Sr(this.input)||this.input instanceof ki?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dr(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return dr(e)&&(e instanceof Si||_r(e))}_getInternalNodes(){const e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach((t=>{t.channelCount=e.channelCount,t.channelCountMode=e.channelCountMode,t.channelInterpretation=e.channelInterpretation}))}_getChannelProperties(){const e=this._getInternalNodes();rr(e.length>0,"ToneAudioNode does not have any internal nodes");const t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,n=0){return Ei(this,e,t,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return cr("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,n=0){return Ii(this,e,t,n),this}chain(...e){return _i(this,...e),this}fan(...e){return e.forEach((e=>this.connect(e))),this}dispose(){return super.dispose(),dr(this.input)&&(this.input instanceof Si?this.input.dispose():_r(this.input)&&this.input.disconnect()),dr(this.output)&&(this.output instanceof Si?this.output.dispose():_r(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function _i(...e){const t=e.shift();e.reduce(((e,t)=>(e instanceof Si?e.connect(t):_r(e)&&Ei(e,t),t)),t)}function Ei(e,t,n=0,s=0){for(rr(dr(e),"Cannot connect from undefined node"),rr(dr(t),"Cannot connect to undefined node"),(t instanceof Si||_r(t))&&rr(t.numberOfInputs>0,"Cannot connect to node with no inputs"),rr(e.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof Si||t instanceof ki;)dr(t.input)&&(t=t.input);for(;e instanceof Si;)dr(e.output)&&(e=e.output);Sr(t)?e.connect(t,n):e.connect(t,n,s)}function Ii(e,t,n=0,s=0){if(dr(t))for(;t instanceof Si;)t=t.input;for(;!_r(e);)dr(e.output)&&(e=e.output);Sr(t)?e.disconnect(t,n):_r(t)?e.disconnect(t,n,s):e.disconnect()}class Ti extends Si{constructor(){super(Rr(Ti.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=Rr(Ti.getDefaults(),arguments,["gain","units"]);this.gain=new ki({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),Zr(this,"gain")}static getDefaults(){return Object.assign(Si.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class Ni extends Si{constructor(e){super(e),this.onended=Qr,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new Ti({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const t=this.toSeconds(e);return-1!==this._startTime&&t>=this._startTime&&(-1===this._stopTime||t<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign(Si.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Qr})}_startGain(e,t=1){rr(-1===this._startTime,"Source cannot be started more than once");const n=this.toSeconds(this._fadeIn);return this._startTime=e+n,this._startTime=Math.max(this._startTime,this.context.currentTime),n>0?(this._gainNode.gain.setValueAtTime(0,e),"linear"===this._curve?this._gainNode.gain.linearRampToValueAtTime(t,e+n):this._gainNode.gain.exponentialApproachValueAtTime(t,e,n)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){rr(-1!==this._startTime,"'start' must be called before 'stop'"),this.cancelStop();const t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.context.currentTime),t>0?"linear"===this._curve?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout((()=>{const e="exponential"===this._curve?2*t:0;this._stopSource(this.now()+e),this._onended()}),this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==Qr&&(this.onended(this),this.onended=Qr,!this.context.isOffline)){const e=()=>this.dispose();void 0!==window.requestIdleCallback?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),rr(-1!==this._startTime,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.disconnect(),this}}class Oi extends Ni{constructor(){super(Rr(Oi.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=Rr(Oi.getDefaults(),arguments,["offset"]);Ei(this._source,this._gainNode),this.offset=new ki({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(Ni.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ri extends Si{constructor(){super(Rr(Ri.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=Rr(Ri.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Oi({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(Si.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,n=0){return Di(this,e,t,n),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,n){return this._param.exponentialRampTo(e,t,n),this}linearRampTo(e,t,n){return this._param.linearRampTo(e,t,n),this}targetRampTo(e,t,n){return this._param.targetRampTo(e,t,n),this}exponentialApproachValueAtTime(e,t,n){return this._param.exponentialApproachValueAtTime(e,t,n),this}setTargetAtTime(e,t,n){return this._param.setTargetAtTime(e,t,n),this}setValueCurveAtTime(e,t,n,s){return this._param.setValueCurveAtTime(e,t,n,s),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,n){return this._param.rampTo(e,t,n),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}}function Di(e,t,n,s){(t instanceof ki||Sr(t)||t instanceof Ri&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ri&&(t.overridden=!0)),Ei(e,t,n,s)}class Mi extends ki{constructor(){super(Rr(Mi.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Gr(1/0),this._multiplier=1;const e=Rr(Mi.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(ki.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,t,n){t=this.toSeconds(t),this.setRampPoint(t);const s=this._fromType(e),r=this._events.get(t),i=Math.round(Math.max(1/n,1));for(let e=0;e<=i;e++){const i=n*e+t,a=this._exponentialApproach(r.time,r.value,s,n,i);this.linearRampToValueAtTime(this._toType(a),i)}return this}setValueAtTime(e,t){const n=this.toSeconds(t);super.setValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,0),this}linearRampToValueAtTime(e,t){const n=this.toSeconds(t);super.linearRampToValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);const n=this._fromType(e),s=this._events.get(t),r=Math.round(Math.max(10*(t-s.time),1)),i=(t-s.time)/r;for(let e=0;e<=r;e++){const r=i*e+s.time,a=this._exponentialInterpolate(s.time,s.value,t,n,r);this.linearRampToValueAtTime(this._toType(a),r)}return this}_getTicksUntilEvent(e,t){if(null===e)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(hr(e.ticks)){const t=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(t,e.time)}const n=this._fromType(this.getValueAtTime(e.time));let s=this._fromType(this.getValueAtTime(t));const r=this._events.get(t);return r&&r.time===t&&"setValueAtTime"===r.type&&(s=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(n+s)+e.ticks}getTicksAtTime(e){const t=this.toSeconds(e),n=this._events.get(t);return Math.max(this._getTicksUntilEvent(n,t),0)}getDurationOfTicks(e,t){const n=this.toSeconds(t),s=this.getTicksAtTime(t);return this.getTimeOfTick(s+e)-n}getTimeOfTick(e){const t=this._events.get(e,"ticks"),n=this._events.getAfter(e,"ticks");if(t&&t.ticks===e)return t.time;if(t&&n&&"linearRampToValueAtTime"===n.type&&t.value!==n.value){const s=this._fromType(this.getValueAtTime(t.time)),r=(this._fromType(this.getValueAtTime(n.time))-s)/(n.time-t.time),i=Math.sqrt(Math.pow(s,2)-2*r*(t.ticks-e)),a=(-s+i)/r;return(a>0?a:(-s-i)/r)+t.time}return t?0===t.value?1/0:t.time+(e-t.ticks)/t.value:e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){const n=this.toSeconds(t),s=this.toSeconds(e),r=this.getTicksAtTime(n);return this.getTicksAtTime(n+s)-r}_fromType(e){return"bpm"===this.units&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return"bpm"===this.units&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){const t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}}class Fi extends Ri{constructor(){super(Rr(Fi.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=Rr(Fi.getDefaults(),arguments,["value"]);this.input=this._param=new Mi({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(Ri.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}}class Bi extends xi{constructor(){super(Rr(Bi.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new Ci,this._tickOffset=new Gr;const e=Rr(Bi.getDefaults(),arguments,["frequency"]);this.frequency=new Fi({context:this.context,units:e.units,value:e.frequency}),Zr(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},xi.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){const n=this.toSeconds(e);return"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),dr(t)&&this.setTicksAtTime(t,n)),this}stop(e){const t=this.toSeconds(e);if("stopped"===this._state.getValueAtTime(t)){const e=this._state.get(t);e&&e.time>0&&(this._tickOffset.cancel(e.time),this._state.cancel(e.time))}return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this.setTicksAtTime(0,t),this}pause(e){const t=this.toSeconds(e);return"started"===this._state.getValueAtTime(t)&&this._state.setStateAtTime("paused",t),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this}getTicksAtTime(e){const t=this.toSeconds(e),n=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);let r=n,i=0;return this._state.forEachBetween(n.time,t+this.sampleTime,(e=>{let t=r.time;const n=this._tickOffset.get(e.time);n&&n.time>=r.time&&(i=n.ticks,t=n.time),"started"===r.state&&"started"!==e.state&&(i+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(t)),r=e})),this._state.remove(s),i}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){const t=this.now(),n=this.frequency.timeToTicks(e,t);this.setTicksAtTime(n,t)}getSecondsAtTime(e){e=this.toSeconds(e);const t=this._state.getLastState("stopped",e),n={state:"paused",time:e};this._state.add(n);let s=t,r=0;return this._state.forEachBetween(t.time,e+this.sampleTime,(e=>{let t=s.time;const n=this._tickOffset.get(e.time);n&&n.time>=s.time&&(r=n.seconds,t=n.time),"started"===s.state&&"started"!==e.state&&(r+=e.time-t),s=e})),this._state.remove(n),r}setTicksAtTime(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){const n=this._tickOffset.get(t),s=this._state.get(t),r=Math.max(n.time,s.time),i=this.frequency.getTicksAtTime(r)+e-n.ticks;return this.frequency.getTimeOfTick(i)}forEachTickBetween(e,t,n){let s=this._state.get(e);this._state.forEachBetween(e,t,(t=>{s&&"started"===s.state&&"started"!==t.state&&this.forEachTickBetween(Math.max(s.time,e),t.time-this.sampleTime,n),s=t}));let r=null;if(s&&"started"===s.state){const i=Math.max(s.time,e),a=this.frequency.getTicksAtTime(i),o=a-this.frequency.getTicksAtTime(s.time);let l=Math.ceil(o)-o;l=Vr(l,1)?0:l;let u=this.frequency.getTimeOfTick(a+l);for(;u{switch(e.state){case"started":const t=this._tickSource.getTicksAtTime(e.time);this.emit("start",e.time,t);break;case"stopped":0!==e.time&&this.emit("stop",e.time);break;case"paused":this.emit("pause",e.time)}})),this._tickSource.forEachTickBetween(e,t,((e,t)=>{this.callback(e,t)})))}getStateAtTime(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}$r.mixin(zi);class Li extends Si{constructor(){super(Rr(Li.getDefaults(),arguments,["delayTime","maxDelay"])),this.name="Delay";const e=Rr(Li.getDefaults(),arguments,["delayTime","maxDelay"]),t=this.toSeconds(e.maxDelay);this._maxDelay=Math.max(t,this.toSeconds(e.delayTime)),this._delayNode=this.input=this.output=this.context.createDelay(t),this.delayTime=new ki({context:this.context,param:this._delayNode.delayTime,units:"time",value:e.delayTime,minValue:0,maxValue:this.maxDelay}),Zr(this,"delayTime")}static getDefaults(){return Object.assign(Si.getDefaults(),{delayTime:0,maxDelay:1})}get maxDelay(){return this._maxDelay}dispose(){return super.dispose(),this._delayNode.disconnect(),this.delayTime.dispose(),this}}function Pi(e,t,n=2,s=si().sampleRate){return Cr(this,void 0,void 0,(function*(){const r=si(),i=new ei(n,t,s);ri(i),yield e(i);const a=i.render();ri(r);const o=yield a;return new Jr(o)}))}class Vi extends Fr{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=Rr(Vi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach((t=>{this._loadingCount++;const n=e.urls[t];this.add(t,n,this._bufferLoaded.bind(this,e.onload),e.onerror)}))}static getDefaults(){return{baseUrl:"",onerror:Qr,onload:Qr,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return rr(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,0===this._loadingCount&&e&&e()}get loaded(){return Array.from(this._buffers).every((([e,t])=>t.loaded))}add(e,t,n=Qr,s=Qr){return br(t)?this._buffers.set(e.toString(),new Jr(this.baseUrl+t,n,s)):this._buffers.set(e.toString(),new Jr(t,n,s)),this}dispose(){return super.dispose(),this._buffers.forEach((e=>e.dispose())),this._buffers.clear(),this}}class Wi extends gi{constructor(){super(...arguments),this.name="MidiClass",this.defaultUnits="midi"}_frequencyToUnits(e){return ci(super._frequencyToUnits(e))}_ticksToUnits(e){return ci(super._ticksToUnits(e))}_beatsToUnits(e){return ci(super._beatsToUnits(e))}_secondsToUnits(e){return ci(super._secondsToUnits(e))}toMidi(){return this.valueOf()}toFrequency(){return di(this.toMidi())}transpose(e){return new Wi(this.context,this.toMidi()+e)}}function Gi(e,t){return new Wi(si(),e,t)}class Ui extends vi{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}function qi(e,t){return new Ui(si(),e,t)}class ji extends xi{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Gr,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),1===this._events.length&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){const e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){const t=this._events.shift();t&&e-t.time<=this.expiration&&t.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}qr((e=>{e.draw=new ji({context:e})})),Hr((e=>{e.draw.dispose()}));class Hi extends Fr{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){rr(dr(e.time),"Events must have a time property"),rr(dr(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let t=new $i(e.time,e.time+e.duration,e);for(null===this._root?this._root=t:this._root.insert(t),this._length++;null!==t;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(null!==this._root){const t=[];this._root.search(e.time,t);for(const n of t)if(n.event===e){this._removeNode(n),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,(e=>this.remove(e))),this}_setRoot(e){this._root=e,null!==this._root&&(this._root.parent=null)}_replaceNodeInParent(e,t){null!==e.parent?(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent)):this._setRoot(t)}_removeNode(e){if(null===e.left&&null===e.right)this._replaceNodeInParent(e,null);else if(null===e.right)this._replaceNodeInParent(e,e.left);else if(null===e.left)this._replaceNodeInParent(e,e.right);else{let t,n=null;if(e.getBalance()>0)if(null===e.left.right)t=e.left,t.right=e.right,n=t;else{for(t=e.left.right;null!==t.right;)t=t.right;t.parent&&(t.parent.right=t.left,n=t.parent,t.left=e.left,t.right=e.right)}else if(null===e.right.left)t=e.right,t.left=e.left,n=t;else{for(t=e.right.left;null!==t.left;)t=t.left;t.parent&&(t.parent.left=t.right,n=t.parent,t.left=e.left,t.right=e.right)}null!==e.parent?e.isLeftChild()?e.parent.left=t:e.parent.right=t:this._setRoot(t),n&&this._rebalance(n)}e.dispose()}_rotateLeft(e){const t=e.parent,n=e.isLeftChild(),s=e.right;s&&(e.right=s.left,s.left=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rotateRight(e){const t=e.parent,n=e.isLeftChild(),s=e.left;s&&(e.left=s.right,s.right=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rebalance(e){const t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(null!==this._root){const t=[];if(this._root.search(e,t),t.length>0){let e=t[0];for(let n=1;ne.low&&(e=t[n]);return e.event}}return null}forEach(e){if(null!==this._root){const t=[];this._root.traverse((e=>t.push(e))),t.forEach((t=>{t.event&&e(t.event)}))}return this}forEachAtTime(e,t){if(null!==this._root){const n=[];this._root.search(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}forEachFrom(e,t){if(null!==this._root){const n=[];this._root.searchAfter(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}dispose(){return super.dispose(),null!==this._root&&this._root.traverse((e=>e.dispose())),this._root=null,this}}class $i{constructor(e,t,n){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=n,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?null===this.left?this.left=e:this.left.insert(e):null===this.right?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(null!==this.left&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),this.low>e||null!==this.right&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),null!==this.left&&this.left.searchAfter(e,t)),null!==this.right&&this.right.searchAfter(e,t)}traverse(e){e(this),null!==this.left&&this.left.traverse(e),null!==this.right&&this.right.traverse(e)}updateHeight(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return null!==this.left&&null!==this.right?e=this.left.height-this.right.height:null!==this.left?e=this.left.height+1:null!==this.right&&(e=-(this.right.height+1)),e}isLeftChild(){return null!==this.parent&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Ki extends Si{constructor(){super(Rr(Ki.getDefaults(),arguments,["volume"])),this.name="Volume";const e=Rr(Ki.getDefaults(),arguments,["volume"]);this.input=this.output=new Ti({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,Zr(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}class Xi extends Si{constructor(){super(Rr(Xi.getDefaults(),arguments)),this.name="Destination",this.input=new Ki({context:this.context}),this.output=new Ti({context:this.context}),this.volume=this.input.volume;const e=Rr(Xi.getDefaults(),arguments);_i(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),_i(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}qr((e=>{e.destination=new Xi({context:e})})),Hr((e=>{e.destination.dispose()}));class Zi extends Fr{constructor(e){super(),this.name="TimelineValue",this._timeline=new Gr({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){const t=this._timeline.get(e);return t?t.value:this._initialValue}}class Yi{constructor(e,t){this.id=Yi._eventId++;const n=Object.assign(Yi.getDefaults(),t);this.transport=e,this.callback=n.callback,this._once=n.once,this.time=n.time}static getDefaults(){return{callback:Qr,once:!1,time:0}}invoke(e){this.callback&&(this.callback(e),this._once&&this.transport.clear(this.id))}dispose(){return this.callback=void 0,this}}Yi._eventId=0;class Qi extends Yi{constructor(e,t){super(e,t),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const n=Object.assign(Qi.getDefaults(),t);this.duration=new Ui(e.context,n.duration).valueOf(),this._interval=new Ui(e.context,n.interval).valueOf(),this._nextTick=n.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Yi.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvents(e){const t=this.transport.getTicksAtTime(e);t>=this.time&&t>=this._nextTick&&this._nextTick+this._intervalthis.time&&(this._nextTick=this.time+Math.ceil((t-this.time)/this._interval)*this._interval),this._currentId=this.transport.scheduleOnce(this.invoke.bind(this),new Ui(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Ui(this.context,this._nextTick).toSeconds())}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this}}class Ji extends xi{constructor(){super(Rr(Ji.getDefaults(),arguments)),this.name="Transport",this._loop=new Zi(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Gr,this._repeatedEvents=new Hi,this._syncedSignals=[],this._swingAmount=0;const e=Rr(Ji.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new zi({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),Zr(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(xi.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&t%this._ppq!=0&&t%(2*this._swingTicks)!=0){const n=t%(2*this._swingTicks)/(2*this._swingTicks),s=Math.sin(n*Math.PI)*this._swingAmount;e+=new Ui(this.context,2*this._swingTicks/3).toSeconds()*s}this._timeline.forEachAtTime(t,(t=>t.invoke(e)))}schedule(e,t){const n=new Yi(this,{callback:e,time:new vi(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(e,t,n,s=1/0){const r=new Qi(this,{callback:e,duration:new fi(this.context,s).toTicks(),interval:new fi(this.context,t).toTicks(),time:new vi(this.context,n).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const n=new Yi(this,{callback:e,once:!0,time:new vi(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){const t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){const t=this.toTicks(e);return this._timeline.forEachFrom(t,(e=>this.clear(e.id))),this._repeatedEvents.forEachFrom(t,(e=>this.clear(e.id))),this}_bindClockEvents(){this._clock.on("start",((e,t)=>{t=new Ui(this.context,t).toSeconds(),this.emit("start",e,t)})),this._clock.on("stop",(e=>{this.emit("stop",e)})),this._clock.on("pause",(e=>{this.emit("pause",e)}))}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){let n;return dr(t)&&(n=this.toTicks(t)),this._clock.start(e,n),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),"started"!==this._clock.getStateAtTime(e)?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){yr(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new fi(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new fi(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new Ui(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){const e=this.now(),t=this._clock.getTicksAtTime(e);return new Ui(this.context,t).toBarsBeatsSixteenths()}set position(e){const t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){const t=this.now(),n=this._clock.frequency.timeToTicks(e,t);this.ticks=n}get progress(){if(this.loop){const e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){const t=this.now();if("started"===this.state){const n=this._clock.getTicksAtTime(t),s=t+this._clock.frequency.getDurationOfTicks(Math.ceil(n)-n,t);this.emit("stop",s),this._clock.setTicksAtTime(e,s),this.emit("start",s,this._clock.getSecondsAtTime(s))}else this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return Math.round(this._clock.getTicksAtTime(e))}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),"started"!==this.state)return 0;{const t=this.now(),n=e-this.getTicksAtTime(t)%e;return this._clock.nextTickTime(n,t)}}syncSignal(e,t){if(!t){const n=this.now();if(0!==e.getValueAtTime(n)){const s=1/(60/this.bpm.getValueAtTime(n)/this.PPQ);t=e.getValueAtTime(n)/s}else t=0}const n=new Ti(t);return this.bpm.connect(n),n.connect(e._param),this._syncedSignals.push({initial:e.value,ratio:n,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){const n=this._syncedSignals[t];n.signal===e&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Yr(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}$r.mixin(Ji),qr((e=>{e.transport=new Ji({context:e})})),Hr((e=>{e.transport.dispose()}));class ea extends Si{constructor(e){super(e),this.input=void 0,this._state=new Ci("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=Qr,this._syncedStop=Qr,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Ki({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,onstop:Qr,volume:0})}get state(){return this._synced?"started"===this.context.transport.state?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,n){let s=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(s=this._clampToCurrentTime(s),this._synced||"started"!==this._state.getValueAtTime(s))if(this.log("start",s),this._state.setStateAtTime("started",s),this._synced){const e=this._state.get(s);e&&(e.offset=this.toSeconds(Dr(t,0)),e.duration=n?this.toSeconds(n):void 0);const r=this.context.transport.schedule((e=>{this._start(e,t,n)}),s);this._scheduled.push(r),"started"===this.context.transport.state&&this.context.transport.getSecondsAtTime(this.immediate())>s&&this._syncedStart(this.now(),this.context.transport.seconds)}else ar(this.context),this._start(s,t,n);else rr(zr(s,this._state.get(s).time),"Start time must be strictly greater than previous start time"),this._state.cancel(s),this._state.setStateAtTime("started",s),this.log("restart",s),this.restart(s,t,n);return this}stop(e){let t=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),"started"===this._state.getValueAtTime(t)||dr(this._state.getNextState("started",t))){if(this.log("stop",t),this._synced){const e=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(e)}else this._stop(t);this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(e,t,n){return e=this.toSeconds(e),"started"===this._state.getValueAtTime(e)&&(this._state.cancel(e),this._restart(e,t,n)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(t>0){const n=this._state.get(t);if(n&&"started"===n.state&&n.time!==t){const s=t-this.toSeconds(n.time);let r;n.duration&&(r=this.toSeconds(n.duration)-s),this._start(e,this.toSeconds(n.offset)+s,r)}}},this._syncedStop=e=>{const t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));"started"===this._state.getValueAtTime(t)&&this._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach((e=>this.context.transport.clear(e))),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Qr,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class ta extends Ni{constructor(){super(Rr(ta.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=Rr(ta.getDefaults(),arguments,["url","onload"]);Ei(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new ki({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new Jr(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(Ni.getDefaults(),{url:new Jr,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,n,s=1){rr(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(e);this._startGain(r,s),t=this.loop?Dr(t,this.loopStart):Dr(t,0);let i=Math.max(this.toSeconds(t),0);if(this.loop){const e=this.toSeconds(this.loopEnd)||this.buffer.duration,t=this.toSeconds(this.loopStart),n=e-t;Lr(i,e)&&(i=(i-t)%n+t),Vr(i,this.buffer.duration)&&(i=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Pr(i,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,i)),dr(n)){let e=this.toSeconds(n);e=Math.max(e,0),this.stop(r+e)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class na extends ea{constructor(){super(Rr(na.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=Rr(na.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(rr(e in ia,"Noise: invalid type: "+e),this._type!==e&&(this._type=e,"started"===this.state)){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._source&&(this._source.playbackRate.value=e)}_start(e){const t=ia[this._type];this._source=new ta({url:t,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(e),Math.random()*(t.duration-.001))}_stop(e){this._source&&(this._source.stop(this.toSeconds(e)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(e){this._stop(e),this._start(e)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const sa=220500,ra={brown:null,pink:null,white:null},ia={get brown(){if(!ra.brown){const e=[];for(let t=0;t<2;t++){const n=new Float32Array(sa);e[t]=n;let s=0;for(let e=0;et.label===e||t.deviceId===e)),!this._device&&t.length>0&&(this._device=t[0]),rr(dr(this._device),`No matching device ${e}`));const n={audio:{echoCancellation:!1,sampleRate:this.context.sampleRate,noiseSuppression:!1,mozNoiseSuppression:!1}};this._device&&(n.audio.deviceId=this._device.deviceId);const s=yield navigator.mediaDevices.getUserMedia(n);if(!this._stream){this._stream=s;const e=this.context.createMediaStreamSource(s);Ei(e,this.output),this._mediaStream=e}return this}))}close(){return this._stream&&this._mediaStream&&(this._stream.getAudioTracks().forEach((e=>{e.stop()})),this._stream=void 0,this._mediaStream.disconnect(),this._mediaStream=void 0),this._device=void 0,this}static enumerateDevices(){return Cr(this,void 0,void 0,(function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter((e=>"audioinput"===e.kind))}))}get state(){return this._stream&&this._stream.active?"started":"stopped"}get deviceId(){return this._device?this._device.deviceId:void 0}get groupId(){return this._device?this._device.groupId:void 0}get label(){return this._device?this._device.label:void 0}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this.close(),this._volume.dispose(),this.volume.dispose(),this}static get supported(){return dr(navigator.mediaDevices)&&dr(navigator.mediaDevices.getUserMedia)}}function oa(e,t){return Cr(this,void 0,void 0,(function*(){const n=t/e.context.sampleRate,s=new ei(1,n,e.context.sampleRate);new e.constructor(Object.assign(e.get(),{frequency:2/n,detune:0,context:s})).toDestination().start(0);return(yield s.render()).getChannelData(0)}))}class la extends Ni{constructor(){super(Rr(la.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];const e=Rr(la.getDefaults(),arguments,["frequency","type"]);Ei(this._oscillator,this._gainNode),this.type=e.type,this.frequency=new ki({context:this.context,param:this._oscillator.frequency,units:"frequency",value:e.frequency}),this.detune=new ki({context:this.context,param:this._oscillator.detune,units:"cents",value:e.detune}),Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(Ni.getDefaults(),{detune:0,frequency:440,type:"sine"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._oscillator.start(t),this}_stopSource(e){this._oscillator.stop(e)}setPeriodicWave(e){return this._oscillator.setPeriodicWave(e),this}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}}class ua extends ea{constructor(){super(Rr(ua.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const e=Rr(ua.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),Zr(this,"frequency"),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),Zr(this,"detune"),this._partials=e.partials,this._partialCount=e.partialCount,this._type=e.type,e.partialCount&&"custom"!==e.type&&(this._type=this.baseType+e.partialCount.toString()),this.phase=e.phase}static getDefaults(){return Object.assign(ea.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(e){const t=this.toSeconds(e),n=new la({context:this.context,onended:()=>this.onstop(this)});this._oscillator=n,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(t)}_stop(e){const t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){const t=this.toSeconds(e);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if("custom"===this._type){return ua._periodicWaveCache.find((e=>{return e.phase===this._phase&&(t=e.partials,n=this._partials,t.length===n.length&&t.every(((e,t)=>n[t]===e)));var t,n}))}{const e=ua._periodicWaveCache.find((e=>e.type===this._type&&e.phase===this._phase));return this._partialCount=e?e.partialCount:this._partialCount,e}}get type(){return this._type}set type(e){this._type=e;const t=-1!==["sine","square","sawtooth","triangle"].indexOf(e);if(0===this._phase&&t)this._wave=void 0,this._partialCount=0,null!==this._oscillator&&(this._oscillator.type=e);else{const t=this._getCachedPeriodicWave();if(dr(t)){const{partials:e,wave:n}=t;this._wave=n,this._partials=e,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}else{const[t,n]=this._getRealImaginary(e,this._phase),s=this.context.createPeriodicWave(t,n);this._wave=s,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave),ua._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:t,type:this._type,wave:this._wave}),ua._periodicWaveCache.length>100&&ua._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(e){this.partialCount&&"custom"!==this._type&&"custom"!==e?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){ir(e,0);let t=this._type;const n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(n&&(t=n[1]),"custom"!==this._type)this.type=0===e?t:t+e.toString();else{const t=new Float32Array(e);this._partials.forEach(((e,n)=>t[n]=e)),this._partials=Array.from(t),this.type=this._type}}_getRealImaginary(e,t){let n=2048;const s=new Float32Array(n),r=new Float32Array(n);let i=1;if("custom"===e){if(i=this._partials.length+1,this._partialCount=this._partials.length,n=i,0===this._partials.length)return[s,r]}else{const t=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);t?(i=parseInt(t[2],10)+1,this._partialCount=parseInt(t[2],10),e=t[1],i=Math.max(i,2),n=i):this._partialCount=0,this._partials=[]}for(let a=1;a>1&1?-1:1):0,this._partials[a-1]=o;break;case"custom":o=this._partials[a-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}0!==o?(s[a]=-o*Math.sin(t*a),r[a]=o*Math.cos(t*a)):(s[a]=0,r[a]=0)}return[s,r]}_inverseFFT(e,t,n){let s=0;const r=e.length;for(let i=0;it.includes(e))),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class da extends ca{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new ha({context:this.context,mapping:e=>(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class pa extends Ri{constructor(){super(Object.assign(Rr(pa.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=Rr(pa.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new Ti({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class fa extends ea{constructor(){super(Rr(fa.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new da({context:this.context}),this._modulationNode=new Ti({context:this.context});const e=Rr(fa.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ua({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new ua({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Zr(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ua.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class ma extends ea{constructor(){super(Rr(ma.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new Ti({context:this.context,gain:0});const e=Rr(ma.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ua({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new ua({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new pa({context:this.context,units:"positive",value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Zr(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ua.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class ga extends ea{constructor(){super(Rr(ga.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new Ti({context:this.context,gain:0}),this._thresh=new ha({context:this.context,mapping:e=>e<=0?-1:1});const e=Rr(ga.getDefaults(),arguments,["frequency","width"]);this.width=new Ri({context:this.context,units:"audioRange",value:e.width}),this._triangle=new ua({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Zr(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ea.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class ya extends ea{constructor(){super(Rr(ya.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=Rr(ya.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(ua.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach((t=>t.start(e)))}_stop(e){e=this.toSeconds(e),this._forEach((t=>t.stop(e)))}_restart(e){this._forEach((t=>t.restart(e)))}_forEach(e){for(let t=0;tt.type=e))}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){const t=-e/2,n=e/(this._oscillators.length-1);this._forEach(((e,s)=>e.detune.value=t+n*s))}}get count(){return this._oscillators.length}set count(e){if(ir(e,1),this._oscillators.length!==e){this._forEach((e=>e.dispose())),this._oscillators=[];for(let t=0;tthis.onstop(this):Qr});"custom"===this.type&&(n.partials=this._partials),this.frequency.connect(n.frequency),this.detune.connect(n.detune),n.detune.overridden=!1,n.connect(this.output),this._oscillators[t]=n}this.spread=this._spread,"started"===this.state&&this._forEach((e=>e.start()))}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach(((e,t)=>e.phase=this._phase+t/this.count*360))}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach((t=>t.baseType=e)),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach((t=>t.partials=e)))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach((t=>t.partialCount=e)),this._type=this._oscillators[0].type}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach((e=>e.dispose())),this}}class ba extends ea{constructor(){super(Rr(ba.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new pa({context:this.context,value:2});const e=Rr(ba.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new ga({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new ua({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Zr(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ea.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const wa={am:fa,fat:ya,fm:ma,oscillator:ua,pulse:ga,pwm:ba};class va extends ea{constructor(){super(Rr(va.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=Rr(va.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),Zr(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(ua.getDefaults(),ma.getDefaults(),fa.getDefaults(),ya.getDefaults(),ga.getDefaults(),ba.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some((e=>this._sourceType===e))&&(e=this._sourceType),e+this._oscillator.type}set type(e){"fm"===e.substr(0,2)?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"am"===e.substr(0,2)?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"fat"===e.substr(0,3)?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):"pwm"===e?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):"pulse"===e?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;const t=wa[e],n=this.now();if(this._oscillator){const e=this._oscillator;e.stop(n),this.context.setTimeout((()=>e.dispose()),this.blockTime)}this._oscillator=new t({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),"started"===this.state&&this._oscillator.start(n)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t="sine";"pwm"!==this._oscillator.type&&"pulse"!==this._oscillator.type&&(t=this._oscillator.type),"fm"===e?this.type="fm"+t:"am"===e?this.type="am"+t:"fat"===e?this.type="fat"+t:"oscillator"===e?this.type=t:"pulse"===e?this.type="pulse":"pwm"===e&&(this.type="pwm")}_getOscType(e,t){return e instanceof wa[t]}get baseType(){return this._oscillator.baseType}set baseType(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||"pulse"===e||"pwm"===e||(this._oscillator.baseType=e)}get width(){return this._getOscType(this._oscillator,"pulse")?this._oscillator.width:void 0}get count(){return this._getOscType(this._oscillator,"fat")?this._oscillator.count:void 0}set count(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.count=e)}get spread(){return this._getOscType(this._oscillator,"fat")?this._oscillator.spread:void 0}set spread(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.spread=e)}get modulationType(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.modulationType:void 0}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&br(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){return this._getOscType(this._oscillator,"fm")?this._oscillator.modulationIndex:void 0}get harmonicity(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.harmonicity:void 0}get modulationFrequency(){return this._getOscType(this._oscillator,"pwm")?this._oscillator.modulationFrequency:void 0}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class Aa extends Ri{constructor(){super(Object.assign(Rr(Aa.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new Ti({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,_i(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class xa extends ca{constructor(){super(Object.assign(Rr(xa.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=Rr(xa.getDefaults(),arguments,["min","max"]);this._mult=this.input=new pa({context:this.context,value:e.max-e.min}),this._add=this.output=new Aa({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ca.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(e){this._min=e,this._setRange()}get max(){return this._max}set max(e){this._max=e,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}class Ca extends ca{constructor(){super(Object.assign(Rr(Ca.getDefaults(),arguments))),this.name="Zero",this._gain=new Ti({context:this.context}),this.output=this._gain,this.input=void 0,Ei(this.context.getConstant(0),this._gain)}dispose(){return super.dispose(),Ii(this.context.getConstant(0),this._gain),this}}class ka extends Si{constructor(){super(Rr(ka.getDefaults(),arguments,["frequency","min","max"])),this.name="LFO",this._stoppedValue=0,this._units="number",this.convert=!0,this._fromType=ki.prototype._fromType,this._toType=ki.prototype._toType,this._is=ki.prototype._is,this._clampValue=ki.prototype._clampValue;const e=Rr(ka.getDefaults(),arguments,["frequency","min","max"]);this._oscillator=new ua(e),this.frequency=this._oscillator.frequency,this._amplitudeGain=new Ti({context:this.context,gain:e.amplitude,units:"normalRange"}),this.amplitude=this._amplitudeGain.gain,this._stoppedSignal=new Ri({context:this.context,units:"audioRange",value:0}),this._zeros=new Ca({context:this.context}),this._a2g=new da({context:this.context}),this._scaler=this.output=new xa({context:this.context,max:e.max,min:e.min}),this.units=e.units,this.min=e.min,this.max=e.max,this._oscillator.chain(this._amplitudeGain,this._a2g,this._scaler),this._zeros.connect(this._a2g),this._stoppedSignal.connect(this._a2g),Zr(this,["amplitude","frequency"]),this.phase=e.phase}static getDefaults(){return Object.assign(ua.getDefaults(),{amplitude:1,frequency:"4n",max:1,min:0,type:"sine",units:"number"})}start(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(0,e),this._oscillator.start(e),this}stop(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(this._stoppedValue,e),this._oscillator.stop(e),this}sync(){return this._oscillator.sync(),this._oscillator.syncFrequency(),this}unsync(){return this._oscillator.unsync(),this._oscillator.unsyncFrequency(),this}_setStoppedValue(){this._stoppedValue=this._oscillator.getInitialValue(),this._stoppedSignal.value=this._stoppedValue}get min(){return this._toType(this._scaler.min)}set min(e){e=this._fromType(e),this._scaler.min=e}get max(){return this._toType(this._scaler.max)}set max(e){e=this._fromType(e),this._scaler.max=e}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e,this._setStoppedValue()}get partials(){return this._oscillator.partials}set partials(e){this._oscillator.partials=e,this._setStoppedValue()}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e,this._setStoppedValue()}get units(){return this._units}set units(e){const t=this.min,n=this.max;this._units=e,this.min=t,this.max=n}get state(){return this._oscillator.state}connect(e,t,n){return(e instanceof ki||e instanceof Ri)&&(this.convert=e.convert,this.units=e.units),Di(this,e,t,n),this}dispose(){return super.dispose(),this._oscillator.dispose(),this._stoppedSignal.dispose(),this._zeros.dispose(),this._scaler.dispose(),this._a2g.dispose(),this._amplitudeGain.dispose(),this.amplitude.dispose(),this}}function Sa(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ir(s,e,t),n.set(this,s)}})}}function _a(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ir(this.toSeconds(s),e,t),n.set(this,s)}})}}class Ea extends ea{constructor(){super(Rr(Ea.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=Rr(Ea.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1,reverse:!1})}load(e){return Cr(this,void 0,void 0,(function*(){return yield this._buffer.load(e),this._onload(),this}))}_onload(e=Qr){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),0!==this._activeSources.size||this._synced||"started"!==this._state.getValueAtTime(this.now())||(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,t,n){return super.start(e,t,n),this}_start(e,t,n){t=this._loop?Dr(t,this._loopStart):Dr(t,0);const s=this.toSeconds(t),r=n;n=Dr(n,Math.max(this._buffer.duration-s,0));let i=this.toSeconds(n);i/=this._playbackRate,e=this.toSeconds(e);const a=new ta({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);this._loop||this._synced||(this._state.cancel(e+i),this._state.setStateAtTime("stopped",e+i,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&hr(r)?a.start(e,s):a.start(e,s,i-this.toSeconds(this.fadeOut))}_stop(e){const t=this.toSeconds(e);this._activeSources.forEach((e=>e.stop(t)))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}seek(e,t){const n=this.toSeconds(t);if("started"===this._state.getValueAtTime(n)){const t=this.toSeconds(e);this._stop(n),this._start(n,t)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopStart=e}))}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopEnd=e}))}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach((t=>{t.loop=e})),e)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const t=this.now(),n=this._state.getNextState("stopped",t);n&&n.implicitEnd&&(this._state.cancel(n.time),this._activeSources.forEach((e=>e.cancelStop()))),this._activeSources.forEach((n=>{n.playbackRate.setValueAtTime(e,t)}))}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach((e=>e.dispose())),this._activeSources.clear(),this._buffer.dispose(),this}}xr([_a(0)],Ea.prototype,"fadeIn",void 0),xr([_a(0)],Ea.prototype,"fadeOut",void 0);class Ia extends Si{constructor(){super(Rr(Ia.getDefaults(),arguments,["urls","onload"],"urls")),this.name="Players",this.input=void 0,this._players=new Map;const e=Rr(Ia.getDefaults(),arguments,["urls","onload"],"urls");this._volume=this.output=new Ki({context:this.context,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this._buffers=new Vi({urls:e.urls,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.mute=e.mute,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{baseUrl:"",fadeIn:0,fadeOut:0,mute:!1,onload:Qr,onerror:Qr,urls:{},volume:0})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._players.forEach((t=>{t.fadeIn=e}))}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._players.forEach((t=>{t.fadeOut=e}))}get state(){return Array.from(this._players).some((([e,t])=>"started"===t.state))?"started":"stopped"}has(e){return this._buffers.has(e)}player(e){if(rr(this.has(e),`No Player with the name ${e} exists on this object`),!this._players.has(e)){const t=new Ea({context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,url:this._buffers.get(e)}).connect(this.output);this._players.set(e,t)}return this._players.get(e)}get loaded(){return this._buffers.loaded}add(e,t,n){return rr(!this._buffers.has(e),"A buffer with that name already exists on this object"),this._buffers.add(e,t,n),this}stopAll(e){return this._players.forEach((t=>t.stop(e))),this}dispose(){return super.dispose(),this._volume.dispose(),this.volume.dispose(),this._players.forEach((e=>e.dispose())),this._buffers.dispose(),this}}class Ta extends ea{constructor(){super(Rr(Ta.getDefaults(),arguments,["url","onload"])),this.name="GrainPlayer",this._loopStart=0,this._loopEnd=0,this._activeSources=[];const e=Rr(Ta.getDefaults(),arguments,["url","onload"]);this.buffer=new Jr({onload:e.onload,onerror:e.onerror,reverse:e.reverse,url:e.url}),this._clock=new zi({context:this.context,callback:this._tick.bind(this),frequency:1/e.grainSize}),this._playbackRate=e.playbackRate,this._grainSize=e.grainSize,this._overlap=e.overlap,this.detune=e.detune,this.overlap=e.overlap,this.loop=e.loop,this.playbackRate=e.playbackRate,this.grainSize=e.grainSize,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.reverse=e.reverse,this._clock.on("stop",this._onstop.bind(this))}static getDefaults(){return Object.assign(ea.getDefaults(),{onload:Qr,onerror:Qr,overlap:.1,grainSize:.2,playbackRate:1,detune:0,loop:!1,loopStart:0,loopEnd:0,reverse:!1})}_start(e,t,n){t=Dr(t,0),t=this.toSeconds(t),e=this.toSeconds(e);const s=1/this._clock.frequency.getValueAtTime(e);this._clock.start(e,t/s),n&&this.stop(e+this.toSeconds(n))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}_stop(e){this._clock.stop(e)}_onstop(e){this._activeSources.forEach((t=>{t.fadeOut=0,t.stop(e)})),this.onstop(this)}_tick(e){const t=this._clock.getTicksAtTime(e),n=t*this._grainSize;if(this.log("offset",n),!this.loop&&n>this.buffer.duration)return void this.stop(e);const s=n{const e=this._activeSources.indexOf(r);-1!==e&&this._activeSources.splice(e,1)}}get playbackRate(){return this._playbackRate}set playbackRate(e){ir(e,.001),this._playbackRate=e,this.grainSize=this._grainSize}get loopStart(){return this._loopStart}set loopStart(e){this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._loopStart=this.toSeconds(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._loopEnd=this.toSeconds(e)}get reverse(){return this.buffer.reverse}set reverse(e){this.buffer.reverse=e}get grainSize(){return this._grainSize}set grainSize(e){this._grainSize=this.toSeconds(e),this._clock.frequency.setValueAtTime(this._playbackRate/this._grainSize,this.now())}get overlap(){return this._overlap}set overlap(e){const t=this.toSeconds(e);ir(t,0),this._overlap=t}get loaded(){return this.buffer.loaded}dispose(){return super.dispose(),this.buffer.dispose(),this._clock.dispose(),this._activeSources.forEach((e=>e.dispose())),this}}class Na extends ca{constructor(){super(...arguments),this.name="Abs",this._abs=new ha({context:this.context,mapping:e=>Math.abs(e)<.001?0:Math.abs(e)}),this.input=this._abs,this.output=this._abs}dispose(){return super.dispose(),this._abs.dispose(),this}}class Oa extends ca{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new ha({context:this.context,mapping:e=>2*Math.abs(e)-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Ra extends ca{constructor(){super(...arguments),this.name="Negate",this._multiply=new pa({context:this.context,value:-1}),this.input=this._multiply,this.output=this._multiply}dispose(){return super.dispose(),this._multiply.dispose(),this}}class Da extends Ri{constructor(){super(Object.assign(Rr(Da.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Subtract",this._sum=new Ti({context:this.context}),this.input=this._sum,this.output=this._sum,this._neg=new Ra({context:this.context}),this.subtrahend=this._param,_i(this._constantSource,this._neg,this._sum)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._neg.dispose(),this._sum.dispose(),this}}class Ma extends ca{constructor(){super(Object.assign(Rr(Ma.getDefaults(),arguments))),this.name="GreaterThanZero",this._thresh=this.output=new ha({context:this.context,length:127,mapping:e=>e<=0?0:1}),this._scale=this.input=new pa({context:this.context,value:1e4}),this._scale.connect(this._thresh)}dispose(){return super.dispose(),this._scale.dispose(),this._thresh.dispose(),this}}class Fa extends Ri{constructor(){super(Object.assign(Rr(Fa.getDefaults(),arguments,["value"]))),this.name="GreaterThan",this.override=!1;const e=Rr(Fa.getDefaults(),arguments,["value"]);this._subtract=this.input=new Da({context:this.context,value:e.value}),this._gtz=this.output=new Ma({context:this.context}),this.comparator=this._param=this._subtract.subtrahend,Zr(this,"comparator"),this._subtract.connect(this._gtz)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._gtz.dispose(),this._subtract.dispose(),this.comparator.dispose(),this}}class Ba extends ca{constructor(){super(Object.assign(Rr(Ba.getDefaults(),arguments,["value"]))),this.name="Pow";const e=Rr(Ba.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new ha({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(ca.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class za extends xa{constructor(){super(Object.assign(Rr(za.getDefaults(),arguments,["min","max","exponent"]))),this.name="ScaleExp";const e=Rr(za.getDefaults(),arguments,["min","max","exponent"]);this.input=this._exp=new Ba({context:this.context,value:e.exponent}),this._exp.connect(this._mult)}static getDefaults(){return Object.assign(xa.getDefaults(),{exponent:1})}get exponent(){return this._exp.value}set exponent(e){this._exp.value=e}dispose(){return super.dispose(),this._exp.dispose(),this}}class La extends Ri{constructor(){super(Rr(Ri.getDefaults(),arguments,["value","units"])),this.name="SyncedSignal",this.override=!1;const e=Rr(Ri.getDefaults(),arguments,["value","units"]);this._lastVal=e.value,this._synced=this.context.transport.scheduleRepeat(this._onTick.bind(this),"1i"),this._syncedCallback=this._anchorValue.bind(this),this.context.transport.on("start",this._syncedCallback),this.context.transport.on("pause",this._syncedCallback),this.context.transport.on("stop",this._syncedCallback),this._constantSource.disconnect(),this._constantSource.stop(0),this._constantSource=this.output=new Oi({context:this.context,offset:e.value,units:e.units}).start(0),this.setValueAtTime(e.value,0)}_onTick(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal!==t&&(this._lastVal=t,this._constantSource.offset.setValueAtTime(t,e))}_anchorValue(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal=t,this._constantSource.offset.cancelAndHoldAtTime(e),this._constantSource.offset.setValueAtTime(t,e)}getValueAtTime(e){const t=new vi(this.context,e).toSeconds();return super.getValueAtTime(t)}setValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.setValueAtTime(e,n),this}linearRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.linearRampToValueAtTime(e,n),this}exponentialRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.exponentialRampToValueAtTime(e,n),this}setTargetAtTime(e,t,n){const s=new vi(this.context,t).toSeconds();return super.setTargetAtTime(e,s,n),this}cancelScheduledValues(e){const t=new vi(this.context,e).toSeconds();return super.cancelScheduledValues(t),this}setValueCurveAtTime(e,t,n,s){const r=new vi(this.context,t).toSeconds();return n=this.toSeconds(n),super.setValueCurveAtTime(e,r,n,s),this}cancelAndHoldAtTime(e){const t=new vi(this.context,e).toSeconds();return super.cancelAndHoldAtTime(t),this}setRampPoint(e){const t=new vi(this.context,e).toSeconds();return super.setRampPoint(t),this}exponentialRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.exponentialRampTo(e,t,s),this}linearRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.linearRampTo(e,t,s),this}targetRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.targetRampTo(e,t,s),this}dispose(){return super.dispose(),this.context.transport.clear(this._synced),this.context.transport.off("start",this._syncedCallback),this.context.transport.off("pause",this._syncedCallback),this.context.transport.off("stop",this._syncedCallback),this._constantSource.dispose(),this}}class Pa extends Si{constructor(){super(Rr(Pa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ri({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=Rr(Pa.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign(Si.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(br(e))return e;{let n;for(n in Va)if(Va[n][t]===e)return n;return e}}_setCurve(e,t,n){if(br(n)&&Reflect.has(Va,n)){const s=Va[n];mr(s)?"_decayCurve"!==e&&(this[e]=s[t]):this[e]=s}else{if(!yr(n)||"_decayCurve"===e)throw new Error("Envelope: invalid curve: "+n);this[e]=n}}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._decayCurve}set decayCurve(e){rr(["linear","exponential"].some((t=>t===e)),`Invalid envelope curve: ${e}`),this._decayCurve=e}triggerAttack(e,t=1){this.log("triggerAttack",e,t),e=this.toSeconds(e);let n=this.toSeconds(this.attack);const s=this.toSeconds(this.decay),r=this.getValueAtTime(e);if(r>0){n=(1-r)/(1/n)}if(n0){const n=this.toSeconds(this.release);n{const e=128;let t,n;const s=[];for(t=0;t{const s=e[t],r=this.context.transport.schedule((s=>{e[t]=s,n.apply(this,e)}),s);this._scheduledEvents.push(r)}}unsync(){return this._scheduledEvents.forEach((e=>this.context.transport.clear(e))),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n),i=this.toSeconds(t);return this.triggerAttack(e,r,s),this.triggerRelease(r+i),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ga extends Wa{constructor(){super(Rr(Ga.getDefaults(),arguments));const e=Rr(Ga.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Wa.getDefaults(),{detune:0,onsilence:Qr,portamento:0})}triggerAttack(e,t,n=1){this.log("triggerAttack",e,t,n);const s=this.toSeconds(t);return this._triggerEnvelopeAttack(s,n),this.setNote(e,s),this}triggerRelease(e){this.log("triggerRelease",e);const t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){const n=this.toSeconds(t),s=e instanceof gi?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(n)>.05){const e=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(s,e,n)}else this.frequency.setValueAtTime(s,n);return this}}xr([_a(0)],Ga.prototype,"portamento",void 0);class Ua extends Pa{constructor(){super(Rr(Ua.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new Ti({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class qa extends Ga{constructor(){super(Rr(qa.getDefaults(),arguments)),this.name="Synth";const e=Rr(qa.getDefaults(),arguments);this.oscillator=new va(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Ua(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),Zr(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ja extends Ga{constructor(){super(Rr(ja.getDefaults(),arguments)),this.name="ModulationSynth";const e=Rr(ja.getDefaults(),arguments);this._carrier=new qa({context:this.context,oscillator:e.oscillator,envelope:e.envelope,onsilence:()=>this.onsilence(this),volume:-10}),this._modulator=new qa({context:this.context,oscillator:e.modulation,envelope:e.modulationEnvelope,volume:-10}),this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope,this.modulation=this._modulator.oscillator,this.modulationEnvelope=this._modulator.envelope,this.frequency=new Ri({context:this.context,units:"frequency"}),this.detune=new Ri({context:this.context,value:e.detune,units:"cents"}),this.harmonicity=new pa({context:this.context,value:e.harmonicity,minValue:0}),this._modulationNode=new Ti({context:this.context,gain:0}),Zr(this,["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{harmonicity:3,oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"sine"}),envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.01,decay:.01,sustain:1,release:.5}),modulation:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"square"}),modulationEnvelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.5,decay:0,sustain:1,release:.5})})}_triggerEnvelopeAttack(e,t){this._carrier._triggerEnvelopeAttack(e,t),this._modulator._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this._carrier._triggerEnvelopeRelease(e),this._modulator._triggerEnvelopeRelease(e),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this._carrier.dispose(),this._modulator.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._modulationNode.dispose(),this}}class Ha extends ja{constructor(){super(Rr(Ha.getDefaults(),arguments)),this.name="AMSynth",this._modulationScale=new da({context:this.context}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output)}dispose(){return super.dispose(),this._modulationScale.dispose(),this}}class $a extends Si{constructor(){super(Rr($a.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=Rr($a.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new ki({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new ki({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new ki({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new ki({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(Si.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(e){rr(-1!==["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(e),`Invalid filter type: ${e}`),this._filter.type=e}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.type=e))}get rolloff(){return this._rolloff}set rolloff(e){const t=fr(e)?e:parseInt(e,10),n=[-12,-24,-48,-96];let s=n.indexOf(t);rr(-1!==s,`rolloff can only be ${n.join(", ")}`),s+=1,this._rolloff=t,this.input.disconnect(),this._filters.forEach((e=>e.disconnect())),this._filters=new Array(s);for(let e=0;e1));return this._filters.forEach((()=>{t.getFrequencyResponse(e).forEach(((e,t)=>n[t]*=e))})),t.dispose(),n}dispose(){return super.dispose(),this._filters.forEach((e=>{e.dispose()})),Yr(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Xa extends Pa{constructor(){super(Rr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=Rr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Ba({context:this.context,value:e.exponent}),this._scale=this.output=new xa({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pa.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);ir(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._scale.max=this._baseFrequency*Math.pow(2,e)}get exponent(){return this._exponent.value}set exponent(e){this._exponent.value=e}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class Za extends Ga{constructor(){super(Rr(Za.getDefaults(),arguments)),this.name="MonoSynth";const e=Rr(Za.getDefaults(),arguments);this.oscillator=new va(Object.assign(e.oscillator,{context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new Ka(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new Xa(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Ua(Object.assign(e.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Zr(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Mr(Ka.getDefaults(),Object.keys(Si.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Mr(Xa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Mr(va.getDefaults(),Object.keys(ea.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(e,t=1){if(this.envelope.triggerAttack(e,t),this.filterEnvelope.triggerAttack(e),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.filterEnvelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Ya extends Ga{constructor(){super(Rr(Ya.getDefaults(),arguments)),this.name="DuoSynth";const e=Rr(Ya.getDefaults(),arguments);this.voice0=new Za(Object.assign(e.voice0,{context:this.context,onsilence:()=>this.onsilence(this)})),this.voice1=new Za(Object.assign(e.voice1,{context:this.context})),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this._vibrato=new ka({frequency:e.vibratoRate,context:this.context,min:-50,max:50}),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new Ti({context:this.context,units:"normalRange",gain:e.vibratoAmount}),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new Ri({context:this.context,units:"frequency",value:440}),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.detune.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),Zr(this,["voice0","voice1","frequency","vibratoAmount","vibratoRate"])}getLevelAtTime(e){return e=this.toSeconds(e),this.voice0.envelope.getValueAtTime(e)+this.voice1.envelope.getValueAtTime(e)}static getDefaults(){return Or(Ga.getDefaults(),{vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:Or(Mr(Za.getDefaults(),Object.keys(Ga.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}),voice1:Or(Mr(Za.getDefaults(),Object.keys(Ga.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}})})}_triggerEnvelopeAttack(e,t){this.voice0._triggerEnvelopeAttack(e,t),this.voice1._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this.voice0._triggerEnvelopeRelease(e),this.voice1._triggerEnvelopeRelease(e),this}dispose(){return super.dispose(),this.voice0.dispose(),this.voice1.dispose(),this.frequency.dispose(),this.detune.dispose(),this._vibrato.dispose(),this.vibratoRate.dispose(),this._vibratoGain.dispose(),this.harmonicity.dispose(),this}}class Qa extends ja{constructor(){super(Rr(Qa.getDefaults(),arguments)),this.name="FMSynth";const e=Rr(Qa.getDefaults(),arguments);this.modulationIndex=new pa({context:this.context,value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output)}static getDefaults(){return Object.assign(ja.getDefaults(),{modulationIndex:10})}dispose(){return super.dispose(),this.modulationIndex.dispose(),this}}const Ja=[1,1.483,1.932,2.546,2.63,3.897];class eo extends Ga{constructor(){super(Rr(eo.getDefaults(),arguments)),this.name="MetalSynth",this._oscillators=[],this._freqMultipliers=[];const e=Rr(eo.getDefaults(),arguments);this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),this.frequency=new Ri({context:this.context,units:"frequency"}),this._amplitude=new Ti({context:this.context,gain:0}).connect(this.output),this._highpass=new Ka({Q:0,context:this.context,type:"highpass"}).connect(this._amplitude);for(let t=0;tthis.onsilence(this):Qr,type:"square"});n.connect(this._highpass),this._oscillators[t]=n;const s=new pa({context:this.context,value:Ja[t]});this._freqMultipliers[t]=s,this.frequency.chain(s,n.frequency),this.detune.connect(n.detune)}this._filterFreqScaler=new xa({context:this.context,max:7e3,min:this.toFrequency(e.resonance)}),this.envelope=new Pa({attack:e.envelope.attack,attackCurve:"linear",context:this.context,decay:e.envelope.decay,release:e.envelope.release,sustain:0}),this.envelope.chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitude.gain),this._octaves=e.octaves,this.octaves=e.octaves}static getDefaults(){return Or(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.001,decay:1.4,release:.2}),harmonicity:5.1,modulationIndex:32,octaves:1.5,resonance:4e3})}_triggerEnvelopeAttack(e,t=1){return this.envelope.triggerAttack(e,t),this._oscillators.forEach((t=>t.start(e))),0===this.envelope.sustain&&this._oscillators.forEach((t=>{t.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay))})),this}_triggerEnvelopeRelease(e){return this.envelope.triggerRelease(e),this._oscillators.forEach((t=>t.stop(e+this.toSeconds(this.envelope.release)))),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}get modulationIndex(){return this._oscillators[0].modulationIndex.value}set modulationIndex(e){this._oscillators.forEach((t=>t.modulationIndex.value=e))}get harmonicity(){return this._oscillators[0].harmonicity.value}set harmonicity(e){this._oscillators.forEach((t=>t.harmonicity.value=e))}get resonance(){return this._filterFreqScaler.min}set resonance(e){this._filterFreqScaler.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._filterFreqScaler.max=this._filterFreqScaler.min*Math.pow(2,e)}dispose(){return super.dispose(),this._oscillators.forEach((e=>e.dispose())),this._freqMultipliers.forEach((e=>e.dispose())),this.frequency.dispose(),this.detune.dispose(),this._filterFreqScaler.dispose(),this._amplitude.dispose(),this.envelope.dispose(),this._highpass.dispose(),this}}class to extends qa{constructor(){super(Rr(to.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=Rr(to.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Zr(this,["oscillator","envelope"])}static getDefaults(){return Or(Ga.getDefaults(),qa.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,t){const n=this.toSeconds(t),s=this.toFrequency(e instanceof gi?e.toFrequency():e),r=s*this.octaves;return this.oscillator.frequency.setValueAtTime(r,n),this.oscillator.frequency.exponentialRampToValueAtTime(s,n+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}xr([Sa(0)],to.prototype,"octaves",void 0),xr([_a(0)],to.prototype,"pitchDecay",void 0);class no extends Wa{constructor(){super(Rr(no.getDefaults(),arguments)),this.name="NoiseSynth";const e=Rr(no.getDefaults(),arguments);this.noise=new na(Object.assign({context:this.context},e.noise)),this.envelope=new Ua(Object.assign({context:this.context},e.envelope)),this.noise.chain(this.envelope,this.output)}static getDefaults(){return Object.assign(Wa.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{decay:.1,sustain:0}),noise:Object.assign(Mr(na.getDefaults(),Object.keys(ea.getDefaults())),{type:"white"})})}triggerAttack(e,t=1){return e=this.toSeconds(e),this.envelope.triggerAttack(e,t),this.noise.start(e),0===this.envelope.sustain&&this.noise.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay)),this}triggerRelease(e){return e=this.toSeconds(e),this.envelope.triggerRelease(e),this.noise.stop(e+this.toSeconds(this.envelope.release)),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0)),this}triggerAttackRelease(e,t,n=1){return t=this.toSeconds(t),e=this.toSeconds(e),this.triggerAttack(t,n),this.triggerRelease(t+e),this}dispose(){return super.dispose(),this.noise.dispose(),this.envelope.dispose(),this}}const so=new Set;function ro(e){so.add(e)}function io(e,t){const n=`registerProcessor("${e}", ${t})`;so.add(n)}class ao extends Si{constructor(e){super(e),this.name="ToneAudioWorklet",this.workletOptions={},this.onprocessorerror=Qr;const t=URL.createObjectURL(new Blob([Array.from(so).join("\n")],{type:"text/javascript"})),n=this._audioWorkletName();this._dummyGain=this.context.createGain(),this._dummyParam=this._dummyGain.gain,this.context.addAudioWorkletModule(t,n).then((()=>{this.disposed||(this._worklet=this.context.createAudioWorkletNode(n,this.workletOptions),this._worklet.onprocessorerror=this.onprocessorerror.bind(this),this.onReady(this._worklet))}))}dispose(){return super.dispose(),this._dummyGain.disconnect(),this._worklet&&(this._worklet.port.postMessage("dispose"),this._worklet.disconnect()),this}}ro('\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it\'s disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === "dispose") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n');ro("\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n");ro("\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels; i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n");const oo="feedback-comb-filter";io(oo,'\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: "delayTime",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}, {\n\t\t\t\tname: "feedback",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n');class lo extends ao{constructor(){super(Rr(lo.getDefaults(),arguments,["delayTime","resonance"])),this.name="FeedbackCombFilter";const e=Rr(lo.getDefaults(),arguments,["delayTime","resonance"]);this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this.delayTime=new ki({context:this.context,value:e.delayTime,units:"time",minValue:0,maxValue:1,param:this._dummyParam,swappable:!0}),this.resonance=new ki({context:this.context,value:e.resonance,units:"normalRange",param:this._dummyParam,swappable:!0}),Zr(this,["resonance","delayTime"])}_audioWorkletName(){return oo}static getDefaults(){return Object.assign(Si.getDefaults(),{delayTime:.1,resonance:.5})}onReady(e){_i(this.input,e,this.output);const t=e.parameters.get("delayTime");this.delayTime.setParam(t);const n=e.parameters.get("feedback");this.resonance.setParam(n)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.delayTime.dispose(),this.resonance.dispose(),this}}class uo extends Si{constructor(){super(Rr(uo.getDefaults(),arguments,["frequency","type"])),this.name="OnePoleFilter";const e=Rr(uo.getDefaults(),arguments,["frequency","type"]);this._frequency=e.frequency,this._type=e.type,this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this._createFilter()}static getDefaults(){return Object.assign(Si.getDefaults(),{frequency:880,type:"lowpass"})}_createFilter(){const e=this._filter,t=this.toFrequency(this._frequency),n=1/(2*Math.PI*t);if("lowpass"===this._type){const e=1/(n*this.context.sampleRate),t=e-1;this._filter=this.context.createIIRFilter([e,0],[1,t])}else{const e=1/(n*this.context.sampleRate)-1;this._filter=this.context.createIIRFilter([1,-1],[1,e])}this.input.chain(this._filter,this.output),e&&this.context.setTimeout((()=>{this.disposed||(this.input.disconnect(e),e.disconnect())}),this.blockTime)}get frequency(){return this._frequency}set frequency(e){this._frequency=e,this._createFilter()}get type(){return this._type}set type(e){this._type=e,this._createFilter()}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.voice===e));this._activeVoices.splice(t,1)}_getNextAvailableVoice(){if(this._availableVoices.length)return this._availableVoices.shift();if(this._voices.lengthMath.ceil(this._averageActiveVoices+1)){const e=this._availableVoices.shift(),t=this._voices.indexOf(e);this._voices.splice(t,1),this.context.isOffline||e.dispose()}}_triggerAttack(e,t,n){e.forEach((e=>{const s=new Wi(this.context,e).toMidi(),r=this._getNextAvailableVoice();r&&(r.triggerAttack(e,t,n),this._activeVoices.push({midi:s,voice:r,released:!1}),this.log("triggerAttack",e,t))}))}_triggerRelease(e,t){e.forEach((e=>{const n=new Wi(this.context,e).toMidi(),s=this._activeVoices.find((({midi:e,released:t})=>e===n&&!t));s&&(s.voice.triggerRelease(t),s.released=!0,this.log("triggerRelease",e,t))}))}_scheduleEvent(e,t,n,s){rr(!this.disposed,"Synth was already disposed"),n<=this.now()?"attack"===e?this._triggerAttack(t,n,s):this._triggerRelease(t,n):this.context.setTimeout((()=>{this._scheduleEvent(e,t,n,s)}),n-this.now())}triggerAttack(e,t,n){Array.isArray(e)||(e=[e]);const s=this.toSeconds(t);return this._scheduleEvent("attack",e,s,n),this}triggerRelease(e,t){Array.isArray(e)||(e=[e]);const n=this.toSeconds(t);return this._scheduleEvent("release",e,n),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n);if(this.triggerAttack(e,r,s),yr(t)){rr(yr(e),"If the duration is an array, the notes must also be an array");for(let n=0;n0,"The duration must be greater than 0"),this.triggerRelease(e[n],r+i)}}else{const n=this.toSeconds(t);rr(n>0,"The duration must be greater than 0"),this.triggerRelease(e,r+n)}return this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}set(e){const t=Mr(e,["onsilence","context"]);return this.options=Or(this.options,t),this._voices.forEach((e=>e.set(t))),this._dummyVoice.set(t),this}get(){return this._dummyVoice.get()}releaseAll(e){const t=this.toSeconds(e);return this._activeVoices.forEach((({voice:e})=>{e.triggerRelease(t)})),this}dispose(){return super.dispose(),this._dummyVoice.dispose(),this._voices.forEach((e=>e.dispose())),this._activeVoices=[],this._availableVoices=[],this.context.clearInterval(this._gcTimeout),this}}class fo extends Wa{constructor(){super(Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),t={};Object.keys(e.urls).forEach((n=>{const s=parseInt(n,10);if(rr(wr(n)||fr(s)&&isFinite(s),`url key is neither a note or midi pitch: ${n}`),wr(n)){const s=new gi(this.context,n).toMidi();t[s]=e.urls[n]}else fr(s)&&isFinite(s)&&(t[s]=e.urls[s])})),this._buffers=new Vi({urls:t,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(Wa.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Qr,onerror:Qr,release:.1,urls:{}})}_findClosest(e){let t=0;for(;t<96;){if(this._buffers.has(e+t))return-t;if(this._buffers.has(e-t))return t;t++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,n=1){return this.log("triggerAttack",e,t,n),Array.isArray(e)||(e=[e]),e.forEach((e=>{const s=hi(new gi(this.context,e).toFrequency()),r=Math.round(s),i=s-r,a=this._findClosest(r),o=r-a,l=this._buffers.get(o),u=li(a+i),c=new ta({url:l,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:u}).connect(this.output);c.start(t,0,l.duration/u,n),yr(this._activeSources.get(r))||this._activeSources.set(r,[]),this._activeSources.get(r).push(c),c.onended=()=>{if(this._activeSources&&this._activeSources.has(r)){const e=this._activeSources.get(r),t=e.indexOf(c);-1!==t&&e.splice(t,1)}}})),this}triggerRelease(e,t){return this.log("triggerRelease",e,t),Array.isArray(e)||(e=[e]),e.forEach((e=>{const n=new gi(this.context,e).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const e=this._activeSources.get(n);t=this.toSeconds(t),e.forEach((e=>{e.stop(t)})),this._activeSources.set(n,[])}})),this}releaseAll(e){const t=this.toSeconds(e);return this._activeSources.forEach((e=>{for(;e.length;){e.shift().stop(t)}})),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,t,n,s=1){const r=this.toSeconds(n);return this.triggerAttack(e,r,s),yr(t)?(rr(yr(e),"notes must be an array when duration is array"),e.forEach(((e,n)=>{const s=t[Math.min(n,t.length-1)];this.triggerRelease(e,r+this.toSeconds(s))}))):this.triggerRelease(e,r+this.toSeconds(t)),this}add(e,t,n){if(rr(wr(e)||isFinite(e),`note must be a pitch or midi: ${e}`),wr(e)){const s=new gi(this.context,e).toMidi();this._buffers.add(s,t,n)}else this._buffers.add(e,t,n);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach((e=>{e.forEach((e=>e.dispose()))})),this._activeSources.clear(),this}}xr([_a(0)],fo.prototype,"attack",void 0),xr([_a(0)],fo.prototype,"release",void 0);class mo extends xi{constructor(){super(Rr(mo.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new Ci("stopped"),this._startOffset=0;const e=Rr(mo.getDefaults(),arguments,["callback","value"]);this._loop=e.loop,this.callback=e.callback,this.value=e.value,this._loopStart=this.toTicks(e.loopStart),this._loopEnd=this.toTicks(e.loopEnd),this._playbackRate=e.playbackRate,this._probability=e.probability,this._humanize=e.humanize,this.mute=e.mute,this._playbackRate=e.playbackRate,this._state.increasing=!0,this._rescheduleEvents()}static getDefaults(){return Object.assign(xi.getDefaults(),{callback:Qr,humanize:!1,loop:!1,loopEnd:"1m",loopStart:0,mute:!1,playbackRate:1,probability:1,value:null})}_rescheduleEvents(e=-1){this._state.forEachFrom(e,(e=>{let t;if("started"===e.state){-1!==e.id&&this.context.transport.clear(e.id);const n=e.time+Math.round(this.startOffset/this._playbackRate);if(!0===this._loop||fr(this._loop)&&this._loop>1){t=1/0,fr(this._loop)&&(t=this._loop*this._getLoopDuration());const s=this._state.getAfter(n);null!==s&&(t=Math.min(t,s.time-n)),t!==1/0&&(this._state.setStateAtTime("stopped",n+t+1,{id:-1}),t=new Ui(this.context,t));const r=new Ui(this.context,this._getLoopDuration());e.id=this.context.transport.scheduleRepeat(this._tick.bind(this),r,new Ui(this.context,n),t)}else e.id=this.context.transport.schedule(this._tick.bind(this),new Ui(this.context,n))}}))}get state(){return this._state.getValueAtTime(this.context.transport.ticks)}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e}get probability(){return this._probability}set probability(e){this._probability=e}get humanize(){return this._humanize}set humanize(e){this._humanize=e}start(e){const t=this.toTicks(e);return"stopped"===this._state.getValueAtTime(t)&&(this._state.add({id:-1,state:"started",time:t}),this._rescheduleEvents(t)),this}stop(e){this.cancel(e);const t=this.toTicks(e);if("started"===this._state.getValueAtTime(t)){this._state.setStateAtTime("stopped",t,{id:-1});const e=this._state.getBefore(t);let n=t;null!==e&&(n=e.time),this._rescheduleEvents(n)}return this}cancel(e){e=Dr(e,-1/0);const t=this.toTicks(e);return this._state.forEachFrom(t,(e=>{this.context.transport.clear(e.id)})),this._state.cancel(t),this}_tick(e){const t=this.context.transport.getTicksAtTime(e);if(!this.mute&&"started"===this._state.getValueAtTime(t)){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){let t=.02;gr(this.humanize)||(t=this.toSeconds(this.humanize)),e+=(2*Math.random()-1)*t}this.callback(e,this.value)}}_getLoopDuration(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)}get loop(){return this._loop}set loop(e){this._loop=e,this._rescheduleEvents()}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._rescheduleEvents()}get loopEnd(){return new Ui(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new Ui(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._rescheduleEvents()}get progress(){if(this._loop){const e=this.context.transport.ticks,t=this._state.get(e);if(null!==t&&"started"===t.state){const n=this._getLoopDuration();return(e-t.time)%n/n}return 0}return 0}dispose(){return super.dispose(),this.cancel(),this._state.dispose(),this}}class go extends xi{constructor(){super(Rr(go.getDefaults(),arguments,["callback","interval"])),this.name="Loop";const e=Rr(go.getDefaults(),arguments,["callback","interval"]);this._event=new mo({context:this.context,callback:this._tick.bind(this),loop:!0,loopEnd:e.interval,playbackRate:e.playbackRate,probability:e.probability}),this.callback=e.callback,this.iterations=e.iterations}static getDefaults(){return Object.assign(xi.getDefaults(),{interval:"4n",callback:Qr,playbackRate:1,iterations:1/0,probability:1,mute:!1,humanize:!1})}start(e){return this._event.start(e),this}stop(e){return this._event.stop(e),this}cancel(e){return this._event.cancel(e),this}_tick(e){this.callback(e)}get state(){return this._event.state}get progress(){return this._event.progress}get interval(){return this._event.loopEnd}set interval(e){this._event.loopEnd=e}get playbackRate(){return this._event.playbackRate}set playbackRate(e){this._event.playbackRate=e}get humanize(){return this._event.humanize}set humanize(e){this._event.humanize=e}get probability(){return this._event.probability}set probability(e){this._event.probability=e}get mute(){return this._event.mute}set mute(e){this._event.mute=e}get iterations(){return!0===this._event.loop?1/0:this._event.loop}set iterations(e){this._event.loop=e===1/0||e}dispose(){return super.dispose(),this._event.dispose(),this}}class yo extends mo{constructor(){super(Rr(yo.getDefaults(),arguments,["callback","events"])),this.name="Part",this._state=new Ci("stopped"),this._events=new Set;const e=Rr(yo.getDefaults(),arguments,["callback","events"]);this._state.increasing=!0,e.events.forEach((e=>{yr(e)?this.add(e[0],e[1]):this.add(e)}))}static getDefaults(){return Object.assign(mo.getDefaults(),{events:[]})}start(e,t){const n=this.toTicks(e);if("started"!==this._state.getValueAtTime(n)){t=Dr(t,this._loop?this._loopStart:0),t=this._loop?Dr(t,this._loopStart):Dr(t,0);const e=this.toTicks(t);this._state.add({id:-1,offset:e,state:"started",time:n}),this._forEach((t=>{this._startNote(t,n,e)}))}return this}_startNote(e,t,n){t-=n,this._loop?e.startOffset>=this._loopStart&&e.startOffset=n&&(e.loop=!1,e.start(new Ui(this.context,t))):e.startOffset>=n&&e.start(new Ui(this.context,t))}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e,this._forEach((e=>{e.startOffset+=this._startOffset}))}stop(e){const t=this.toTicks(e);return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this._forEach((t=>{t.stop(e)})),this}at(e,t){const n=new vi(this.context,e).toTicks(),s=new Ui(this.context,1).toSeconds(),r=this._events.values();let i=r.next();for(;!i.done;){const e=i.value;if(Math.abs(n-e.startOffset){"started"===t.state?this._startNote(e,t.time,t.offset):e.stop(new Ui(this.context,t.time))}))}remove(e,t){return mr(e)&&e.hasOwnProperty("time")&&(e=(t=e).time),e=this.toTicks(e),this._events.forEach((n=>{n.startOffset===e&&(hr(t)||dr(t)&&n.value===t)&&(this._events.delete(n),n.dispose())})),this}clear(){return this._forEach((e=>e.dispose())),this._events.clear(),this}cancel(e){return this._forEach((t=>t.cancel(e))),this._state.cancel(this.toTicks(e)),this}_forEach(e){return this._events&&this._events.forEach((t=>{t instanceof yo?t._forEach(e):e(t)})),this}_setAll(e,t){this._forEach((n=>{n[e]=t}))}_tick(e,t){this.mute||this.callback(e,t)}_testLoopBoundries(e){this._loop&&(e.startOffset=this._loopEnd)?e.cancel(0):"stopped"===e.state&&this._restartEvent(e)}get probability(){return this._probability}set probability(e){this._probability=e,this._setAll("probability",e)}get humanize(){return this._humanize}set humanize(e){this._humanize=e,this._setAll("humanize",e)}get loop(){return this._loop}set loop(e){this._loop=e,this._forEach((t=>{t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.loop=e,this._testLoopBoundries(t)}))}get loopEnd(){return new Ui(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._forEach((t=>{t.loopEnd=e,this._testLoopBoundries(t)}))}get loopStart(){return new Ui(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._forEach((e=>{e.loopStart=this.loopStart,this._testLoopBoundries(e)}))}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._setAll("playbackRate",e)}get length(){return this._events.size}dispose(){return super.dispose(),this.clear(),this}}function*bo(e){let t=0;for(;t=0;)t=Ao(t,e),yield e[t],t--}function*vo(e,t){for(;;)yield*t(e)}function Ao(e,t){return Wr(e,0,t.length-1)}function*xo(e,t){let n=t?0:e.length-1;for(;;)n=Ao(n,e),yield e[n],t?(n++,n>=e.length-1&&(t=!1)):(n--,n<=0&&(t=!0))}function*Co(e){let t=0,n=0;for(;t=0;)t=Ao(t,e),yield e[t],n++,t+=n%2?-2:1}function*So(e){const t=[];for(let n=0;n0;){const n=Ao(t.splice(Math.floor(t.length*Math.random()),1)[0],e);yield e[n]}}function*_o(e,t="up",n=0){switch(rr(e.length>0,"The array must have more than one value in it"),t){case"up":yield*vo(e,bo);case"down":yield*vo(e,wo);case"upDown":yield*xo(e,!0);case"downUp":yield*xo(e,!1);case"alternateUp":yield*vo(e,Co);case"alternateDown":yield*vo(e,ko);case"random":yield*function*(e){for(;;){const t=Math.floor(Math.random()*e.length);yield e[t]}}(e);case"randomOnce":yield*vo(e,So);case"randomWalk":yield*function*(e){let t=Math.floor(Math.random()*e.length);for(;;)0===t?t++:t===e.length-1||Math.random()<.5?t--:t++,yield e[t]}(e)}}class Eo extends go{constructor(){super(Rr(Eo.getDefaults(),arguments,["callback","values","pattern"])),this.name="Pattern";const e=Rr(Eo.getDefaults(),arguments,["callback","values","pattern"]);this.callback=e.callback,this._values=e.values,this._pattern=_o(e.values,e.pattern),this._type=e.pattern}static getDefaults(){return Object.assign(go.getDefaults(),{pattern:"up",values:[],callback:Qr})}_tick(e){const t=this._pattern.next();this._value=t.value,this.callback(e,this._value)}get values(){return this._values}set values(e){this._values=e,this.pattern=this._type}get value(){return this._value}get pattern(){return this._type}set pattern(e){this._type=e,this._pattern=_o(this._values,this._type)}}class Io extends mo{constructor(){super(Rr(Io.getDefaults(),arguments,["callback","events","subdivision"])),this.name="Sequence",this._part=new yo({callback:this._seqCallback.bind(this),context:this.context}),this._events=[],this._eventsArray=[];const e=Rr(Io.getDefaults(),arguments,["callback","events","subdivision"]);this._subdivision=this.toTicks(e.subdivision),this.events=e.events,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.playbackRate=e.playbackRate,this.probability=e.probability,this.humanize=e.humanize,this.mute=e.mute,this.playbackRate=e.playbackRate}static getDefaults(){return Object.assign(Mr(mo.getDefaults(),["value"]),{events:[],loop:!0,loopEnd:0,loopStart:0,subdivision:"8n"})}_seqCallback(e,t){null!==t&&this.callback(e,t)}get events(){return this._events}set events(e){this.clear(),this._eventsArray=e,this._events=this._createSequence(this._eventsArray),this._eventsUpdated()}start(e,t){return this._part.start(e,t?this._indexTime(t):t),this}stop(e){return this._part.stop(e),this}get subdivision(){return new Ui(this.context,this._subdivision).toSeconds()}_createSequence(e){return new Proxy(e,{get:(e,t)=>e[t],set:(e,t,n)=>(br(t)&&isFinite(parseInt(t,10))&&yr(n)?e[t]=this._createSequence(n):e[t]=n,this._eventsUpdated(),!0)})}_eventsUpdated(){this._part.clear(),this._rescheduleSequence(this._eventsArray,this._subdivision,this.startOffset),this.loopEnd=this.loopEnd}_rescheduleSequence(e,t,n){e.forEach(((e,s)=>{const r=s*t+n;if(yr(e))this._rescheduleSequence(e,t/e.length,r);else{const t=new Ui(this.context,r,"i").toSeconds();this._part.add(t,e)}}))}_indexTime(e){return new Ui(this.context,e*this._subdivision+this.startOffset).toSeconds()}clear(){return this._part.clear(),this}dispose(){return super.dispose(),this._part.dispose(),this}get loop(){return this._part.loop}set loop(e){this._part.loop=e}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this._part.loopStart=this._indexTime(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this._part.loopEnd=0===e?this._indexTime(this._eventsArray.length):this._indexTime(e)}get startOffset(){return this._part.startOffset}set startOffset(e){this._part.startOffset=e}get playbackRate(){return this._part.playbackRate}set playbackRate(e){this._part.playbackRate=e}get probability(){return this._part.probability}set probability(e){this._part.probability=e}get progress(){return this._part.progress}get humanize(){return this._part.humanize}set humanize(e){this._part.humanize=e}get length(){return this._part.length}}class To extends Si{constructor(){super(Object.assign(Rr(To.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new Oa({context:this.context}),this.a=new Ti({context:this.context,gain:0}),this.b=new Ti({context:this.context,gain:0}),this.output=new Ti({context:this.context}),this._internalChannels=[this.a,this.b];const e=Rr(To.getDefaults(),arguments,["fade"]);this.fade=new Ri({context:this.context,units:"normalRange",value:e.fade}),Zr(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Ei(this._split,this.a.gain,0),Ei(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(Si.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class No extends Si{constructor(e){super(e),this.name="Effect",this._dryWet=new To({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new Ti({context:this.context}),this.effectReturn=new Ti({context:this.context}),this.input=new Ti({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(e.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Zr(this,"wet")}static getDefaults(){return Object.assign(Si.getDefaults(),{wet:1})}connectEffect(e){return this._internalChannels.push(e),this.effectSend.chain(e,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class Oo extends No{constructor(e){super(e),this.name="LFOEffect",this._lfo=new ka({context:this.context,frequency:e.frequency,amplitude:e.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.type=e.type,Zr(this,["frequency","depth"])}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:1,type:"sine",depth:1})}start(e){return this._lfo.start(e),this}stop(e){return this._lfo.stop(e),this}sync(){return this._lfo.sync(),this}unsync(){return this._lfo.unsync(),this}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class Ro extends Oo{constructor(){super(Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"])),this.name="AutoFilter";const e=Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"]);this.filter=new Ka(Object.assign(e.filter,{context:this.context})),this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.octaves=e.octaves,this.baseFrequency=e.baseFrequency}static getDefaults(){return Object.assign(Oo.getDefaults(),{baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}})}get baseFrequency(){return this._lfo.min}set baseFrequency(e){this._lfo.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._lfo.max=this._lfo.min*Math.pow(2,e)}dispose(){return super.dispose(),this.filter.dispose(),this}}class Do extends Si{constructor(){super(Object.assign(Rr(Do.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=Rr(Do.getDefaults(),arguments,["pan"]);this.pan=new ki({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",Zr(this,"pan")}static getDefaults(){return Object.assign(Si.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}class Mo extends Oo{constructor(){super(Rr(Mo.getDefaults(),arguments,["frequency"])),this.name="AutoPanner";const e=Rr(Mo.getDefaults(),arguments,["frequency"]);this._panner=new Do({context:this.context,channelCount:e.channelCount}),this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this._lfo.min=-1,this._lfo.max=1}static getDefaults(){return Object.assign(Oo.getDefaults(),{channelCount:1})}dispose(){return super.dispose(),this._panner.dispose(),this}}class Fo extends Si{constructor(){super(Rr(Fo.getDefaults(),arguments,["smoothing"])),this.name="Follower";const e=Rr(Fo.getDefaults(),arguments,["smoothing"]);this._abs=this.input=new Na({context:this.context}),this._lowpass=this.output=new uo({context:this.context,frequency:1/this.toSeconds(e.smoothing),type:"lowpass"}),this._abs.connect(this._lowpass),this._smoothing=e.smoothing}static getDefaults(){return Object.assign(Si.getDefaults(),{smoothing:.05})}get smoothing(){return this._smoothing}set smoothing(e){this._smoothing=e,this._lowpass.frequency=1/this.toSeconds(this.smoothing)}dispose(){return super.dispose(),this._abs.dispose(),this._lowpass.dispose(),this}}class Bo extends No{constructor(){super(Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"])),this.name="AutoWah";const e=Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"]);this._follower=new Fo({context:this.context,smoothing:e.follower}),this._sweepRange=new za({context:this.context,min:0,max:1,exponent:.5}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this._inputBoost=new Ti({context:this.context}),this._bandpass=new Ka({context:this.context,rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new Ka({context:this.context,type:"peaking"}),this._peaking.gain.value=e.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this._follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=e.sensitivity,Zr(this,["gain","Q"])}static getDefaults(){return Object.assign(No.getDefaults(),{baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:.2})}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._setSweepRange()}get follower(){return this._follower.smoothing}set follower(e){this._follower.smoothing=e}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){this._baseFrequency=this.toFrequency(e),this._setSweepRange()}get sensitivity(){return oi(1/this._inputBoost.gain.value)}set sensitivity(e){this._inputBoost.gain.value=1/ai(e)}_setSweepRange(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)}dispose(){return super.dispose(),this._follower.dispose(),this._sweepRange.dispose(),this._bandpass.dispose(),this._peaking.dispose(),this._inputBoost.dispose(),this}}const zo="bit-crusher";io(zo,"\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n");class Lo extends No{constructor(){super(Rr(Lo.getDefaults(),arguments,["bits"])),this.name="BitCrusher";const e=Rr(Lo.getDefaults(),arguments,["bits"]);this._bitCrusherWorklet=new Po({context:this.context,bits:e.bits}),this.connectEffect(this._bitCrusherWorklet),this.bits=this._bitCrusherWorklet.bits}static getDefaults(){return Object.assign(No.getDefaults(),{bits:4})}dispose(){return super.dispose(),this._bitCrusherWorklet.dispose(),this}}class Po extends ao{constructor(){super(Rr(Po.getDefaults(),arguments)),this.name="BitCrusherWorklet";const e=Rr(Po.getDefaults(),arguments);this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this.bits=new ki({context:this.context,value:e.bits,units:"positive",minValue:1,maxValue:16,param:this._dummyParam,swappable:!0})}static getDefaults(){return Object.assign(ao.getDefaults(),{bits:12})}_audioWorkletName(){return zo}onReady(e){_i(this.input,e,this.output);const t=e.parameters.get("bits");this.bits.setParam(t)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.bits.dispose(),this}}class Vo extends No{constructor(){super(Rr(Vo.getDefaults(),arguments,["order"])),this.name="Chebyshev";const e=Rr(Vo.getDefaults(),arguments,["order"]);this._shaper=new ha({context:this.context,length:4096}),this._order=e.order,this.connectEffect(this._shaper),this.order=e.order,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{order:1,oversample:"none"})}_getCoefficient(e,t,n){return n.has(t)||(0===t?n.set(t,0):1===t?n.set(t,e):n.set(t,2*e*this._getCoefficient(e,t-1,n)-this._getCoefficient(e,t-2,n))),n.get(t)}get order(){return this._order}set order(e){this._order=e,this._shaper.setMap((t=>this._getCoefficient(t,e,new Map)))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class Wo extends Si{constructor(){super(Rr(Wo.getDefaults(),arguments,["channels"])),this.name="Split";const e=Rr(Wo.getDefaults(),arguments,["channels"]);this._splitter=this.input=this.output=this.context.createChannelSplitter(e.channels),this._internalChannels=[this._splitter]}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._splitter.disconnect(),this}}class Go extends Si{constructor(){super(Rr(Go.getDefaults(),arguments,["channels"])),this.name="Merge";const e=Rr(Go.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Uo extends Si{constructor(e){super(e),this.name="StereoEffect",this.input=new Ti({context:this.context}),this.input.channelCount=2,this.input.channelCountMode="explicit",this._dryWet=this.output=new To({context:this.context,fade:e.wet}),this.wet=this._dryWet.fade,this._split=new Wo({context:this.context,channels:2}),this._merge=new Go({context:this.context,channels:2}),this.input.connect(this._split),this.input.connect(this._dryWet.a),this._merge.connect(this._dryWet.b),Zr(this,["wet"])}connectEffectLeft(...e){this._split.connect(e[0],0,0),_i(...e),Ei(e[e.length-1],this._merge,0,0)}connectEffectRight(...e){this._split.connect(e[0],1,0),_i(...e),Ei(e[e.length-1],this._merge,0,1)}static getDefaults(){return Object.assign(Si.getDefaults(),{wet:1})}dispose(){return super.dispose(),this._dryWet.dispose(),this._split.dispose(),this._merge.dispose(),this}}class qo extends Uo{constructor(e){super(e),this.feedback=new Ri({context:this.context,value:e.feedback,units:"normalRange"}),this._feedbackL=new Ti({context:this.context}),this._feedbackR=new Ti({context:this.context}),this._feedbackSplit=new Wo({context:this.context,channels:2}),this._feedbackMerge=new Go({context:this.context,channels:2}),this._merge.connect(this._feedbackSplit),this._feedbackMerge.connect(this._split),this._feedbackSplit.connect(this._feedbackL,0,0),this._feedbackL.connect(this._feedbackMerge,0,0),this._feedbackSplit.connect(this._feedbackR,1,0),this._feedbackR.connect(this._feedbackMerge,0,1),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),Zr(this,["feedback"])}static getDefaults(){return Object.assign(Uo.getDefaults(),{feedback:.5})}dispose(){return super.dispose(),this.feedback.dispose(),this._feedbackL.dispose(),this._feedbackR.dispose(),this._feedbackSplit.dispose(),this._feedbackMerge.dispose(),this}}class jo extends qo{constructor(){super(Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"])),this.name="Chorus";const e=Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"]);this._depth=e.depth,this._delayTime=e.delayTime/1e3,this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._delayNodeL=new Li({context:this.context}),this._delayNodeR=new Li({context:this.context}),this.frequency=this._lfoL.frequency,Zr(this,["frequency"]),this._lfoL.frequency.connect(this._lfoR.frequency),this.connectEffectLeft(this._delayNodeL),this.connectEffectRight(this._delayNodeR),this._lfoL.connect(this._delayNodeL.delayTime),this._lfoR.connect(this._delayNodeR.delayTime),this.depth=this._depth,this.type=e.type,this.spread=e.spread}static getDefaults(){return Object.assign(qo.getDefaults(),{frequency:1.5,delayTime:3.5,depth:.7,type:"sine",spread:180,feedback:0,wet:.5})}get depth(){return this._depth}set depth(e){this._depth=e;const t=this._delayTime*e;this._lfoL.min=Math.max(this._delayTime-t,0),this._lfoL.max=this._delayTime+t,this._lfoR.min=Math.max(this._delayTime-t,0),this._lfoR.max=this._delayTime+t}get delayTime(){return 1e3*this._delayTime}set delayTime(e){this._delayTime=e/1e3,this.depth=this._depth}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._delayNodeL.dispose(),this._delayNodeR.dispose(),this.frequency.dispose(),this}}class Ho extends No{constructor(){super(Rr(Ho.getDefaults(),arguments,["distortion"])),this.name="Distortion";const e=Rr(Ho.getDefaults(),arguments,["distortion"]);this._shaper=new ha({context:this.context,length:4096}),this._distortion=e.distortion,this.connectEffect(this._shaper),this.distortion=e.distortion,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{distortion:.4,oversample:"none"})}get distortion(){return this._distortion}set distortion(e){this._distortion=e;const t=100*e,n=Math.PI/180;this._shaper.setMap((e=>Math.abs(e)<.001?0:(3+t)*e*20*n/(Math.PI+t*Math.abs(e))))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class $o extends No{constructor(e){super(e),this.name="FeedbackEffect",this._feedbackGain=new Ti({context:this.context,gain:e.feedback,units:"normalRange"}),this.feedback=this._feedbackGain.gain,Zr(this,"feedback"),this.effectReturn.chain(this._feedbackGain,this.effectSend)}static getDefaults(){return Object.assign(No.getDefaults(),{feedback:.125})}dispose(){return super.dispose(),this._feedbackGain.dispose(),this.feedback.dispose(),this}}class Ko extends $o{constructor(){super(Rr(Ko.getDefaults(),arguments,["delayTime","feedback"])),this.name="FeedbackDelay";const e=Rr(Ko.getDefaults(),arguments,["delayTime","feedback"]);this._delayNode=new Li({context:this.context,delayTime:e.delayTime,maxDelay:e.maxDelay}),this.delayTime=this._delayNode.delayTime,this.connectEffect(this._delayNode),Zr(this,"delayTime")}static getDefaults(){return Object.assign($o.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._delayNode.dispose(),this.delayTime.dispose(),this}}class Xo extends Si{constructor(e){super(e),this.name="PhaseShiftAllpass",this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this.offset90=new Ti({context:this.context});this._bank0=this._createAllPassFilterBank([.6923878,.9360654322959,.988229522686,.9987488452737]),this._bank1=this._createAllPassFilterBank([.4021921162426,.856171088242,.9722909545651,.9952884791278]),this._oneSampleDelay=this.context.createIIRFilter([0,1],[1,0]),_i(this.input,...this._bank0,this._oneSampleDelay,this.output),_i(this.input,...this._bank1,this.offset90)}_createAllPassFilterBank(e){return e.map((e=>{const t=[[e*e,0,-1],[1,0,-e*e]];return this.context.createIIRFilter(t[0],t[1])}))}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.offset90.dispose(),this._bank0.forEach((e=>e.disconnect())),this._bank1.forEach((e=>e.disconnect())),this._oneSampleDelay.disconnect(),this}}class Zo extends No{constructor(){super(Rr(Zo.getDefaults(),arguments,["frequency"])),this.name="FrequencyShifter";const e=Rr(Zo.getDefaults(),arguments,["frequency"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency,minValue:-this.context.sampleRate/2,maxValue:this.context.sampleRate/2}),this._sine=new la({context:this.context,type:"sine"}),this._cosine=new ua({context:this.context,phase:-90,type:"sine"}),this._sineMultiply=new pa({context:this.context}),this._cosineMultiply=new pa({context:this.context}),this._negate=new Ra({context:this.context}),this._add=new Aa({context:this.context}),this._phaseShifter=new Xo({context:this.context}),this.effectSend.connect(this._phaseShifter),this.frequency.fan(this._sine.frequency,this._cosine.frequency),this._phaseShifter.offset90.connect(this._cosineMultiply),this._cosine.connect(this._cosineMultiply.factor),this._phaseShifter.connect(this._sineMultiply),this._sine.connect(this._sineMultiply.factor),this._sineMultiply.connect(this._negate),this._cosineMultiply.connect(this._add),this._negate.connect(this._add.addend),this._add.connect(this.effectReturn);const t=this.immediate();this._sine.start(t),this._cosine.start(t)}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:0})}dispose(){return super.dispose(),this.frequency.dispose(),this._add.dispose(),this._cosine.dispose(),this._cosineMultiply.dispose(),this._negate.dispose(),this._phaseShifter.dispose(),this._sine.dispose(),this._sineMultiply.dispose(),this}}const Yo=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100],Qo=[225,556,441,341];class Jo extends Uo{constructor(){super(Rr(Jo.getDefaults(),arguments,["roomSize","dampening"])),this.name="Freeverb",this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];const e=Rr(Jo.getDefaults(),arguments,["roomSize","dampening"]);this.roomSize=new Ri({context:this.context,value:e.roomSize,units:"normalRange"}),this._allpassFiltersL=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._allpassFiltersR=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._combFilters=Yo.map(((t,n)=>{const s=new co({context:this.context,dampening:e.dampening,delayTime:t});return nt.dampening=e))}dispose(){return super.dispose(),this._allpassFiltersL.forEach((e=>e.disconnect())),this._allpassFiltersR.forEach((e=>e.disconnect())),this._combFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this}}const el=[.06748,.06404,.08212,.09004],tl=[.773,.802,.753,.733],nl=[347,113,37];class sl extends Uo{constructor(){super(Rr(sl.getDefaults(),arguments,["roomSize"])),this.name="JCReverb",this._allpassFilters=[],this._feedbackCombFilters=[];const e=Rr(sl.getDefaults(),arguments,["roomSize"]);this.roomSize=new Ri({context:this.context,value:e.roomSize,units:"normalRange"}),this._scaleRoomSize=new xa({context:this.context,min:-.733,max:.197}),this._allpassFilters=nl.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._feedbackCombFilters=el.map(((e,t)=>{const n=new lo({context:this.context,delayTime:e});return this._scaleRoomSize.connect(n.resonance),n.resonance.value=tl[t],te.disconnect())),this._feedbackCombFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this._scaleRoomSize.dispose(),this}}class rl extends qo{constructor(e){super(e),this._feedbackL.disconnect(),this._feedbackL.connect(this._feedbackMerge,0,1),this._feedbackR.disconnect(),this._feedbackR.connect(this._feedbackMerge,0,0),Zr(this,["feedback"])}}class il extends rl{constructor(){super(Rr(il.getDefaults(),arguments,["delayTime","feedback"])),this.name="PingPongDelay";const e=Rr(il.getDefaults(),arguments,["delayTime","feedback"]);this._leftDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightPreDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this.delayTime=new Ri({context:this.context,units:"time",value:e.delayTime}),this.connectEffectLeft(this._leftDelay),this.connectEffectRight(this._rightPreDelay,this._rightDelay),this.delayTime.fan(this._leftDelay.delayTime,this._rightDelay.delayTime,this._rightPreDelay.delayTime),this._feedbackL.disconnect(),this._feedbackL.connect(this._rightDelay),Zr(this,["delayTime"])}static getDefaults(){return Object.assign(rl.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._leftDelay.dispose(),this._rightDelay.dispose(),this._rightPreDelay.dispose(),this.delayTime.dispose(),this}}class al extends $o{constructor(){super(Rr(al.getDefaults(),arguments,["pitch"])),this.name="PitchShift";const e=Rr(al.getDefaults(),arguments,["pitch"]);this._frequency=new Ri({context:this.context}),this._delayA=new Li({maxDelay:1,context:this.context}),this._lfoA=new ka({context:this.context,min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new Li({maxDelay:1,context:this.context}),this._lfoB=new ka({context:this.context,min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new To({context:this.context}),this._crossFadeLFO=new ka({context:this.context,min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new Li({delayTime:e.delayTime,context:this.context}),this.delayTime=this._feedbackDelay.delayTime,Zr(this,"delayTime"),this._pitch=e.pitch,this._windowSize=e.windowSize,this._delayA.connect(this._crossFade.a),this._delayB.connect(this._crossFade.b),this._frequency.fan(this._lfoA.frequency,this._lfoB.frequency,this._crossFadeLFO.frequency),this.effectSend.fan(this._delayA,this._delayB),this._crossFade.chain(this._feedbackDelay,this.effectReturn);const t=this.now();this._lfoA.start(t),this._lfoB.start(t),this._crossFadeLFO.start(t),this.windowSize=this._windowSize}static getDefaults(){return Object.assign($o.getDefaults(),{pitch:0,windowSize:.1,delayTime:0,feedback:0})}get pitch(){return this._pitch}set pitch(e){this._pitch=e;let t=0;e<0?(this._lfoA.min=0,this._lfoA.max=this._windowSize,this._lfoB.min=0,this._lfoB.max=this._windowSize,t=li(e-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,t=li(e)-1),this._frequency.value=t*(1.2/this._windowSize)}get windowSize(){return this._windowSize}set windowSize(e){this._windowSize=this.toSeconds(e),this.pitch=this._pitch}dispose(){return super.dispose(),this._frequency.dispose(),this._delayA.dispose(),this._delayB.dispose(),this._lfoA.dispose(),this._lfoB.dispose(),this._crossFade.dispose(),this._crossFadeLFO.dispose(),this._feedbackDelay.dispose(),this}}class ol extends Uo{constructor(){super(Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"])),this.name="Phaser";const e=Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"]);this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this.Q=new Ri({context:this.context,value:e.Q,units:"positive"}),this._filtersL=this._makeFilters(e.stages,this._lfoL),this._filtersR=this._makeFilters(e.stages,this._lfoR),this.frequency=this._lfoL.frequency,this.frequency.value=e.frequency,this.connectEffectLeft(...this._filtersL),this.connectEffectRight(...this._filtersR),this._lfoL.frequency.connect(this._lfoR.frequency),this.baseFrequency=e.baseFrequency,this.octaves=e.octaves,this._lfoL.start(),this._lfoR.start(),Zr(this,["frequency","Q"])}static getDefaults(){return Object.assign(Uo.getDefaults(),{frequency:.5,octaves:3,stages:10,Q:10,baseFrequency:350})}_makeFilters(e,t){const n=[];for(let s=0;se.disconnect())),this._filtersR.forEach((e=>e.disconnect())),this.frequency.dispose(),this}}class ll extends No{constructor(){super(Rr(ll.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=Rr(ll.getDefaults(),arguments,["decay"]);this._decay=e.decay,this._preDelay=e.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(No.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(e){ir(e=this.toSeconds(e),.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){ir(e=this.toSeconds(e),0),this._preDelay=e,this.generate()}generate(){return Cr(this,void 0,void 0,(function*(){const e=this.ready,t=new ei(2,this._decay+this._preDelay,this.context.sampleRate),n=new na({context:t}),s=new na({context:t}),r=new Go({context:t});n.connect(r,0,0),s.connect(r,0,1);const i=new Ti({context:t}).toDestination();r.connect(i),n.start(0),s.start(0),i.gain.setValueAtTime(0,0),i.gain.setValueAtTime(1,this._preDelay),i.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=t.render();return this.ready=a.then(Qr),yield e,this._convolver.buffer=(yield a).get(),this}))}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class ul extends Si{constructor(){super(Rr(ul.getDefaults(),arguments)),this.name="MidSideSplit",this._split=this.input=new Wo({channels:2,context:this.context}),this._midAdd=new Aa({context:this.context}),this.mid=new pa({context:this.context,value:Math.SQRT1_2}),this._sideSubtract=new Da({context:this.context}),this.side=new pa({context:this.context,value:Math.SQRT1_2}),this._split.connect(this._midAdd,0),this._split.connect(this._midAdd.addend,1),this._split.connect(this._sideSubtract,0),this._split.connect(this._sideSubtract.subtrahend,1),this._midAdd.connect(this.mid),this._sideSubtract.connect(this.side)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midAdd.dispose(),this._sideSubtract.dispose(),this._split.dispose(),this}}class cl extends Si{constructor(){super(Rr(cl.getDefaults(),arguments)),this.name="MidSideMerge",this.mid=new Ti({context:this.context}),this.side=new Ti({context:this.context}),this._left=new Aa({context:this.context}),this._leftMult=new pa({context:this.context,value:Math.SQRT1_2}),this._right=new Da({context:this.context}),this._rightMult=new pa({context:this.context,value:Math.SQRT1_2}),this._merge=this.output=new Go({context:this.context}),this.mid.fan(this._left),this.side.connect(this._left.addend),this.mid.connect(this._right),this.side.connect(this._right.subtrahend),this._left.connect(this._leftMult),this._right.connect(this._rightMult),this._leftMult.connect(this._merge,0,0),this._rightMult.connect(this._merge,0,1)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._leftMult.dispose(),this._rightMult.dispose(),this._left.dispose(),this._right.dispose(),this}}class hl extends No{constructor(e){super(e),this.name="MidSideEffect",this._midSideMerge=new cl({context:this.context}),this._midSideSplit=new ul({context:this.context}),this._midSend=this._midSideSplit.mid,this._sideSend=this._midSideSplit.side,this._midReturn=this._midSideMerge.mid,this._sideReturn=this._midSideMerge.side,this.effectSend.connect(this._midSideSplit),this._midSideMerge.connect(this.effectReturn)}connectEffectMid(...e){this._midSend.chain(...e,this._midReturn)}connectEffectSide(...e){this._sideSend.chain(...e,this._sideReturn)}dispose(){return super.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this._midSend.dispose(),this._sideSend.dispose(),this._midReturn.dispose(),this._sideReturn.dispose(),this}}class dl extends hl{constructor(){super(Rr(dl.getDefaults(),arguments,["width"])),this.name="StereoWidener";const e=Rr(dl.getDefaults(),arguments,["width"]);this.width=new Ri({context:this.context,value:e.width,units:"normalRange"}),Zr(this,["width"]),this._twoTimesWidthMid=new pa({context:this.context,value:2}),this._twoTimesWidthSide=new pa({context:this.context,value:2}),this._midMult=new pa({context:this.context}),this._twoTimesWidthMid.connect(this._midMult.factor),this.connectEffectMid(this._midMult),this._oneMinusWidth=new Da({context:this.context}),this._oneMinusWidth.connect(this._twoTimesWidthMid),Ei(this.context.getConstant(1),this._oneMinusWidth),this.width.connect(this._oneMinusWidth.subtrahend),this._sideMult=new pa({context:this.context}),this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult.factor),this.connectEffectSide(this._sideMult)}static getDefaults(){return Object.assign(hl.getDefaults(),{width:.5})}dispose(){return super.dispose(),this.width.dispose(),this._midMult.dispose(),this._sideMult.dispose(),this._twoTimesWidthMid.dispose(),this._twoTimesWidthSide.dispose(),this._oneMinusWidth.dispose(),this}}class pl extends Uo{constructor(){super(Rr(pl.getDefaults(),arguments,["frequency","depth"])),this.name="Tremolo";const e=Rr(pl.getDefaults(),arguments,["frequency","depth"]);this._lfoL=new ka({context:this.context,type:e.type,min:1,max:0}),this._lfoR=new ka({context:this.context,type:e.type,min:1,max:0}),this._amplitudeL=new Ti({context:this.context}),this._amplitudeR=new Ti({context:this.context}),this.frequency=new Ri({context:this.context,value:e.frequency,units:"frequency"}),this.depth=new Ri({context:this.context,value:e.depth,units:"normalRange"}),Zr(this,["frequency","depth"]),this.connectEffectLeft(this._amplitudeL),this.connectEffectRight(this._amplitudeR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.spread=e.spread}static getDefaults(){return Object.assign(Uo.getDefaults(),{frequency:10,type:"sine",depth:.5,spread:180})}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this.context.transport.syncSignal(this.frequency),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this.context.transport.unsyncSignal(this.frequency),this}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._amplitudeL.dispose(),this._amplitudeR.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class fl extends No{constructor(){super(Rr(fl.getDefaults(),arguments,["frequency","depth"])),this.name="Vibrato";const e=Rr(fl.getDefaults(),arguments,["frequency","depth"]);this._delayNode=new Li({context:this.context,delayTime:0,maxDelay:e.maxDelay}),this._lfo=new ka({context:this.context,type:e.type,min:0,max:e.maxDelay,frequency:e.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=e.depth,Zr(this,["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)}static getDefaults(){return Object.assign(No.getDefaults(),{maxDelay:.005,frequency:5,depth:.1,type:"sine"})}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._delayNode.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class ml extends Si{constructor(){super(Rr(ml.getDefaults(),arguments,["type","size"])),this.name="Analyser",this._analysers=[],this._buffers=[];const e=Rr(ml.getDefaults(),arguments,["type","size"]);this.input=this.output=this._gain=new Ti({context:this.context}),this._split=new Wo({context:this.context,channels:e.channels}),this.input.connect(this._split),ir(e.channels,1);for(let t=0;t{const n=this._buffers[t];"fft"===this._type?e.getFloatFrequencyData(n):"waveform"===this._type&&e.getFloatTimeDomainData(n)})),1===this.channels?this._buffers[0]:this._buffers}get size(){return this._analysers[0].frequencyBinCount}set size(e){this._analysers.forEach(((t,n)=>{t.fftSize=2*e,this._buffers[n]=new Float32Array(e)}))}get channels(){return this._analysers.length}get type(){return this._type}set type(e){rr("waveform"===e||"fft"===e,`Analyser: invalid type: ${e}`),this._type=e}get smoothing(){return this._analysers[0].smoothingTimeConstant}set smoothing(e){this._analysers.forEach((t=>t.smoothingTimeConstant=e))}dispose(){return super.dispose(),this._analysers.forEach((e=>e.disconnect())),this._split.dispose(),this._gain.dispose(),this}}class gl extends Si{constructor(){super(Rr(gl.getDefaults(),arguments)),this.name="MeterBase",this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform"})}dispose(){return super.dispose(),this._analyser.dispose(),this}}class yl extends gl{constructor(){super(Rr(yl.getDefaults(),arguments,["smoothing"])),this.name="Meter",this._rms=0;const e=Rr(yl.getDefaults(),arguments,["smoothing"]);this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform",channels:e.channels}),this.smoothing=e.smoothing,this.normalRange=e.normalRange}static getDefaults(){return Object.assign(gl.getDefaults(),{smoothing:.8,normalRange:!1,channels:1})}getLevel(){return cr("'getLevel' has been changed to 'getValue'"),this.getValue()}getValue(){const e=this._analyser.getValue(),t=(1===this.channels?[e]:e).map((e=>{const t=e.reduce(((e,t)=>e+t*t),0),n=Math.sqrt(t/e.length);return this._rms=Math.max(n,this._rms*this.smoothing),this.normalRange?this._rms:oi(this._rms)}));return 1===this.channels?t[0]:t}get channels(){return this._analyser.channels}dispose(){return super.dispose(),this._analyser.dispose(),this}}class bl extends gl{constructor(){super(Rr(bl.getDefaults(),arguments,["size"])),this.name="FFT";const e=Rr(bl.getDefaults(),arguments,["size"]);this.normalRange=e.normalRange,this._analyser.type="fft",this.size=e.size}static getDefaults(){return Object.assign(Si.getDefaults(),{normalRange:!1,size:1024,smoothing:.8})}getValue(){return this._analyser.getValue().map((e=>this.normalRange?ai(e):e))}get size(){return this._analyser.size}set size(e){this._analyser.size=e}get smoothing(){return this._analyser.smoothing}set smoothing(e){this._analyser.smoothing=e}getFrequencyOfIndex(e){return rr(0<=e&&ee._updateSolo()))}get muted(){return 0===this.input.gain.value}_addSolo(){Al._soloed.has(this.context)||Al._soloed.set(this.context,new Set),Al._soloed.get(this.context).add(this)}_removeSolo(){Al._soloed.has(this.context)&&Al._soloed.get(this.context).delete(this)}_isSoloed(){return Al._soloed.has(this.context)&&Al._soloed.get(this.context).has(this)}_noSolos(){return!Al._soloed.has(this.context)||Al._soloed.has(this.context)&&0===Al._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Al._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Al._allSolos=new Map,Al._soloed=new Map;class xl extends Si{constructor(){super(Rr(xl.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=Rr(xl.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Do({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ki({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Cl extends Si{constructor(){super(Rr(Cl.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=Rr(Cl.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Al({solo:e.solo,context:this.context}),this._panVol=this.output=new xl({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Si.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return Cl.buses.has(e)||Cl.buses.set(e,new Ti({context:this.context})),Cl.buses.get(e)}send(e,t=0){const n=this._getBus(e),s=new Ti({context:this.context,units:"decibels",gain:t});return this.connect(s),s.connect(n),s}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Cl.buses=new Map;class kl extends Si{constructor(){super(Rr(kl.getDefaults(),arguments)),this.name="Mono",this.input=new Ti({context:this.context}),this._merge=this.output=new Go({channels:2,context:this.context}),this.input.connect(this._merge,0,0),this.input.connect(this._merge,0,1)}dispose(){return super.dispose(),this._merge.dispose(),this.input.dispose(),this}}class Sl extends Si{constructor(){super(Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"])),this.name="MultibandSplit",this.input=new Ti({context:this.context}),this.output=void 0,this.low=new Ka({context:this.context,frequency:0,type:"lowpass"}),this._lowMidFilter=new Ka({context:this.context,frequency:0,type:"highpass"}),this.mid=new Ka({context:this.context,frequency:0,type:"lowpass"}),this.high=new Ka({context:this.context,frequency:0,type:"highpass"}),this._internalChannels=[this.low,this.mid,this.high];const e=Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"]);this.lowFrequency=new Ri({context:this.context,units:"frequency",value:e.lowFrequency}),this.highFrequency=new Ri({context:this.context,units:"frequency",value:e.highFrequency}),this.Q=new Ri({context:this.context,units:"positive",value:e.Q}),this.input.fan(this.low,this.high),this.input.chain(this._lowMidFilter,this.mid),this.lowFrequency.fan(this.low.frequency,this._lowMidFilter.frequency),this.highFrequency.fan(this.mid.frequency,this.high.frequency),this.Q.connect(this.low.Q),this.Q.connect(this._lowMidFilter.Q),this.Q.connect(this.mid.Q),this.Q.connect(this.high.Q),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Si.getDefaults(),{Q:1,highFrequency:2500,lowFrequency:400})}dispose(){return super.dispose(),Yr(this,["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this._lowMidFilter.dispose(),this.mid.dispose(),this.high.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this.Q.dispose(),this}}class _l extends Si{constructor(){super(...arguments),this.name="Listener",this.positionX=new ki({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new ki({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new ki({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new ki({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new ki({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new ki({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new ki({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new ki({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new ki({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(Si.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}qr((e=>{e.listener=new _l({context:e})})),Hr((e=>{e.listener.dispose()}));class El extends Si{constructor(){super(Rr(El.getDefaults(),arguments,["positionX","positionY","positionZ"])),this.name="Panner3D";const e=Rr(El.getDefaults(),arguments,["positionX","positionY","positionZ"]);this._panner=this.input=this.output=this.context.createPanner(),this.panningModel=e.panningModel,this.maxDistance=e.maxDistance,this.distanceModel=e.distanceModel,this.coneOuterGain=e.coneOuterGain,this.coneOuterAngle=e.coneOuterAngle,this.coneInnerAngle=e.coneInnerAngle,this.refDistance=e.refDistance,this.rolloffFactor=e.rolloffFactor,this.positionX=new ki({context:this.context,param:this._panner.positionX,value:e.positionX}),this.positionY=new ki({context:this.context,param:this._panner.positionY,value:e.positionY}),this.positionZ=new ki({context:this.context,param:this._panner.positionZ,value:e.positionZ}),this.orientationX=new ki({context:this.context,param:this._panner.orientationX,value:e.orientationX}),this.orientationY=new ki({context:this.context,param:this._panner.orientationY,value:e.orientationY}),this.orientationZ=new ki({context:this.context,param:this._panner.orientationZ,value:e.orientationZ})}static getDefaults(){return Object.assign(Si.getDefaults(),{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:0,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1})}setPosition(e,t,n){return this.positionX.value=e,this.positionY.value=t,this.positionZ.value=n,this}setOrientation(e,t,n){return this.orientationX.value=e,this.orientationY.value=t,this.orientationZ.value=n,this}get panningModel(){return this._panner.panningModel}set panningModel(e){this._panner.panningModel=e}get refDistance(){return this._panner.refDistance}set refDistance(e){this._panner.refDistance=e}get rolloffFactor(){return this._panner.rolloffFactor}set rolloffFactor(e){this._panner.rolloffFactor=e}get distanceModel(){return this._panner.distanceModel}set distanceModel(e){this._panner.distanceModel=e}get coneInnerAngle(){return this._panner.coneInnerAngle}set coneInnerAngle(e){this._panner.coneInnerAngle=e}get coneOuterAngle(){return this._panner.coneOuterAngle}set coneOuterAngle(e){this._panner.coneOuterAngle=e}get coneOuterGain(){return this._panner.coneOuterGain}set coneOuterGain(e){this._panner.coneOuterGain=e}get maxDistance(){return this._panner.maxDistance}set maxDistance(e){this._panner.maxDistance=e}dispose(){return super.dispose(),this._panner.disconnect(),this.orientationX.dispose(),this.orientationY.dispose(),this.orientationZ.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this}}class Il extends Si{constructor(){super(Rr(Il.getDefaults(),arguments)),this.name="Recorder";const e=Rr(Il.getDefaults(),arguments);this.input=new Ti({context:this.context}),rr(Il.supported,"Media Recorder API is not available"),this._stream=this.context.createMediaStreamDestination(),this.input.connect(this._stream),this._recorder=new MediaRecorder(this._stream.stream,{mimeType:e.mimeType})}static getDefaults(){return Si.getDefaults()}get mimeType(){return this._recorder.mimeType}static get supported(){return null!==vr&&Reflect.has(vr,"MediaRecorder")}get state(){return"inactive"===this._recorder.state?"stopped":"paused"===this._recorder.state?"paused":"started"}start(){return Cr(this,void 0,void 0,(function*(){rr("started"!==this.state,"Recorder is already started");const e=new Promise((e=>{const t=()=>{this._recorder.removeEventListener("start",t,!1),e()};this._recorder.addEventListener("start",t,!1)}));return this._recorder.start(),yield e}))}stop(){return Cr(this,void 0,void 0,(function*(){rr("stopped"!==this.state,"Recorder is not started");const e=new Promise((e=>{const t=n=>{this._recorder.removeEventListener("dataavailable",t,!1),e(n.data)};this._recorder.addEventListener("dataavailable",t,!1)}));return this._recorder.stop(),yield e}))}pause(){return rr("started"===this.state,"Recorder must be started"),this._recorder.pause(),this}dispose(){return super.dispose(),this.input.dispose(),this._stream.disconnect(),this}}class Tl extends Si{constructor(){super(Rr(Tl.getDefaults(),arguments,["threshold","ratio"])),this.name="Compressor",this._compressor=this.context.createDynamicsCompressor(),this.input=this._compressor,this.output=this._compressor;const e=Rr(Tl.getDefaults(),arguments,["threshold","ratio"]);this.threshold=new ki({minValue:this._compressor.threshold.minValue,maxValue:this._compressor.threshold.maxValue,context:this.context,convert:!1,param:this._compressor.threshold,units:"decibels",value:e.threshold}),this.attack=new ki({minValue:this._compressor.attack.minValue,maxValue:this._compressor.attack.maxValue,context:this.context,param:this._compressor.attack,units:"time",value:e.attack}),this.release=new ki({minValue:this._compressor.release.minValue,maxValue:this._compressor.release.maxValue,context:this.context,param:this._compressor.release,units:"time",value:e.release}),this.knee=new ki({minValue:this._compressor.knee.minValue,maxValue:this._compressor.knee.maxValue,context:this.context,convert:!1,param:this._compressor.knee,units:"decibels",value:e.knee}),this.ratio=new ki({minValue:this._compressor.ratio.minValue,maxValue:this._compressor.ratio.maxValue,context:this.context,convert:!1,param:this._compressor.ratio,units:"positive",value:e.ratio}),Zr(this,["knee","release","attack","ratio","threshold"])}static getDefaults(){return Object.assign(Si.getDefaults(),{attack:.003,knee:30,ratio:12,release:.25,threshold:-24})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.disconnect(),this.attack.dispose(),this.release.dispose(),this.threshold.dispose(),this.ratio.dispose(),this.knee.dispose(),this}}class Nl extends Si{constructor(){super(Object.assign(Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]))),this.name="Gate";const e=Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]);this._follower=new Fo({context:this.context,smoothing:e.smoothing}),this._gt=new Fa({context:this.context,value:ai(e.threshold)}),this.input=new Ti({context:this.context}),this._gate=this.output=new Ti({context:this.context}),this.input.connect(this._gate),this.input.chain(this._follower,this._gt,this._gate.gain)}static getDefaults(){return Object.assign(Si.getDefaults(),{smoothing:.1,threshold:-40})}get threshold(){return oi(this._gt.value)}set threshold(e){this._gt.value=ai(e)}get smoothing(){return this._follower.smoothing}set smoothing(e){this._follower.smoothing=e}dispose(){return super.dispose(),this.input.dispose(),this._follower.dispose(),this._gt.dispose(),this._gate.dispose(),this}}class Ol extends Si{constructor(){super(Object.assign(Rr(Ol.getDefaults(),arguments,["threshold"]))),this.name="Limiter";const e=Rr(Ol.getDefaults(),arguments,["threshold"]);this._compressor=this.input=this.output=new Tl({context:this.context,ratio:20,attack:.003,release:.01,threshold:e.threshold}),this.threshold=this._compressor.threshold,Zr(this,"threshold")}static getDefaults(){return Object.assign(Si.getDefaults(),{threshold:-12})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.dispose(),this.threshold.dispose(),this}}class Rl extends Si{constructor(){super(Object.assign(Rr(Rl.getDefaults(),arguments))),this.name="MidSideCompressor";const e=Rr(Rl.getDefaults(),arguments);this._midSideSplit=this.input=new ul({context:this.context}),this._midSideMerge=this.output=new cl({context:this.context}),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.side=new Tl(Object.assign(e.side,{context:this.context})),this._midSideSplit.mid.chain(this.mid,this._midSideMerge.mid),this._midSideSplit.side.chain(this.side,this._midSideMerge.side),Zr(this,["mid","side"])}static getDefaults(){return Object.assign(Si.getDefaults(),{mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},side:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10}})}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this}}class Dl extends Si{constructor(){super(Object.assign(Rr(Dl.getDefaults(),arguments))),this.name="MultibandCompressor";const e=Rr(Dl.getDefaults(),arguments);this._splitter=this.input=new Sl({context:this.context,lowFrequency:e.lowFrequency,highFrequency:e.highFrequency}),this.lowFrequency=this._splitter.lowFrequency,this.highFrequency=this._splitter.highFrequency,this.output=new Ti({context:this.context}),this.low=new Tl(Object.assign(e.low,{context:this.context})),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.high=new Tl(Object.assign(e.high,{context:this.context})),this._splitter.low.chain(this.low,this.output),this._splitter.mid.chain(this.mid,this.output),this._splitter.high.chain(this.high,this.output),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Si.getDefaults(),{lowFrequency:250,highFrequency:2e3,low:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10},mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},high:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16}})}dispose(){return super.dispose(),this._splitter.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.output.dispose(),this}}class Ml extends Si{constructor(){super(Rr(Ml.getDefaults(),arguments,["low","mid","high"])),this.name="EQ3",this.output=new Ti({context:this.context}),this._internalChannels=[];const e=Rr(Ml.getDefaults(),arguments,["low","mid","high"]);this.input=this._multibandSplit=new Sl({context:this.context,highFrequency:e.highFrequency,lowFrequency:e.lowFrequency}),this._lowGain=new Ti({context:this.context,gain:e.low,units:"decibels"}),this._midGain=new Ti({context:this.context,gain:e.mid,units:"decibels"}),this._highGain=new Ti({context:this.context,gain:e.high,units:"decibels"}),this.low=this._lowGain.gain,this.mid=this._midGain.gain,this.high=this._highGain.gain,this.Q=this._multibandSplit.Q,this.lowFrequency=this._multibandSplit.lowFrequency,this.highFrequency=this._multibandSplit.highFrequency,this._multibandSplit.low.chain(this._lowGain,this.output),this._multibandSplit.mid.chain(this._midGain,this.output),this._multibandSplit.high.chain(this._highGain,this.output),Zr(this,["low","mid","high","lowFrequency","highFrequency"]),this._internalChannels=[this._multibandSplit]}static getDefaults(){return Object.assign(Si.getDefaults(),{high:0,highFrequency:2500,low:0,lowFrequency:400,mid:0})}dispose(){return super.dispose(),Yr(this,["low","mid","high","lowFrequency","highFrequency"]),this._multibandSplit.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this._lowGain.dispose(),this._midGain.dispose(),this._highGain.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.Q.dispose(),this}}class Fl extends Si{constructor(){super(Rr(Fl.getDefaults(),arguments,["url","onload"])),this.name="Convolver",this._convolver=this.context.createConvolver();const e=Rr(Fl.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr(e.url,(t=>{this.buffer=t,e.onload()})),this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this._buffer.loaded&&(this.buffer=this._buffer),this.normalize=e.normalize,this.input.chain(this._convolver,this.output)}static getDefaults(){return Object.assign(Si.getDefaults(),{normalize:!0,onload:Qr})}load(e){return Cr(this,void 0,void 0,(function*(){this.buffer=yield this._buffer.load(e)}))}get buffer(){return this._buffer.length?this._buffer:null}set buffer(e){e&&this._buffer.set(e),this._convolver.buffer&&(this.input.disconnect(),this._convolver.disconnect(),this._convolver=this.context.createConvolver(),this.input.chain(this._convolver,this.output));const t=this._buffer.get();this._convolver.buffer=t||null}get normalize(){return this._convolver.normalize}set normalize(e){this._convolver.normalize=e}dispose(){return super.dispose(),this._buffer.dispose(),this._convolver.disconnect(),this}}function Bl(){return si().now()}function zl(){return si().immediate()}const Ll=si().transport;function Pl(){return si().transport}const Vl=si().destination,Wl=si().destination;function Gl(){return si().destination}const Ul=si().listener;function ql(){return si().listener}const jl=si().draw;function Hl(){return si().draw}const $l=si();function Kl(){return Jr.loaded()}const Xl=Jr,Zl=Vi,Yl=ta},8990:function(e,t,n){(function(){"use strict";var e;function t(e){var t=0;return function(){return t>>0)+"_",r=0;return function e(s){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(s||"")+"_"+r++,s)}})),i("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i(t=t||0)&&(t=Math.max(t+s,0));ti)s[n++]=i;else{if(2048>i)s[n++]=i>>6|192;else{if(55296<=i&&57343>=i){if(56319>=i&&r=a){i=1024*(i-55296)+a-56320+65536,s[n++]=i>>18|240,s[n++]=i>>12&63|128,s[n++]=i>>6&63|128,s[n++]=63&i|128;continue}r--}if(t)throw Error("Found an unpaired surrogate");i=65533}s[n++]=i>>12|224,s[n++]=i>>6&63|128}s[n++]=63&i|128}}e=s.subarray(0,n)}return e}var D={},M=null;function F(e,t){void 0===t&&(t=0),z(),t=D[t];for(var n=Array(Math.floor(e.length/3)),s=t[64]||"",r=0,i=0;r>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=u+a+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function B(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<6&192|o))}}(e,(function(e){s[r++]=e})),s.subarray(0,r)}function z(){if(!M){M={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));D[n]=s;for(var r=0;rr&&128<=t;r++)n|=(127&(t=e.h[e.g++]))<<7*r;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,s|=(127&t)>>4),128<=t)for(r=0;5>r&&128<=t;r++)s|=(127&(t=e.h[e.g++]))<<7*r+3;if(128>t)return e=n>>>0,(s=2147483648&(t=s>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),s?-e:e;e.m=!0}G.prototype.reset=function(){this.g=this.l},G.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},G.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],s=this.h[this.g+3];return this.g+=4,e=2*((n=(e|t<<8|n<<16|s<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var j=[];function H(){this.g=new Uint8Array(64),this.h=0}function $(e,t){for(;127>>=7;e.push(t)}function K(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,j.length?(n=j.pop(),t&&(n.v=t.v),e&&U(n,e),e=n):e=new G(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function X(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function Z(e){switch(e.h){case 0:if(0!=e.h)Z(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Z(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Z(e);else{var t=e.g.i();(e=e.g).g+=t}break;case 5:5!=e.h?Z(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!X(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Z(e)}break;default:e.j=!0}}function Y(e,t,n){var s=e.g.j,r=e.g.i(),i=e.g.g+r;if(e.g.j=i,n(t,e),0!==(n=i-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.j=s,t}function Q(e){return e.g.o()}function J(e){var t,n=e.g.i(),s=(e=e.g).g;if(e.g+=n,e=e.h,N)(t=I)||(t=I=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(s,s+n));else{n=s+n;for(var r,i,a,o=[],l=null;s(r=e[s++])?o.push(r):224>r?s>=n?o.push(65533):(i=e[s++],194>r||128!=(192&i)?(s--,o.push(65533)):o.push((31&r)<<6|63&i)):240>r?s>=n-1?o.push(65533):128!=(192&(i=e[s++]))||224===r&&160>i||237===r&&160<=i||128!=(192&(t=e[s++]))?(s--,o.push(65533)):o.push((15&r)<<12|(63&i)<<6|63&t):244>=r?s>=n-2?o.push(65533):128!=(192&(i=e[s++]))||i-144+(r<<28)>>30||128!=(192&(t=e[s++]))||128!=(192&(a=e[s++]))?(s--,o.push(65533)):(r=(7&r)<<18|(63&i)<<12|(63&t)<<6|63&a,r-=65536,o.push(55296+(r>>10&1023),56320+(1023&r))):o.push(65533),8192<=o.length&&(l=E(l,o),o.length=0);t=E(l,o)}return t}function ee(e,t,n){var s=e.g.i();for(s=e.g.g+s;e.g.gs?1:0)?-s:s)?0<1/s?W=0:(0,W=2147483648):isNaN(s)?(0,W=2147483647):34028234663852886e22>>0):11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),0,W=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,0,W=(n<<31|t+127<<23|8388607&s)>>>0),n=W,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}H.prototype.push=function(e){if(!(this.h+1=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ye(e,t){var n=void 0!==n&&n,s=ge(e,t,n);return null==s&&(s=fe),s===fe&&Ae(e,t,s=de([]),n),s}function be(e){var t=ye(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n=e.l?(me(e),e.i[t]=n):e.h[t+e.j]=n}function xe(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var s=ge(e,n,!1);s&&(e.g[n]=new t(s))}return e.g[n]}function Ce(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var s=ye(e,1);n=[];for(var r=0;rE;var I=(E=Math.abs(E))>>>0;for(E=Math.floor((E-I)/4294967296),E>>>=0,S&&(E=~E>>>0,4294967295<(I=1+(~I>>>0))&&(I=0,4294967295<++E&&(E=0))),S=W=I,I=E;0>>7|I<<25)>>>0,I>>>=7;_.push(S)}if(Ee(C,k),x=re(x),v.call(w,A,x),y.O)for(w=0;wE;E++)S.push(127&I|128),I>>=7;S.push(1)}ie(_,2,ge(k,2)),null!=(S=ge(k,3))&&(S=R(S),$(_.g,26),$(_.g,S.length),se(_,_.g.end()),se(_,S)),null!=(S=ge(k,4))&&(S=R(S),$(_.g,34),$(_.g,S.length),se(_,_.g.end()),se(_,S)),Ee(k,_),C=re(C),A.call(v,x,C)}}f=f.data;break e;default:f={}}}switch(c=f,h=u.stream,u.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:h,timestamp:s}));break;case"detections":(d=c).stream=h,d.timestamp=s,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return p.i.send(r),b(n,p.C,4);case 4:r.delete(),n.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},_("Solution",nt),_("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var lt={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(ot)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return Ce(Ve(e),ze).map(Xe)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ut=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],ct=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],ht=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],dt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],pt=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ft=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],mt=[].concat(l(ut),l(ct),l(ht),l(dt),l(pt),l(ft));function gt(e){e=e||{},e=Object.assign(Object.assign({},lt),e),this.g=new nt(e)}(e=gt.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Re(this,(function e(){var t=this;return C(e,(function(e){return b(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Re(this,(function t(){var n=this;return C(t,(function(t){return b(t,n.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},_("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),_("FaceMesh",gt),_("FACEMESH_LIPS",ut),_("FACEMESH_LEFT_EYE",ct),_("FACEMESH_LEFT_EYEBROW",ht),_("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),_("FACEMESH_RIGHT_EYE",dt),_("FACEMESH_RIGHT_EYEBROW",pt),_("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),_("FACEMESH_FACE_OVAL",ft),_("FACEMESH_CONTOURS",mt),_("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),_("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),s=e.getPackedDataList(),r=[],i=0;i{e.exports=function e(t,n,s){function r(a,o){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){var n=t[a][1][e];return r(n||e)}),u,u.exports,e,t,n,s)}return n[a].exports}for(var i=void 0,a=0;a=43)}})).catch((function(){return!1}))}function x(e){return"boolean"==typeof m?u.resolve(m):A(e).then((function(e){return m=e}))}function C(e){var t=g[e.name],n={};n.promise=new u((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function k(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new u((function(n,s){if(g[e.name]=g[e.name]||B(),e.db){if(!t)return n(e.db);C(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var i=a.open.apply(a,r);t&&(i.onupgradeneeded=function(t){var n=i.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(e){if("ConstraintError"!==e.name)throw e}}),i.onerror=function(e){e.preventDefault(),s(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},n(t),k(e)}}))}function E(e){return _(e,!1)}function I(e){return _(e,!0)}function T(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),s=e.versione.db.version;if(s&&(e.version,e.version=e.db.version),r||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function N(e){return new u((function(t,n){var s=new FileReader;s.onerror=n,s.onloadend=function(n){var s=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:s,type:e.type})},s.readAsBinaryString(e)}))}function O(e){return l([v(atob(e.data))],{type:e.type})}function R(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return h(n,e,e),n}function M(e){C(e);for(var t=g[e.name],n=t.forages,s=0;s0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),I(e)})).then((function(){return M(e).then((function(){F(e,t,n,s-1)}))})).catch(n);n(r)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function z(e){var t=this,n={db:null};if(e)for(var s in e)n[s]=e[s];var r=g[n.name];r||(r=B(),g[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var i=[];function a(){return u.resolve()}for(var o=0;o>4,c[l++]=(15&s)<<4|r>>2,c[l++]=(3&r)<<6|63&i;return u}function fe(e){var t,n=new Uint8Array(e),s="";for(t=0;t>2],s+=X[(3&n[t])<<4|n[t+1]>>4],s+=X[(15&n[t+1])<<2|n[t+2]>>6],s+=X[63&n[t+2]];return n.length%3==2?s=s.substring(0,s.length-1)+"=":n.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}function me(e,t){var n="";if(e&&(n=de.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===de.call(e.buffer))){var s,r=Q;e instanceof ArrayBuffer?(s=e,r+=ee):(s=e.buffer,"[object Int8Array]"===n?r+=ne:"[object Uint8Array]"===n?r+=se:"[object Uint8ClampedArray]"===n?r+=re:"[object Int16Array]"===n?r+=ie:"[object Uint16Array]"===n?r+=oe:"[object Int32Array]"===n?r+=ae:"[object Uint32Array]"===n?r+=le:"[object Float32Array]"===n?r+=ue:"[object Float64Array]"===n?r+=ce:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(s))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n=Z+e.type+"~"+fe(this.result);t(Q+te+n)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(e){t(null,e)}}function ge(e){if(e.substring(0,J)!==Q)return JSON.parse(e);var t,n=e.substring(he),s=e.substring(J,he);if(s===te&&Y.test(n)){var r=n.match(Y);t=r[1],n=n.substring(r[0].length)}var i=pe(n);switch(s){case ee:return i;case te:return l([i],{type:t});case ne:return new Int8Array(i);case se:return new Uint8Array(i);case re:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case oe:return new Uint16Array(i);case ae:return new Int32Array(i);case le:return new Uint32Array(i);case ue:return new Float32Array(i);case ce:return new Float64Array(i);default:throw new Error("Unkown type: "+s)}}var ye={serialize:me,deserialize:ge,stringToBuffer:pe,bufferToString:fe};function be(e,t,n,s){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,s)}function we(e){var t=this,n={db:null};if(e)for(var s in e)n[s]="string"!=typeof e[s]?e[s].toString():e[s];var r=new u((function(e,s){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return s(e)}n.db.transaction((function(r){be(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){s(t)}))}),s)}));return n.serializer=ye,r}function ve(e,t,n,s,r,i){e.executeSql(n,s,r,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?i(e,a):be(e,t,(function(){e.executeSql(n,s,r,i)}),i)}),i):i(e,a)}),i)}function Ae(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var s=n.rows.length?n.rows.item(0).value:null;s&&(s=r.serializer.deserialize(s)),t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function xe(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName,[],(function(n,s){for(var i=s.rows,a=i.length,o=0;o0)return void i(Ce.apply(r,[e,o,n,s-1]));a(t)}}))}))})).catch(a)}));return c(i,n),i}function ke(e,t,n){return Ce.apply(this,[e,t,n,1])}function Se(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function _e(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"DELETE FROM "+s.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Ee(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT COUNT(key) as c FROM "+s.storeName,[],(function(t,n){var s=n.rows.item(0).c;e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Ie(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var s=n.rows.length?n.rows.item(0).key:null;t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Te(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT key FROM "+s.storeName,[],(function(t,n){for(var s=[],r=0;r '__WebKitDatabaseInfoTable__'",[],(function(n,s){for(var r=[],i=0;i0}function ze(e){var t=this,n={};if(e)for(var s in e)n[s]=e[s];return n.keyPrefix=Me(e,t._defaultConfig),Be()?(t._dbInfo=n,n.serializer=ye,u.resolve()):u.reject()}function Le(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var s=localStorage.key(n);0===s.indexOf(e)&&localStorage.removeItem(s)}}));return c(n,e),n}function Pe(e,t){var n=this;e=d(e);var s=n.ready().then((function(){var t=n._dbInfo,s=localStorage.getItem(t.keyPrefix+e);return s&&(s=t.serializer.deserialize(s)),s}));return c(s,t),s}function Ve(e,t){var n=this,s=n.ready().then((function(){for(var t=n._dbInfo,s=t.keyPrefix,r=s.length,i=localStorage.length,a=1,o=0;o=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):u.reject("Invalid arguments"),c(s,t),s}var $e={_driver:"localStorageWrapper",_initStorage:ze,_support:De(),iterate:Ve,getItem:Pe,setItem:je,removeItem:qe,clear:Le,length:Ue,key:We,keys:Ge,dropInstance:He},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Xe=function(e,t){for(var n=e.length,s=0;s{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function s(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=s;var r={},i={};function a(e,t){var n,s,a;return t?(a=0<=(e>>>=0)&&e<256)&&(s=i[e])?s:(n=l(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=l(e,e<0?-1:0,!1),a&&(r[e]=n),n)}function o(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=p)return x}else{if(e<=-f)return C;if(e+1>=f)return A}return e<0?o(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,s){return new n(e,t,s)}n.fromInt=a,n.fromNumber=o,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return c(e.substring(1),t,n).neg();for(var r=o(u(n,8)),i=g,a=0;a>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},k.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=l).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<=0},k.isOdd=function(){return!(1&~this.low)},k.isEven=function(){return!(1&this.low)},k.equals=function(e){return s(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},k.eq=k.equals,k.notEquals=function(e){return!this.eq(e)},k.neq=k.notEquals,k.ne=k.notEquals,k.lessThan=function(e){return this.comp(e)<0},k.lt=k.lessThan,k.lessThanOrEqual=function(e){return this.comp(e)<=0},k.lte=k.lessThanOrEqual,k.le=k.lessThanOrEqual,k.greaterThan=function(e){return this.comp(e)>0},k.gt=k.greaterThan,k.greaterThanOrEqual=function(e){return this.comp(e)>=0},k.gte=k.greaterThanOrEqual,k.ge=k.greaterThanOrEqual,k.compare=function(e){if(s(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},k.comp=k.compare,k.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(b)},k.neg=k.negate,k.add=function(e){s(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,u=e.low>>>16,c=0,d=0,p=0,f=0;return p+=(f+=i+(65535&e.low))>>>16,d+=(p+=r+u)>>>16,c+=(d+=n+o)>>>16,c+=t+a,l((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},k.subtract=function(e){return s(e)||(e=h(e)),this.add(e.neg())},k.sub=k.subtract,k.multiply=function(e){if(this.isZero())return g;if(s(e)||(e=h(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(C))return e.isOdd()?C:g;if(e.eq(C))return this.isOdd()?C:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,p=65535&e.low,f=0,y=0,b=0,w=0;return b+=(w+=a*p)>>>16,y+=(b+=i*p)>>>16,b&=65535,y+=(b+=a*d)>>>16,f+=(y+=r*p)>>>16,y&=65535,f+=(y+=i*d)>>>16,y&=65535,f+=(y+=a*c)>>>16,f+=n*p+r*d+i*c+a*u,l((b&=65535)<<16|(w&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},k.mul=k.multiply,k.divide=function(e){if(s(e)||(e=h(e)),e.isZero())throw Error("division by zero");var n,r,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return w;i=y}else{if(this.eq(C))return e.eq(b)||e.eq(v)?C:e.eq(C)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:v:(r=this.sub(e.mul(n)),i=n.add(r.div(e)));if(e.eq(C))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),d=o(n),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=o(n-=c,this.unsigned)).mul(e);d.isZero()&&(d=b),i=i.add(d),r=r.sub(p)}return i},k.div=k.divide,k.modulo=function(e){return s(e)||(e=h(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},k.mod=k.modulo,k.rem=k.modulo,k.not=function(){return l(~this.low,~this.high,this.unsigned)},k.and=function(e){return s(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},k.or=function(e){return s(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},k.xor=function(e){return s(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},k.shiftLeft=function(e){return s(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<>>32-e,this.unsigned):l(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},k.shr=k.shiftRight,k.shiftRightUnsigned=function(e){if(s(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},k.shru=k.shiftRightUnsigned,k.shr_u=k.shiftRightUnsigned,k.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},k.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},k.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},k.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},k.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,s){return s?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},9464:function(e,t){var n,s,r;s=[e],n=function(e){"use strict";function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=Object.assign||function(e){for(var t=1;tMath.abs(n[i][a])&&(a=o);for(var l=i;l=i;h--)n[h][c]-=n[h][i]*n[i][c]/n[i][i]}for(var d=s-1;d>=0;d--){for(var p=0,f=d+1;f=0;A--)v+=A>1?y[A]+"x^"+A+" + ":1===A?y[A]+"x + ":y[A];return{string:v,points:w,predict:b,equation:[].concat(s(y)).reverse(),r2:o(i(e,w),t.precision)}}};function u(){var e=function(e,s){return n({_round:o},e,t({},s,(function(e,t){return l[s](e,n({},r,t))})))};return Object.keys(l).reduce(e,{})}e.exports=u()},void 0===(r="function"==typeof n?n.apply(t,s):n)||(e.exports=r)},2183:(e,t,n)=>{var s=n(1812),r=n(6357),i=n(1119),a=n(147),o=n(6297),l=n(9181),u=n(7529);u.alea=s,u.xor128=r,u.xorwow=i,u.xorshift7=a,u.xor4096=o,u.tychei=l,e.exports=u},1812:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n>>0,e=(s*=e)>>>0,e+=4294967296*(s-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function o(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var n=new a(e),s=t&&t.state,r=n.next;return r.int32=function(){return 4294967296*n.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.alea=l}(0,e=n.nmd(e),n.amdD)},9181:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,s=t.d,r=t.a;return e=e<<25^e>>>7^n,n=n-s|0,s=s<<24^s>>>8^r,r=r-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-s|0,t.d=s<<16^n>>>16^r,t.a=r-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.tychei=l}(0,e=n.nmd(e),n.amdD)},6357:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor128=l}(0,e=n.nmd(e),n.amdD)},6297:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this;t.next=function(){var e,n,s=t.w,r=t.X,i=t.i;return t.w=s=s+1640531527|0,n=r[i+34&127],e=r[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[i]=n^e,t.i=i,n+(s^s>>>16)|0},function(e,t){var n,s,r,i,a,o=[],l=128;for(t===(0|t)?(s=t,t=null):(t+="\0",s=0,l=Math.max(l,t.length)),r=0,i=-32;i>>15,s^=s<<4,s^=s>>>13,i>=0&&(a=a+1640531527|0,r=0==(n=o[127&i]^=s+a)?r+1:0);for(r>=128&&(o[127&(t&&t.length||0)]=-1),r=127,i=512;i>0;--i)s=o[r+34&127],n=o[r=r+1&127],s^=s<<13,n^=n<<17,s^=s>>>15,n^=n>>>12,o[r]=s^n;e.w=a,e.X=o,e.i=r}(t,e)}function o(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.X&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor4096=l}(0,e=n.nmd(e),n.amdD)},147:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this;t.next=function(){var e,n,s=t.x,r=t.i;return e=s[r],n=(e^=e>>>7)^e<<24,n^=(e=s[r+1&7])^e>>>10,n^=(e=s[r+3&7])^e>>>3,n^=(e=s[r+4&7])^e<<7,e=s[r+7&7],n^=(e^=e<<13)^e<<9,s[r]=n,t.i=r+1&7,n},function(e,t){var n,s=[];if(t===(0|t))s[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function o(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.x&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorshift7=l}(0,e=n.nmd(e),n.amdD)},1119:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var s=0;s>>4),t.next()}function o(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorwow=l}(0,e=n.nmd(e),n.amdD)},7529:function(e,t,n){var s;!function(r,i,a){var o,l=256,u=a.pow(l,6),c=a.pow(2,52),h=2*c,d=l-1;function p(e,t,n){var s=[],d=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(i)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(r.crypto||r.msCrypto).getRandomValues(e)),b(e)}catch(e){var t=r.navigator,n=t&&t.plugins;return[+new Date,r,n,r.screen,b(i)]}}():e,3),s),p=new f(s),w=function(){for(var e=p.g(6),t=u,n=0;e=h;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|p.g(4)},w.quick=function(){return p.g(4)/4294967296},w.double=w,y(b(p.S),i),(t.pass||n||function(e,t,n,s){return s&&(s.S&&m(s,p),e.state=function(){return m(p,{})}),n?(a.random=e,t):e})(w,d,"global"in t?t.global:this==a,t.state)}function f(e){var t,n=e.length,s=this,r=0,i=s.i=s.j=0,a=s.S=[];for(n||(e=[n++]);r{},9830:()=>{},3818:()=>{},6308:()=>{},7695:()=>{},170:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>pZ});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CompositeArrayBuffer:()=>rh,browserFiles:()=>Qd,browserHTTPRequest:()=>op,concatenateArrayBuffers:()=>Ch,copyModel:()=>ld,decodeWeights:()=>fh,decodeWeightsStream:()=>wh,encodeWeights:()=>ph,fromMemory:()=>hp,fromMemorySync:()=>dp,getLoadHandlers:()=>Mh,getModelArtifactsForJSON:()=>Eh,getModelArtifactsForJSONSync:()=>_h,getModelArtifactsInfoForJSON:()=>Ih,getSaveHandlers:()=>Dh,getWeightSpecs:()=>Th,http:()=>ap,isHTTPScheme:()=>rp,listModels:()=>ad,loadWeights:()=>tp,moveModel:()=>ud,registerLoadRouter:()=>Rh,registerSaveRouter:()=>Oh,removeModel:()=>od,weightsLoaderFactory:()=>np,withSaveHandler:()=>pp,withSaveHandlerSync:()=>fp});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{assertParamsValid:()=>kp,computeFlatOffset:()=>zp,computeOutShape:()=>_p,getNormalizedAxes:()=>Np,isSliceContinous:()=>Bp,maskToAxes:()=>Sp,parseSliceParams:()=>Lp,sliceInfo:()=>Pp,startForAxis:()=>Mp,startIndicesWithElidedDims:()=>Op,stopForAxis:()=>Fp,stopIndicesWithElidedDims:()=>Rp,stridesForAxis:()=>Dp,stridesWithElidedDims:()=>Ep});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{conv2d:()=>Jy,depthwiseConv2d:()=>nb,matMul:()=>sb});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{collectGatherOpShapeInfo:()=>fv,computeOutShape:()=>pv,segOpComputeOptimalWindowSize:()=>dv});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{ERF_A1:()=>Nw,ERF_A2:()=>Ow,ERF_A3:()=>Rw,ERF_A4:()=>Dw,ERF_A5:()=>Mw,ERF_P:()=>Tw,PARALLELIZE_THRESHOLD:()=>bw,RowPartitionType:()=>pw,SELU_SCALE:()=>Iw,SELU_SCALEALPHA:()=>Ew,applyActivation:()=>Yy,assertAndGetBroadcastShape:()=>Gd,assertAxesAreInnerMostDims:()=>pm,assertParamsConsistent:()=>hw,assignToTypedArray:()=>Vw,axesAreInnerMostDims:()=>um,calculateShapes:()=>Ey,checkEinsumDimSizes:()=>Xw,checkPadOnDimRoundingMode:()=>ff,combineLocations:()=>cm,combineRaggedTensorToTensorShapes:()=>fw,complexWithEvenIndex:()=>zw,complexWithOddIndex:()=>Lw,computeConv2DInfo:()=>nf,computeConv3DInfo:()=>sf,computeDefaultPad:()=>rf,computeDilation2DInfo:()=>Jp,computeOptimalWindowSize:()=>ww,computeOutAndReduceShapes:()=>hm,computeOutShape:()=>dw,computePool2DInfo:()=>ef,computePool3DInfo:()=>tf,convertConv2DDataFormat:()=>pf,decodeEinsumEquation:()=>$w,eitherStridesOrDilationsAreOne:()=>hf,expandShapeToKeepDim:()=>dm,exponent:()=>Gw,exponents:()=>Ww,fromStringArrayToUint8:()=>gv,fromUint8ToStringArray:()=>mv,getAxesPermutation:()=>fm,getBroadcastDims:()=>Vd,getComplexWithIndex:()=>Pw,getEinsumComputePath:()=>Zw,getEinsumPermutation:()=>Kw,getFusedBiasGradient:()=>Zy,getFusedDyActivation:()=>Xy,getImageCenter:()=>vw,getInnerMostAxes:()=>gm,getPermuted:()=>xw,getRaggedRank:()=>gw,getReductionAxes:()=>Wd,getReshaped:()=>Aw,getReshapedPermuted:()=>Cw,getRowPartitionTypesHelper:()=>mw,getSliceBeginCoords:()=>kw,getSliceSize:()=>Sw,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>ev,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>tv,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>nv,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>iv,getSparseReshapeInputOutputMismatchErrorMessage:()=>ov,getSparseReshapeInputOutputMultipleErrorMessage:()=>av,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>sv,getSparseReshapeNegativeOutputDimErrorMessage:()=>rv,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>hv,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>lv,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>uv,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>cv,getUndoAxesPermutation:()=>mm,isIdentityPermutation:()=>Yw,log:()=>Iu,mergeRealAndImagArrays:()=>Fw,prepareAndValidate:()=>_w,prepareSplitSize:()=>Jw,segment_util:()=>s,shouldFuse:()=>Qy,slice_util:()=>t,splitRealAndImagArrays:()=>Bw,stridesOrDilationsArePositive:()=>df,tupleValuesAreOne:()=>cf,upcastType:()=>Tc,validateDefaultValueShape:()=>yw,validateInput:()=>_y,validateUpdateShape:()=>Sy,warn:()=>Eu});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{json:()=>PE});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{json:()=>VE});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{json:()=>WE});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{json:()=>GE});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{json:()=>UE});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{json:()=>qE});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{json:()=>jE});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{json:()=>HE});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{json:()=>$E});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{json:()=>KE});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{json:()=>XE});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{json:()=>ZE});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{json:()=>YE});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{json:()=>QE});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{json:()=>JE});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{json:()=>eI});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{json:()=>tI});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{json:()=>nI});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{json:()=>sI});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{OP_SCOPE_SUFFIX:()=>Qc,abs:()=>Pd,acos:()=>Wp,acosh:()=>Gp,add:()=>bd,addN:()=>Up,all:()=>qp,any:()=>jp,argMax:()=>Hp,argMin:()=>$p,asin:()=>Kp,asinh:()=>Xp,atan:()=>Zp,atan2:()=>Yp,atanh:()=>Qp,avgPool:()=>gf,avgPool3d:()=>yf,basicLSTMCell:()=>Cf,batchNorm:()=>Sf,batchNorm2d:()=>_f,batchNorm3d:()=>Ef,batchNorm4d:()=>If,batchToSpaceND:()=>kf,bincount:()=>Tf,bitwiseAnd:()=>Nf,booleanMaskAsync:()=>Ly,broadcastArgs:()=>Of,broadcastTo:()=>Rf,buffer:()=>fd,cast:()=>md,ceil:()=>Df,clipByValue:()=>Mf,clone:()=>gd,complex:()=>eh,concat:()=>bf,concat1d:()=>Ff,concat2d:()=>Bf,concat3d:()=>zf,concat4d:()=>Lf,conv1d:()=>Vf,conv2d:()=>Pf,conv2dTranspose:()=>Gf,conv3d:()=>Uf,conv3dTranspose:()=>jf,cos:()=>Hf,cosh:()=>$f,cosineWindow:()=>Hy,cumprod:()=>Kf,cumsum:()=>Xf,denseBincount:()=>Zf,depthToSpace:()=>Yf,depthwiseConv2d:()=>Qf,diag:()=>Jf,dilation2d:()=>em,div:()=>vd,divNoNan:()=>sm,dot:()=>rm,dropout:()=>qy,einsum:()=>im,elu:()=>am,enclosingPowerOfTwo:()=>jy,ensureShape:()=>om,equal:()=>tm,erf:()=>lm,euclideanNorm:()=>xm,exp:()=>Cm,expandDims:()=>km,expm1:()=>Sm,eye:()=>Em,fft:()=>uy,fill:()=>Md,floor:()=>Im,floorDiv:()=>wd,fused:()=>n,gather:()=>Tm,gatherND:()=>Uy,greater:()=>Nm,greaterEqual:()=>Om,ifft:()=>cy,imag:()=>Rm,image:()=>sw,inTopKAsync:()=>$y,irfft:()=>hy,isFinite:()=>Dm,isInf:()=>Mm,isNaN:()=>Fm,leakyRelu:()=>Bm,less:()=>zm,lessEqual:()=>Lm,linalg:()=>rw,linspace:()=>Pm,localResponseNormalization:()=>Vm,log:()=>Wm,log1p:()=>Gm,logSigmoid:()=>jm,logSoftmax:()=>Hm,logSumExp:()=>$m,logicalAnd:()=>Km,logicalNot:()=>Xm,logicalOr:()=>Zm,logicalXor:()=>Ym,losses:()=>iw,lowerBound:()=>eg,matMul:()=>wf,max:()=>ym,maxPool:()=>tg,maxPool3d:()=>ng,maxPoolWithArgmax:()=>sg,maximum:()=>Ud,mean:()=>rg,meshgrid:()=>og,min:()=>bm,minimum:()=>lg,mirrorPad:()=>ug,mod:()=>cg,moments:()=>hg,movingAverage:()=>Vy,mul:()=>Ad,multiRNNCell:()=>dg,multinomial:()=>pg,neg:()=>Um,norm:()=>Am,notEqual:()=>fg,oneHot:()=>mg,ones:()=>ag,onesLike:()=>gg,op:()=>Jc,outerProduct:()=>yg,pad:()=>bg,pad1d:()=>wg,pad2d:()=>vg,pad3d:()=>Ag,pad4d:()=>xg,pool:()=>kg,pow:()=>Bd,prelu:()=>Sg,print:()=>yd,prod:()=>_g,raggedGather:()=>Eg,raggedRange:()=>Ig,raggedTensorToTensor:()=>Tg,rand:()=>Ng,randomGamma:()=>Fg,randomNormal:()=>Bg,randomStandardNormal:()=>zg,randomUniform:()=>Lg,randomUniformInt:()=>Pg,range:()=>Vg,real:()=>Wg,reciprocal:()=>Gg,relu:()=>Ug,relu6:()=>qg,reshape:()=>mf,reverse:()=>jg,reverse1d:()=>Hg,reverse2d:()=>$g,reverse3d:()=>Kg,reverse4d:()=>Xg,rfft:()=>py,round:()=>Zg,rsqrt:()=>Yg,scalar:()=>_d,scatterND:()=>Wy,searchSorted:()=>Jm,selu:()=>Qg,separableConv2d:()=>Jg,setdiff1dAsync:()=>ey,sigmoid:()=>vf,sign:()=>ty,signal:()=>nw,sin:()=>ny,sinh:()=>sy,slice:()=>Af,slice1d:()=>ry,slice2d:()=>iy,slice3d:()=>ay,slice4d:()=>oy,softmax:()=>ly,softplus:()=>qm,spaceToBatchND:()=>Cg,sparse:()=>aw,sparseToDense:()=>Gy,spectral:()=>tw,split:()=>dy,sqrt:()=>xd,square:()=>Cd,squaredDifference:()=>fy,squeeze:()=>my,stack:()=>gy,step:()=>yy,stridedSlice:()=>by,string:()=>ow,sub:()=>zd,sum:()=>wm,tan:()=>wy,tanh:()=>xf,tensor:()=>nh,tensor1d:()=>vy,tensor2d:()=>Ay,tensor3d:()=>mp,tensor4d:()=>xy,tensor5d:()=>Cy,tensor6d:()=>ky,tensorScatterUpdate:()=>Iy,tile:()=>_m,topk:()=>Ty,transpose:()=>Py,truncatedNormal:()=>Ny,unique:()=>Oy,unsortedSegmentSum:()=>Ry,unstack:()=>Dy,upperBound:()=>My,variable:()=>Fy,where:()=>nm,whereAsync:()=>zy,zeros:()=>ig,zerosLike:()=>kd});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{mx:()=>rN,XI:()=>ZN,Nk:()=>YN,f6:()=>JN,ct:()=>JT,YG:()=>sO,hH:()=>uO,z3:()=>$O,sG:()=>rR,uM:()=>uR,vS:()=>_R,qB:()=>MR,GG:()=>BR,lg:()=>WR,rq:()=>LR,cu:()=>eD,WR:()=>YR,GE:()=>sD,px:()=>iD,jC:()=>vD,He:()=>CD,hE:()=>DD,BF:()=>PO,Dk:()=>UD,cl:()=>YD,_B:()=>cM,ub:()=>mM,_f:()=>bM,Ku:()=>kM,qy:()=>_M,Zy:()=>LM,bu:()=>WM,zv:()=>qT,dH:()=>pN,HS:()=>HN,yH:()=>oF,l3:()=>uF,z9:()=>hF,x6:()=>gF,_m:()=>CF,eW:()=>IF,GK:()=>OF,SP:()=>MF,yr:()=>BF,dl:()=>mR,Dw:()=>GF,xT:()=>HF,_X:()=>vN,wz:()=>JF});var _=__webpack_require__(7786),E=__webpack_require__(9043);_.A.prototype._CONST=Object.freeze({N:{VIDEO_W:{DESKTOP:208,MOBILE:144},VIDEO_MARGIN:"10px",GAZE_CALIBRATION:{R:40,MARGIN:32,BORDER:8,CENTER_EXTRA_CHECK_OFFSET:2,MID_EXTRA_CHECK_OFFSET:6},PPI_DONT_USE:127.7,PD_DONT_USE:6.4,VIEW_DIST_DONT_USE:40},S:{AUTO:"AUTO",CLICK_TYPE:{MOUSE:"mouse",TOUCH:"touch"}},COLOR:{LIGHT_GREY:"#cccccc",ORANGE:"#ff9a00",DARK_RED:"#ac0d0d",RED:"#ee0000"},LTR:"LTR",RTL:"RTL",VIEW_METHOD:{B:"BlindSpot",F:"FaceMesh"},IN_TO_CM:2.54,UNITS:{CM:"cm",IN_D:"inDecimal",IN_F:"inFractional"}}),_.A.prototype._debuggerDefault=Object.freeze({date:new Date("July 20, 69 20:17:40 GMT+00:00"),timestamp:performance.now(),screenSize:{value:{screenWidthCm:28.6,screenHeightCm:17.9,screenPhysicalPpi:250,screenPpi:125,screenDiagonalCm:33.8,screenDiagonalIn:13.3}},measureDistance:{value:40,method:"BlindSpot"},trackDistance:{value:{viewingDistanceCm:40,PDCm:6.4,nearPointCm:{x:0,y:0},latencyMs:50},method:"FaceMesh"},trackGaze:{value:{x:screen.width/2,y:screen.height/2,latencyMs:50}},performance:{value:{computeArrayFillMHz:(0,E.Nh)(.5,3),computeRandomMHz:(0,E.Nh)(5,3),idealFps:60,stressFps:60}}});var I=__webpack_require__(115),T=__webpack_require__.n(I),N=__webpack_require__(3389),O=__webpack_require__.n(N),R=__webpack_require__(402),D=__webpack_require__.n(R),M=__webpack_require__(880),F=__webpack_require__.n(M),B=__webpack_require__(3282),z=__webpack_require__.n(B);const L=(e,t)=>{e.style.top=`${Math.round(t.querySelector(".calibration-instruction").getBoundingClientRect().bottom)+25}px`},P=e=>{const t=e.value/e.max;e.style.background=`linear-gradient(90deg, #ffc772, #ffc772 ${100*t}%, #fff ${100*t}%)`};var V=__webpack_require__(9853),W=__webpack_require__(359),G=__webpack_require__(9199);_.A.prototype._displaySize=function(){if(!this.checkInitialized())return;const e={value:{displayWidthPx:screen.width,displayHeightPx:screen.height,windowWidthPx:window.innerWidth,windowHeightPx:window.innerHeight},timestamp:performance.now()};this.displayData.length&&T()(e.value,this.displayData[this.displayData.length-1].value)||(this.newDisplayData=e)};const U={card:O(),arrow:D(),usba:F(),usbc:z()},q={card:3.375,usba:.787402,usbc:.787402};_.A.prototype.screenSize=function(e={},t=void 0){if(!this.checkInitialized())return;(0,E.$k)();const n=Object.assign({fullscreen:!1,repeatTesting:1,decimalPlace:1,defaultObject:"card",headline:`🖥️ ${G.H.RC_screenSizeTitle[this.L]}`,description:G.H.RC_screenSizeIntro[this.L],check:!1,checkCallback:null},e);this.getFullscreen(n.fullscreen),["usba","usbc","card"].includes(n.defaultObject)||(n.defaultObject="card"),n.description+=`

    ${G.H.RC_screenSizeHave[this.L].replace("xxx",``)}`,this._addBackground(),this._addBackgroundText(n.headline,n.description),this._addCreditOnBackground(G.H.RC_screenSizeCredit[this.L]),function(e,t,n,s){const r=((e,t,n)=>{const s=document.createElement("input");return s.id="rc-size-slider",s.className="rc-slider",s.type="range",s.min=t,s.max=n,s.value=Math.max(Math.min(Math.round(100*Math.random()),80),20),s.step=.1,L(s,e),P(s),e.appendChild(s),s})(t,0,100),i=(t,n)=>{if("rc-slider"===t.target.className&&"rc-size-slider"===t.target.id&&(n===e._CONST.S.CLICK_TYPE.MOUSE&&1===t.which||n===e._CONST.S.CLICK_TYPE.TOUCH)){t.target.style.cursor="grabbing",c.setAttribute("fill",e._CONST.COLOR.ORANGE);const s=()=>{r.style.cursor="grab",c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY),document.removeEventListener("mouseup",s,!1)};n===e._CONST.S.CLICK_TYPE.MOUSE?document.addEventListener("mouseup",s,!1):n===e._CONST.S.CLICK_TYPE.TOUCH&&document.addEventListener("touchend",s,!1)}},a=e=>{i(e,"mouse")},o=e=>{i(e,"touch")};document.addEventListener("mousedown",a,!1),document.addEventListener("touchstart",o,!1);const l=$(["card","arrow","usba","usbc"],t);let u=n.defaultObject;document.getElementById("matching-obj").addEventListener("change",(e=>{K(e.target.value,l,d),u=e.target.value})),K("card",l);const c=document.getElementById("size-arrow-fill");c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY);const h={width:l.arrow.getBoundingClientRect().width,height:l.arrow.getBoundingClientRect().height},d=()=>{j(e,r,l.card,l.arrow,h),H(r,l.usba),H(r,l.usbc)};d();const p=()=>{P(r),d()},f=new ResizeObserver((()=>{d(),L(r,t),Z(l,r)}));f.observe(t);const m=()=>{document.removeEventListener("mousedown",a,!1),document.removeEventListener("touchstart",o,!1),document.removeEventListener("input",p,!1),f.unobserve(t),e._removeBackground(),(0,V.l)(y)},g=()=>{const t=(l[u].getBoundingClientRect().width||Number.parseInt(l[u].style.width))/q[u],r=n.decimalPlace,i=X(t,r);e.newScreenData=i,m(),n.check?e._checkScreenSize(s,i,n.checkCallback):(0,E.nB)(s,i)};r.addEventListener("input",p,!1);const y=(0,V.m)({Escape:m,Enter:g," ":g});(0,W.F)(e.L,e.background,{go:g,cancel:m},e.params.showCancelButton),K(u,l,d)}(this,this.background,n,t)};const j=(e,t,n,s,r)=>{const i=(t.offsetWidth-30)*(t.value/100)*(window.innerWidth<480?2:1)+15;n.style.width=`${i}px`;const a=n.getBoundingClientRect();0!==a.width&&(s.style.left=`${a.left+i}px`,s.style.top=`${a.top+e.background.scrollTop+(.63*i-r.height)/2}px`)},H=(e,t)=>{t.style.width=`${(0,E.Ew)(e.value**1.5,0,1e3,50,400)}px`},$=(e,t)=>{const n=document.getElementsByClassName("size-obj");for(;n.length;)n[0].parentNode.removeChild(n[0]);const s={};for(const n of e){let e=document.createElement("div");t.appendChild(e),e.outerHTML=U[n],e=document.getElementById(`size-${n}`),e.setAttribute("preserveAspectRatio","none"),e.style.visibility="hidden",s[n]=e}return Z(s,document.querySelector("#rc-size-slider")),s},K=(e,t,n)=>{for(const n in t)t[n].style.visibility=n===e?"visible":"hidden";t.arrow.style.visibility="hidden",(0,E.nB)(n)},X=(e,t)=>{const n={value:{screenWidthCm:(0,E.Nh)(2.54*window.screen.width/e,t),screenHeightCm:(0,E.Nh)(2.54*window.screen.height/e,t),screenPhysicalPpi:(0,E.Nh)(e*window.devicePixelRatio,t),screenPpi:(0,E.Nh)(e,t)},timestamp:performance.now()};return n.value.screenDiagonalCm=(0,E.Nh)(Math.hypot(n.value.screenWidthCm,n.value.screenHeightCm),t),n.value.screenDiagonalIn=(0,E.Nh)(n.value.screenDiagonalCm/2.54,t),n},Z=(e,t)=>{for(const n in e)e[n].style.top=`${t.getBoundingClientRect().top+50}px`};function Y(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function Q(e,t){return e.get(Y(e,t))}function J(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}const ee={},te=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;ee.restoreFocusTimeout=setTimeout((()=>{ee.previousActiveElement instanceof HTMLElement?(ee.previousActiveElement.focus(),ee.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),window.scrollTo(n,s)})),ne="swal2-",se=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=ne+t,e)),{}),re=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=ne+t,e)),{}),ie=e=>e.charAt(0).toUpperCase()+e.slice(1),ae=e=>{},oe=[],le=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n;n=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,oe.includes(n)||(oe.push(n),ae(n))},ue=e=>"function"==typeof e?e():e,ce=e=>e&&"function"==typeof e.toPromise,he=e=>ce(e)?e.toPromise():Promise.resolve(e),de=e=>e&&Promise.resolve(e)===e,pe=()=>document.body.querySelector(`.${se.container}`),fe=e=>{const t=pe();return t?t.querySelector(e):null},me=e=>fe(`.${e}`),ge=()=>me(se.popup),ye=()=>me(se.icon),be=()=>me(se.title),we=()=>me(se["html-container"]),ve=()=>me(se.image),Ae=()=>me(se["progress-steps"]),xe=()=>me(se["validation-message"]),Ce=()=>fe(`.${se.actions} .${se.confirm}`),ke=()=>fe(`.${se.actions} .${se.cancel}`),Se=()=>fe(`.${se.actions} .${se.deny}`),_e=()=>fe(`.${se.loader}`),Ee=()=>me(se.actions),Ie=()=>me(se.footer),Te=()=>me(se["timer-progress-bar"]),Ne=()=>me(se.close),Oe=()=>{const e=ge();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>Xe(e)))},Re=()=>Fe(document.body,se.shown)&&!Fe(document.body,se["toast-shown"])&&!Fe(document.body,se["no-backdrop"]),De=()=>{const e=ge();return!!e&&Fe(e,se.toast)},Me=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},Fe=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(se).includes(n)||Object.values(re).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))})(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?Ve(e,s):ae(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},ze=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${se.popup} > .${se[t]}`);case"checkbox":return e.querySelector(`.${se.popup} > .${se.checkbox} input`);case"radio":return e.querySelector(`.${se.popup} > .${se.radio} input:checked`)||e.querySelector(`.${se.popup} > .${se.radio} input:first-child`);case"range":return e.querySelector(`.${se.popup} > .${se.range} input`);default:return e.querySelector(`.${se.popup} > .${se.input}`)}},Le=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},Pe=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Ve=(e,t)=>{Pe(e,t,!0)},We=(e,t)=>{Pe(e,t,!1)},Ge=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},qe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},je=e=>{e&&(e.style.display="none")},He=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{Ke(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},$e=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},Ke=function(e,t){t?qe(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):je(e)},Xe=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),Ze=e=>!!(e.scrollHeight>e.clientHeight),Ye=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},Qe=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Te();n&&Xe(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},Je=()=>"undefined"==typeof window||"undefined"==typeof document,et=`\n
    \n \n
      \n
      \n \n

      \n
      \n \n \n
      \n \n \n
      \n \n
      \n \n \n
      \n
      \n
      \n \n \n \n
      \n
      \n
      \n
      \n
      \n
      \n`.replace(/(^|\n)\s*/g,""),tt=()=>{ee.currentInstance.resetValidationMessage()},nt=e=>{const t=(()=>{const e=pe();return!!e&&(e.remove(),We([document.documentElement,document.body],[se["no-backdrop"],se["toast-shown"],se["has-column"]]),!0)})();if(Je())return;const n=document.createElement("div");n.className=se.container,t&&Ve(n,se["no-transition"]),Me(n,et);const s="string"==typeof(r=e.target)?document.querySelector(r):r;var r;s.appendChild(n),(e=>{const t=ge();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&Ve(pe(),se.rtl)})(s),(()=>{const e=ge(),t=Ge(e,se.input),n=Ge(e,se.file),s=e.querySelector(`.${se.range} input`),r=e.querySelector(`.${se.range} output`),i=Ge(e,se.select),a=e.querySelector(`.${se.checkbox} input`),o=Ge(e,se.textarea);t.oninput=tt,n.onchange=tt,i.onchange=tt,a.onchange=tt,o.oninput=tt,s.oninput=()=>{tt(),r.value=s.value},s.onchange=()=>{tt(),r.value=s.value}})()},st=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?rt(e,t):e&&Me(t,e)},rt=(e,t)=>{e.jquery?it(t,e):Me(t,e.toString())},it=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},at=(()=>{if(Je())return!1;const e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"})(),ot=(e,t)=>{const n=Ee(),s=_e();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?qe(n):je(n),Be(n,t,"actions"),function(e,t,n){const s=Ce(),r=Se(),i=ke();if(!s||!r||!i)return;lt(s,"confirm",n),lt(r,"deny",n),lt(i,"cancel",n),function(e,t,n,s){if(!s.buttonsStyling)return void We([e,t,n],se.styled);Ve([e,t,n],se.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ve(e,se["default-outline"]));s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ve(t,se["default-outline"]));s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,Ve(n,se["default-outline"]))}(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t)))}(n,s,t),Me(s,t.loaderHtml||""),Be(s,t,"loader"))};function lt(e,t,n){const s=ie(t);Ke(e,n[`show${s}Button`],"inline-block"),Me(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=se[t],Be(e,n,`${t}Button`)}const ut=(e,t)=>{const n=pe();n&&(!function(e,t){"string"==typeof t?e.style.background=t:t||Ve([document.documentElement,document.body],se["no-backdrop"])}(n,t.backdrop),function(e,t){if(!t)return;t in se?Ve(e,se[t]):(ae('The "position" parameter is not valid, defaulting to "center"'),Ve(e,se.center))}(n,t.position),function(e,t){if(!t)return;Ve(e,se[`grow-${t}`])}(n,t.grow),Be(n,t,"container"))};var ct={innerParams:new WeakMap,domCache:new WeakMap};const ht=["input","file","range","select","radio","checkbox","textarea"],dt=e=>{if(!e.input)return;if(!wt[e.input])return Object.keys(wt).join(" | "),void e.input;const t=yt(e.input);if(!t)return;const n=wt[e.input](t,e);qe(t),e.inputAutoFocus&&setTimeout((()=>{Le(n)}))},pt=(e,t)=>{const n=ge();if(!n)return;const s=ze(n,e);if(s){(e=>{for(let t=0;t{if(!e.input)return;const t=yt(e.input);t&&Be(t,e,"input")},mt=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},gt=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=se["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&Ve(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},yt=e=>{const t=ge();if(t)return Ge(t,se[e]||se.input)},bt=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:de(t)||ae(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},wt={};wt.text=wt.email=wt.password=wt.number=wt.tel=wt.url=wt.search=wt.date=wt["datetime-local"]=wt.time=wt.week=wt.month=(e,t)=>(bt(e,t.inputValue),gt(e,e,t),mt(e,t),e.type=t.input,e),wt.file=(e,t)=>(gt(e,e,t),mt(e,t),e),wt.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return bt(n,t.inputValue),n.type=t.input,bt(s,t.inputValue),gt(n,e,t),e},wt.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");Me(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return gt(e,e,t),e},wt.radio=e=>(e.textContent="",e),wt.checkbox=(e,t)=>{const n=ze(ge(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return Me(s,t.inputPlaceholder||t.inputLabel),n},wt.textarea=(e,t)=>{bt(e,t.inputValue),mt(e,t),gt(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(ge()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const s=e.offsetWidth+(r=e,parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight));var r;s>n?ge().style.width=`${s}px`:Ue(ge(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const vt=(e,t)=>{const n=we();n&&(He(n),Be(n,t,"htmlContainer"),t.html?(st(t.html,n),qe(n,"block")):t.text?(n.textContent=t.text,qe(n,"block")):je(n),((e,t)=>{const n=ge();if(!n)return;const s=ct.innerParams.get(e),r=!s||t.input!==s.input;ht.forEach((e=>{const s=Ge(n,se[e]);s&&(pt(e,t.inputAttributes),s.className=se[e],r&&je(s))})),t.input&&(r&&dt(t),ft(t))})(e,t))},At=(e,t)=>{for(const[n,s]of Object.entries(re))t.icon!==n&&We(e,s);Ve(e,t.icon&&re[t.icon]),kt(e,t),xt(),Be(e,t,"icon")},xt=()=>{const e=ge();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";if(t.iconHtml)s=St(t.iconHtml);else if("success"===t.icon)s='\n
      \n \n
      \n
      \n',n=n.replace(/ style=".*?"/g,"");else if("error"===t.icon)s='\n \n \n \n \n';else if(t.icon){s=St({question:"?",warning:"!",info:"i"}[t.icon])}n.trim()!==s.trim()&&Me(e,s)},kt=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])$e(e,n,"background-color",t.iconColor);$e(e,".swal2-success-ring","border-color",t.iconColor)}},St=e=>`
      ${e}
      `,_t=(e,t)=>{const n=t.showClass||{};e.className=`${se.popup} ${Xe(e)?n.popup:""}`,t.toast?(Ve([document.documentElement,document.body],se["toast-shown"]),Ve(e,se.toast)):Ve(e,se.modal),Be(e,t,"popup"),"string"==typeof t.customClass&&Ve(e,t.customClass),t.icon&&Ve(e,se[`icon-${t.icon}`])},Et=e=>{const t=document.createElement("li");return Ve(t,se["progress-step"]),Me(t,e),t},It=e=>{const t=document.createElement("li");return Ve(t,se["progress-step-line"]),e.progressStepsDistance&&Ue(t,"width",e.progressStepsDistance),t},Tt=(e,t)=>{((e,t)=>{const n=pe(),s=ge();if(n&&s){if(t.toast){Ue(n,"width",t.width),s.style.width="100%";const e=_e();e&&s.insertBefore(e,ye())}else Ue(s,"width",t.width);Ue(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),je(xe()),_t(s,t)}})(0,t),ut(0,t),((e,t)=>{const n=Ae();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(qe(n),n.textContent="",r>=s.length&&ae("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach(((e,i)=>{const a=Et(e);if(n.appendChild(a),i===r&&Ve(a,se["active-progress-step"]),i!==s.length-1){const e=It(t);n.appendChild(e)}}))):je(n)})(0,t),((e,t)=>{const n=ct.innerParams.get(e),s=ye();if(s){if(n&&t.icon===n.icon)return Ct(s,t),void At(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(re).indexOf(t.icon))return t.icon,void je(s);qe(s),Ct(s,t),At(s,t),Ve(s,t.showClass&&t.showClass.icon)}else je(s)}})(e,t),((e,t)=>{const n=ve();n&&(t.imageUrl?(qe(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),Ue(n,"width",t.imageWidth),Ue(n,"height",t.imageHeight),n.className=se.image,Be(n,t,"image")):je(n))})(0,t),((e,t)=>{const n=be();n&&(He(n),Ke(n,t.title||t.titleText,"block"),t.title&&st(t.title,n),t.titleText&&(n.innerText=t.titleText),Be(n,t,"title"))})(0,t),((e,t)=>{const n=Ne();n&&(Me(n,t.closeButtonHtml||""),Be(n,t,"closeButton"),Ke(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),vt(e,t),ot(0,t),((e,t)=>{const n=Ie();n&&(He(n),Ke(n,t.footer,"block"),t.footer&&st(t.footer,n),Be(n,t,"footer"))})(0,t);const n=ge();"function"==typeof t.didRender&&n&&t.didRender(n),ee.eventEmitter.emit("didRender",n)},Nt=()=>{var e;return null===(e=Ce())||void 0===e?void 0:e.click()},Ot=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Rt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Dt=(e,t)=>{var n;const s=Oe();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=ge())||void 0===n||n.focus()},Mt=["ArrowRight","ArrowDown"],Ft=["ArrowLeft","ArrowUp"],Bt=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?zt(t,e):"Tab"===t.key?Lt(t):[...Mt,...Ft].includes(t.key)?Pt(t.key):"Escape"===t.key&&Vt(t,e,n)))},zt=(e,t)=>{if(!ue(t.allowEnterKey))return;const n=ze(ge(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Nt(),e.preventDefault()}},Lt=e=>{const t=e.target,n=Oe();let s=-1;for(let e=0;e{const t=Ee(),n=Ce(),s=Se(),r=ke();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=Mt.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{ue(t.allowEscapeKey)&&(e.preventDefault(),n(Ot.esc))};var Wt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Gt=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Ut="undefined"!=typeof window&&!!window.GestureEvent,qt=()=>{const e=pe();if(!e)return;let t;e.ontouchstart=e=>{t=jt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},jt=e=>{const t=e.target,n=pe(),s=we();return!(!n||!s)&&(!Ht(e)&&!$t(e)&&(t===n||!Ze(n)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!Ze(s)||!s.contains(t))))},Ht=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,$t=e=>e.touches&&e.touches.length>1;let Kt=null;const Xt=e=>{null===Kt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Kt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Kt+(()=>{const e=document.createElement("div");e.className=se["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function Zt(e,t,n,s){De()?rn(e,s):(te(n).then((()=>rn(e,s))),Rt(ee)),Ut?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),Re()&&(null!==Kt&&(document.body.style.paddingRight=`${Kt}px`,Kt=null),(()=>{if(Fe(document.body,se.iosfix)){const e=parseInt(document.body.style.top,10);We(document.body,se.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Gt()),We([document.documentElement,document.body],[se.shown,se["height-auto"],se["no-backdrop"],se["toast-shown"]])}function Yt(e){e=tn(e);const t=Wt.swalPromiseResolve.get(this),n=Qt(this);this.isAwaitingPromise?e.isDismissed||(en(this),t(e)):n&&t(e)}const Qt=e=>{const t=ge();if(!t)return!1;const n=ct.innerParams.get(e);if(!n||Fe(t,n.hideClass.popup))return!1;We(t,n.showClass.popup),Ve(t,n.hideClass.popup);const s=pe();return We(s,n.showClass.backdrop),Ve(s,n.hideClass.backdrop),nn(e,t,n),!0};function Jt(e){const t=Wt.swalPromiseReject.get(this);en(this),t&&t(e)}const en=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,ct.innerParams.get(e)||e._destroy())},tn=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),nn=(e,t,n)=>{const s=pe(),r=at&&Ye(t);"function"==typeof n.willClose&&n.willClose(t),ee.eventEmitter.emit("willClose",t),r?sn(e,t,s,n.returnFocus,n.didClose):Zt(e,s,n.returnFocus,n.didClose)},sn=(e,t,n,s,r)=>{at&&(ee.swalCloseEventFinishedCallback=Zt.bind(null,e,n,s,r),t.addEventListener(at,(function(e){e.target===t&&(ee.swalCloseEventFinishedCallback(),delete ee.swalCloseEventFinishedCallback)})))},rn=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),ee.eventEmitter.emit("didClose"),e._destroy&&e._destroy()}))},an=e=>{let t=ge();if(t||new zs,t=ge(),!t)return;const n=_e();De()?je(ye()):on(t,e),qe(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},on=(e,t)=>{const n=Ee(),s=_e();n&&s&&(!t&&Xe(Ce())&&(t=Ce()),qe(n),t&&(je(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),Ve([e,n],se.loading))},ln=e=>e.checked?1:0,un=e=>e.checked?e.value:null,cn=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,hn=(e,t)=>{const n=ge();if(!n)return;const s=e=>{"select"===t.input?function(e,t,n){const s=Ge(e,se.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,Me(r,t),r.selected=fn(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}(n,pn(e),t):"radio"===t.input&&function(e,t,n){const s=Ge(e,se.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=se.radio,i.value=t,fn(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");Me(o,r),o.className=se.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}(n,pn(e),t)};ce(t.inputOptions)||de(t.inputOptions)?(an(Ce()),he(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):t.inputOptions},dn=(e,t)=>{const n=e.getInput();n&&(je(n),he(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,qe(n),n.focus(),e.hideLoading()})).catch((t=>{n.value="",qe(n),n.focus(),e.hideLoading()})))};const pn=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=pn(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=pn(s)),t.push([n,s])})),t},fn=(e,t)=>!!t&&t.toString()===e.toString(),mn=(e,t)=>{const n=ct.innerParams.get(e);if(!n.input)return void ie(t);const s=e.getInput(),r=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return ln(n);case"radio":return un(n);case"file":return cn(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,n);n.inputValidator?gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?yn(e,r):vn(e,r)},gn=(e,t,n)=>{const s=ct.innerParams.get(e);e.disableInput();Promise.resolve().then((()=>he(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?yn(e,t):vn(e,t)}))},yn=(e,t)=>{const n=ct.innerParams.get(e||void 0);if(n.showLoaderOnDeny&&an(Se()),n.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then((()=>he(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),en(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>wn(e||void 0,t)))}else e.close({isDenied:!0,value:t})},bn=(e,t)=>{e.close({isConfirmed:!0,value:t})},wn=(e,t)=>{e.rejectPromise(t)},vn=(e,t)=>{const n=ct.innerParams.get(e||void 0);if(n.showLoaderOnConfirm&&an(),n.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then((()=>he(n.preConfirm(t,n.validationMessage)))).then((n=>{Xe(xe())||!1===n?(e.hideLoading(),en(e)):bn(e,void 0===n?t:n)})).catch((t=>wn(e||void 0,t)))}else bn(e,t)};function An(){const e=ct.innerParams.get(this);if(!e)return;const t=ct.domCache.get(this);je(t.loader),De()?e.icon&&qe(ye()):xn(t),We([t.popup,t.actions],se.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const xn=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?qe(t[0],"inline-block"):Xe(Ce())||Xe(Se())||Xe(ke())||je(e.actions)};function Cn(){const e=ct.innerParams.get(this),t=ct.domCache.get(this);return t?ze(t.popup,e.input):null}function kn(e,t,n){const s=ct.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function Sn(e,t){const n=ge();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${se.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(Rn,e),zn=e=>-1!==Dn.indexOf(e),Ln=e=>Mn[e],Pn=e=>{Bn(e)||ae(`Unknown parameter "${e}"`)},Vn=e=>{Fn.includes(e)&&ae(`The parameter "${e}" is incompatible with toasts`)},Wn=e=>{const t=Ln(e);t&&le(e,t)};function Gn(e){const t=ge(),n=ct.innerParams.get(this);if(!t||Fe(t,n.hideClass.popup))return void ae("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=Un(e),r=Object.assign({},n,s);Tt(this,r),ct.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Un=e=>{const t={};return Object.keys(e).forEach((n=>{zn(n)?t[n]=e[n]:ae(`Invalid parameter to update: ${n}`)})),t};function qn(){const e=ct.domCache.get(this),t=ct.innerParams.get(this);t?(e.popup&&ee.swalCloseEventFinishedCallback&&(ee.swalCloseEventFinishedCallback(),delete ee.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),ee.eventEmitter.emit("didDestroy"),jn(this)):Hn(this)}const jn=e=>{Hn(e),delete e.params,delete ee.keydownHandler,delete ee.keydownTarget,delete ee.currentInstance},Hn=e=>{e.isAwaitingPromise?($n(ct,e),e.isAwaitingPromise=!0):($n(Wt,e),$n(ct,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},$n=(e,t)=>{for(const n in e)e[n].delete(t)};var Kn=Object.freeze({__proto__:null,_destroy:qn,close:Yt,closeModal:Yt,closePopup:Yt,closeToast:Yt,disableButtons:En,disableInput:Tn,disableLoading:An,enableButtons:_n,enableInput:In,getInput:Cn,handleAwaitingPromise:en,hideLoading:An,rejectPromise:Jt,resetValidationMessage:On,showValidationMessage:Nn,update:Gn});const Xn=(e,t,n)=>{t.popup.onclick=()=>{e&&(Zn(e)||e.timer||e.input)||n(Ot.close)}},Zn=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Yn=!1;const Qn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Yn=!0)}}},Jn=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Yn=!0)}}},es=(e,t,n)=>{t.container.onclick=s=>{Yn?Yn=!1:s.target===t.container&&ue(e.allowOutsideClick)&&n(Ot.backdrop)}},ts=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const ns=()=>{if(ee.timeout)return(()=>{const e=Te();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),ee.timeout.stop()},ss=()=>{if(ee.timeout){const e=ee.timeout.start();return Qe(e),e}};let rs=!1;const is={};const as=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in is){const n=t.getAttribute(e);if(n)return void is[e].fire({template:n})}};ee.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var os=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||ts(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];("string"==typeof r||ts(r))&&(t[n]=r)})):Object.assign(t,e[0]),t},bindClickHandler:function(){is[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,rs||(document.body.addEventListener("click",as),rs=!0)},clickCancel:()=>{var e;return null===(e=ke())||void 0===e?void 0:e.click()},clickConfirm:Nt,clickDeny:()=>{var e;return null===(e=Se())||void 0===e?void 0:e.click()},enableLoading:an,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;nme(se["icon-content"]),getImage:ve,getInputLabel:()=>me(se["input-label"]),getLoader:_e,getPopup:ge,getProgressSteps:Ae,getTimerLeft:()=>ee.timeout&&ee.timeout.getTimerLeft(),getTimerProgressBar:Te,getTitle:be,getValidationMessage:xe,increaseTimer:e=>{if(ee.timeout){const t=ee.timeout.increase(e);return Qe(t,!0),t}},isDeprecatedParameter:Ln,isLoading:()=>{const e=ge();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!ee.timeout||!ee.timeout.isRunning()),isUpdatableParameter:zn,isValidParameter:Bn,isVisible:()=>Xe(ge()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},off:(e,t)=>{e?t?ee.eventEmitter.removeListener(e,t):ee.eventEmitter.removeAllListeners(e):ee.eventEmitter.reset()},on:(e,t)=>{ee.eventEmitter.on(e,t)},once:(e,t)=>{ee.eventEmitter.once(e,t)},resumeTimer:ss,showLoading:an,stopTimer:ns,toggleTimer:()=>{const e=ee.timeout;return e&&(e.running?ns():ss())}});class ls{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const us=["swal-title","swal-html","swal-footer"],cs=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{bs(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]="boolean"==typeof Rn[n]?"false"!==s:"object"==typeof Rn[n]?JSON.parse(s):s)})),t},hs=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},ds=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{bs(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${ie(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},ps=e=>{const t={},n=e.querySelector("swal-image");return n&&(bs(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},fs=e=>{const t={},n=e.querySelector("swal-icon");return n&&(bs(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},ms=e=>{const t={},n=e.querySelector("swal-input");n&&(bs(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{bs(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},gs=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(bs(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},ys=e=>{const t=us.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||ae(`Unrecognized element <${n}>`)}))},bs=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&ae([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))},ws=e=>{const t=pe(),n=ge();"function"==typeof e.willOpen&&e.willOpen(n),ee.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;Cs(t,n,e),setTimeout((()=>{As(t,n)}),10),Re()&&(xs(t,e.scrollbarPadding,s),(()=>{const e=pe();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))})()),De()||ee.previousActiveElement||(ee.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),ee.eventEmitter.emit("didOpen",n),We(t,se["no-transition"])},vs=e=>{const t=ge();if(e.target!==t||!at)return;const n=pe();t.removeEventListener(at,vs),n.style.overflowY="auto"},As=(e,t)=>{at&&Ye(t)?(e.style.overflowY="hidden",t.addEventListener(at,vs)):e.style.overflowY="auto"},xs=(e,t,n)=>{(()=>{if(Ut&&!Fe(document.body,se.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",Ve(document.body,se.iosfix),qt()}})(),t&&"hidden"!==n&&Xt(n),setTimeout((()=>{e.scrollTop=0}))},Cs=(e,t,n)=>{Ve(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),qe(t,"grid"),setTimeout((()=>{Ve(t,n.showClass.popup),t.style.removeProperty("opacity")}),10)):qe(t,"grid"),Ve([document.documentElement,document.body],se.shown),n.heightAuto&&n.backdrop&&!n.toast&&Ve([document.documentElement,document.body],se["height-auto"])};var ks={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function Ss(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=ks.email),"url"===e.input&&(e.inputValidator=ks.url))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&ae("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(ae('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
      ")),nt(e)}let _s;var Es=new WeakMap;class Is{constructor(){if(J(this,Es,void 0),"undefined"==typeof window)return;_s=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if((e=>{!1===e.backdrop&&e.allowOutsideClick&&ae('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Pn(t),e.toast&&Vn(t),Wn(t)})(Object.assign({},t,e)),ee.currentInstance){const e=Wt.swalPromiseResolve.get(ee.currentInstance),{isAwaitingPromise:t}=ee.currentInstance;ee.currentInstance._destroy(),t||e({isDismissed:!0}),Re()&&Gt()}ee.currentInstance=_s;const n=Ns(e,t);Ss(n),Object.freeze(n),ee.timeout&&(ee.timeout.stop(),delete ee.timeout),clearTimeout(ee.restoreFocusTimeout);const s=Os(_s);return Tt(_s,n),ct.innerParams.set(_s,n),Ts(_s,s,n)}then(e){return Q(Es,this).then(e)}finally(e){return Q(Es,this).finally(e)}}const Ts=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};Wt.swalPromiseResolve.set(e,s),Wt.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{(e=>{const t=ct.innerParams.get(e);e.disableButtons(),t.input?mn(e,"confirm"):vn(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=ct.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?mn(e,"deny"):yn(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Ot.cancel)})(e,i)},t.closeButton.onclick=()=>{i(Ot.close)},((e,t,n)=>{e.toast?Xn(e,t,n):(Qn(t),Jn(t),es(e,t,n))})(n,t,i),((e,t,n)=>{Rt(e),t.toast||(e.keydownHandler=e=>Bt(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:ge(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(ee,n,i),((e,t)=>{"select"===t.input||"radio"===t.input?hn(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(ce(t.inputValue)||de(t.inputValue))&&(an(Ce()),dn(e,t))})(e,n),ws(n),Rs(ee,n,i),Ds(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Ns=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return ys(n),Object.assign(cs(n),hs(n),ds(n),ps(n),fs(n),ms(n),gs(n,us))})(e),s=Object.assign({},Rn,t,n,e);return s.showClass=Object.assign({},Rn.showClass,s.showClass),s.hideClass=Object.assign({},Rn.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Os=e=>{const t={popup:ge(),container:pe(),actions:Ee(),confirmButton:Ce(),denyButton:Se(),cancelButton:ke(),loader:_e(),closeButton:Ne(),validationMessage:xe(),progressSteps:Ae()};return ct.domCache.set(e,t),t},Rs=(e,t,n)=>{const s=Te();je(s),t.timer&&(e.timeout=new ls((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(qe(s),Be(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&Qe(t.timer)}))))},Ds=(e,t)=>{if(!t.toast)return ue(t.allowEnterKey)?void(Ms(e)||Fs(e,t)||Dt(-1,1)):(le("allowEnterKey"),void Bs())},Ms=e=>{const t=e.popup.querySelectorAll("[autofocus]");for(const e of t)if(e instanceof HTMLElement&&Xe(e))return e.focus(),!0;return!1},Fs=(e,t)=>t.focusDeny&&Xe(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&Xe(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!Xe(e.confirmButton))&&(e.confirmButton.focus(),!0),Bs=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Is.prototype.disableButtons=En,Is.prototype.enableButtons=_n,Is.prototype.getInput=Cn,Is.prototype.disableInput=Tn,Is.prototype.enableInput=In,Is.prototype.hideLoading=An,Is.prototype.disableLoading=An,Is.prototype.showValidationMessage=Nn,Is.prototype.resetValidationMessage=On,Is.prototype.close=Yt,Is.prototype.closePopup=Yt,Is.prototype.closeModal=Yt,Is.prototype.closeToast=Yt,Is.prototype.rejectPromise=Jt,Is.prototype.update=Gn,Is.prototype._destroy=qn,Object.assign(Is,os),Object.keys(Kn).forEach((e=>{Is[e]=function(){return _s&&_s[e]?_s[e](...arguments):null}})),Is.DismissReason=Ot,Is.version="11.14.0";const zs=Is;zs.default=zs,"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}');const Ls=32,Ps=3,Vs=(e,t)=>"left"===e?.1*t:.9*t;function Ws(e,t,n){e.fillStyle="#000",e.fillRect(t-(Ls>>1),n-(Ps>>1),Ls,Ps),e.fillRect(t-(Ps>>1),n-(Ls>>1),Ps,Ls)}const Gs=30;function Us(e,t,n){return"left"===e?[t+(Ls+Gs)/2,n-(Gs>>1)]:[Gs>>1,t-(Ls+Gs)/2]}const qs=(e,{showIcon:t})=>({icon:t?"info":void 0,allowEscapeKey:!1,allowEnterKey:!1,allowOutsideClick:!1,showConfirmButton:!0,confirmButtonText:G.H.RC_ok[e.L],showClass:{popup:"fadeInUp",icon:""},hideClass:{popup:"fadeOutDown"},iconColor:e._CONST.COLOR.ORANGE,confirmButtonColor:"#aaa",customClass:{popup:"my__swal2__container",icon:"my__swal2__icon",title:"my__swal2__title",htmlContainer:`my__swal2__html rc-lang-${e.LD.toLowerCase()}`,confirmButton:"rc-button rc-go-button"}});let js;"mocha"!==_._&&(js=__webpack_require__(477).l);function Hs(e,t,n=!1,s=void 0){const r=t.control;let i=e._CONST.N.PPI_DONT_USE;e.screenPpi&&(i=e.screenPpi.value);let a=!0,o=[],l=0;const u=document.createElement("div");u.innerHTML='',e.background.appendChild(u),e._constructFloatInstructionElement("blind-spot-instruction",G.H.RC_distanceTrackingCloseL[e.L]),e._addCreditOnBackground(G.H.RC_viewingBlindSpotCredit[e.L]);const c=document.querySelector("#blind-spot-canvas"),h=c.getContext("2d"),d=document.getElementById("blind-spot-instruction");let p="left";e._setFloatInstructionElementPos(p,16);let f,m=Vs(p,c.width);const g=()=>{c.width=window.innerWidth,c.height=window.innerHeight,c.style.width=`${c.width}px`,c.style.height=`${c.height}px`,m=Vs(p,c.width),f=Us(p,m,c.width)},y=new ResizeObserver((()=>{g()}));y.observe(e.background),g();let b=f["left"===p?0:1],w=b,v=e._CONST.COLOR.DARK_RED,A="left"===p?1:-1;const x=(t=!0)=>{a=!1,r&&function(e,t){document.getElementById(e).removeEventListener("mousedown",t),document.getElementById(e).removeEventListener("touchstart",t)}("blind-spot-canvas",B),y.unobserve(e.background),e._removeBackground(),!e._trackingSetupFinishedStatus.distance&&t&&(e._trackingSetupFinishedStatus.distance=!0,e.gazeTracker.checkInitialized("distance",!1)&&e.endDistance()),(0,V.l)(D),(0,V.l)(M,"keyup")},C=async()=>{if("mocha"!==_._&&js(),l+=1,o.push({dist:(0,E.Nh)($s(b,m,i),t.decimalPlace),v:A,closedEyeSide:p,crossX:m,circleX:b,ppi:i,timestamp:performance.now()}),2===Math.floor(l/t.repeatTesting))if(function(e){const t=[],n=[];for(const s of e)"left"===s.closedEyeSide?t.push(s.dist):n.push(s.dist);const s=(0,E.G8)(t),r=(0,E.G8)(n);return Math.abs(s-r)<.2*Math.min(s,r)}(o)){const r={value:(0,E.Nh)((0,E.JZ)(Ks(o)),t.decimalPlace),timestamp:performance.now(),method:e._CONST.VIEW_METHOD.B,raw:{...o}};let i;e.newViewingDistanceData=r,i=n?"trackDistance":"measureDistance",x(!1),t.check?await e._checkDistance(s,r,i,t.checkCallback):(0,E.nB)(s,r)}else{l=0;const t=o[0];R(t.v,t.closedEyeSide,t.crossX),o=[],zs.fire({...qs(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingBlindSpotRejected[e.L],allowEnterKey:!0})}else l%t.repeatTesting==0?("left"===p?(p="right",d.innerHTML=G.H.RC_distanceTrackingCloseR[e.L]):(p="left",d.innerHTML=G.H.RC_distanceTrackingCloseL[e.L]),e._setFloatInstructionElementPos(p,16),R(1,p,Vs(p,c.width),!1,!0)):(A=-A,O(p,f))};let k=!1,S=null;const I=t=>{k||(T(),k=!0,v=e._CONST.COLOR.RED,S=setInterval((()=>{"ArrowLeft"===t.key?(b-=10,N()):"ArrowRight"===t.key&&(b+=10,N())}),30))},T=()=>{k=!1,v=e._CONST.COLOR.DARK_RED,S&&(clearInterval(S),S=null)},N=()=>{w=(0,E.AU)(b,...f),b=w},O=(e,t)=>{const n=t["left"===e?0:1],s=Math.abs(t[1]-t[0])/4;let r=(0,E.Av)(n-s,n+s);(r-t[0])*(r-t[1])>0&&(r=2*n-r),b=r},R=(t,n,s,r=!0,i=!0)=>{A=t,p=n,m=s,f=Us(p,m,c.width),r&&(d.innerHTML="left"===p?G.H.RC_distanceTrackingCloseL[e.L]:G.H.RC_distanceTrackingCloseR[e.L],e._setFloatInstructionElementPos(p,16)),i&&(b=f["left"===p?0:1],O(n,f))},D=(0,V.m)({Escape:t.showCancelButton?x:void 0,Enter:C," ":C,ArrowLeft:r?I:E.Md,ArrowRight:r?I:E.Md}),M=(0,V.m)({ArrowLeft:r?T:E.Md,ArrowRight:r?T:E.Md},"keyup");(0,W.F)(e.L,e.background,{go:C,cancel:t.showCancelButton?x:void 0,custom:{callback:()=>{zs.fire({...qs(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingDistanceIntroLiMethod[e.L],allowEnterKey:!0})},content:G.H.RC_viewingDistanceIntroTitle[e.L]}},e.params.showCancelButton);const F={x:null,circleX:null},B=t=>{const n=!!t.touches?.[0];let s,r;if(n||t.preventDefault(),n?(s=t.touches[0].clientX,r=t.touches[0].clientY):(s=t.clientX,r=t.clientY),i=b,a=c.height/2,o=s,l=r,(0,E.ll)(i,a,o,l)>1){F.x=s,F.circleX=b;const r=document.getElementById("blind-spot-canvas");v=e._CONST.COLOR.RED,r.classList.replace("cursor-grab","cursor-grabbing");const i=e=>{let s;t.preventDefault(),e.preventDefault(),s=n?e.touches[0].clientX:e.clientX,b=F.circleX+s-F.x,b=(0,E.AU)(b,...Us(p,m,c.width))};n?document.addEventListener("touchmove",i):document.addEventListener("mousemove",i);const a=()=>{n?(document.removeEventListener("touchend",a),document.removeEventListener("touchmove",i)):(document.removeEventListener("mouseup",a),document.removeEventListener("mousemove",i)),F.x=null,F.circleX=null,v=e._CONST.COLOR.DARK_RED,r.classList.replace("cursor-grabbing","cursor-grab")};n?document.addEventListener("touchend",a):document.addEventListener("mouseup",a)}var i,a,o,l};r&&function(e,t){document.getElementById(e).addEventListener("mousedown",t),document.getElementById(e).addEventListener("touchstart",t)}("blind-spot-canvas",B);const z=performance.now();let L=z;const P=()=>{h.clearRect(0,0,c.width,c.height),Ws(h,m,c.height/2),L=performance.now(),function(e,t,n,s,r,i,a=!0){t.beginPath(),t.arc(n,s,Gs>>1,0,2*Math.PI),t.closePath(),t.fillStyle=a?r%125<63?i:"#fff":i,t.fill()}(0,h,b,c.height/2,Math.round(L-z),v,t.sparkle),r||(b+=5*A,N()),a?requestAnimationFrame(P):h.clearRect(0,0,c.width,c.height)};requestAnimationFrame(P)}function $s(e,t,n){return Math.abs(t-e)/n/(s=15,Math.tan(s*Math.PI/180))/.3937;var s}function Ks(e){const t=[];for(const n of e)t.push(n.dist);return t}function Xs(e,t={framerate:60,break:!1}){let n=0,s=0,r=0;const i=1e3/t.framerate,a=()=>{t.break||requestAnimationFrame(a),n=performance.now(),r=n-s,r>i&&(s=n-r%i,e())};requestAnimationFrame(a)}_.A.prototype.measureDistance=function(e={},t=void 0){if(!this.checkInitialized())return;let n;(0,E.$k)(),n=(e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const s=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,decimalPlace:1,control:!0,headline:`📏 ${G.H.RC_viewingDistanceTitle[this.L]}`,description:n,check:!1,checkCallback:!1,showCancelButton:!0},e);this.getFullscreen(s.fullscreen),this._addBackground(),this._replaceBackground((0,E.$O)(s.headline,null,!0,"")),Hs(this,s,!1,t)};var Zs=__webpack_require__(2646);const Ys=async e=>{if(navigator.permissions?.query)return navigator.permissions.query({name:"camera"}).then((async t=>{if("prompt"===t.state)return await zs.fire({...qs(e,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAFACAYAAAAszc0KAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAG9jSURBVHgB7b17sGTXVea5b95bVSpJpVfJjypkIzRYtizT3QgZcDvC2KYnosc2MDN0B9gYeoDBDmJiCAIb5q8Z7Oie+YMAzzAdMQwYHBOEZUFDu8e26I6gAZvpoQ3Y2DTYlmUbWS+XZFepJFWV6l2VnSuv1tXKdb+19j6ZeTNP3vp+EffmOfvs5zlnn/2dtR9n7fjx48MyI8PhZhRra2vb3DLEf+RP3G181h2F1X3768NkcUduUVo2jA+blauFKP82XWUwGIx/L1++vC0M2pdfCZOdd5SWL3MURuPX/Nh0rZ/a+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CEBUKXxF9g8z647isMfscRSHT7ev2Mbb7itoG4mIadJF++gBqA2E7+r0IrWWP/+wRXnyjRcSHVGjkzVY6EHv8+tX9o8ET8v5rzXySIzUxsqha+PTQ3H7svn8RefRxunzUhOSPkzkZvNRm7Hu/SE/Uf7QvZedM+uezbqO8prd33ocnfesbmTh/G+tbkTnEtWb3Vr//deWaufPp5PV76wuErIbqY4B9BUANYLZw8EKpRYiUdU3sodN5D86V+jBZ69DFLd/eHr/0RIVKJyPV/17d+t/GLzB1x62/tcfR3mwZcriREQWNhu/z7d3K0H+dDu7X/34u6zRRUIX5QGVN7IWeuGABvNH1zwSiD6+2jmyZfHxeL+RWPT3XnYu/fmO7s1MFEV5bL0eNi/o3vJptMTlBQ/K+26r//ZZWBO/vrwoX/bc+DKiOpw9gwlZZSYWgo5ufnRc3f1xtC34SR9+37rrm5649WUZmK5EjYgFuWf+0AO11lgNh+0iOsrnNGG8IK3lK0t72nyhdOZJLV+166VuQsv94c8j2o6OdT2HXfIVuflj09zH08SH/CuR/9bzM+860iVN1v+2vHiR2xIG7VP0kd3ONtOIf1iiY7aCZG+UUWXXSur9RA+L3YCeJ7vtHzyZP/uL4hbscXs+/TVB+/7h6fOR/UblVHy+kP+obD5MlD+0bcNEYe1xFKYlTh+3z3cU3t/rvhz+nPgXMOuvBGXNGuesHD496x+VC7m11P+W+KNri54j0XXyzxcft1qXUDrZOYryGF1vu43ywfq/ndb6Xzs/0b2J7qkoL4TsJv4z+hgOOCHGmwAAAAAASUVORK5CYII=",imageWidth:480,imageAlt:"Please allow camera access",html:`${G.H.RC_requestCamera[e.L]}
      ${G.H.RC_privacyCamera[e.L]}`})})).catch((e=>{}))},Qs={video:!1};_.A.prototype.trackDistance=async function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return;let s;(0,E.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel(),s=(void 0!==e.control&&e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const r=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showVideo:!0,showFaceOverlay:!1,decimalPlace:1,framerate:3,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0,nearPoint:!0,showNearPoint:!1,control:!0,headline:`📏 ${G.H.RC_distanceTrackingTitle[this.L]}`,description:G.H.RC_distanceTrackingIntroStart[this.L]+(0,Zs.G)(this.L)+s+(0,Zs.G)(this.L)+G.H.RC_distanceTrackingIntroEnd[this.L],check:!1,checkCallback:null,showCancelButton:!0},e);if(this.getFullscreen(r.fullscreen),this.gazeTracker.checkInitialized("distance"))return this.gazeTracker._toFixedN=r.decimalPlace,this.showNearPoint(r.showNearPoint),this.showVideo(r.showVideo),void this.showFaceOverlay(r.showFaceOverlay);this._addBackground(),this._constructFloatInstructionElement("gaze-system-instruction",G.H.RC_starting[this.L]),await Ys(this);const i=e=>{this.showVideo(Qs.video),Qs.video=!1,this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(a),(0,E.nB)(t,e),nr.current=e},a=this.gazeTracker.webgazer.params.showGazeDot,o=async()=>{this._addBackground(),this._replaceBackground((0,E.$O)(r.headline,null,!0,"")),this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(!1),Hs(this,r,!0,i)};tr.pipWidthPx=r.pipWidthPx,tr.decimalPlace=r.decimalPlace,tr.framerate=r.framerate,tr.nearPoint=r.nearPoint,tr.showNearPoint=r.showNearPoint,tr.desiredDistanceCm=r.desiredDistanceCm,tr.desiredDistanceTolerance=r.desiredDistanceTolerance,tr.desiredDistanceMonitor=r.desiredDistanceMonitor,tr.desiredDistanceMonitorCancelable=r.desiredDistanceMonitorCancelable,tr.desiredDistanceMonitorAllowRecalibrate=r.desiredDistanceMonitorAllowRecalibrate,Qs.video=r.showVideo,this.gazeTracker._init({toFixedN:1,showVideo:!0,showFaceOverlay:r.showFaceOverlay},"distance"),this._trackingSetupFinishedStatus.distance=!1;const l={options:r,callbackStatic:t,callbackTrack:n};r.nearPoint?Js(this,(()=>this._measurePD({},o)),n,l):Js(this,o,n,l)};const Js=async(e,t,n,s)=>{await e.gazeTracker.webgazer.getTracker().loadModel(),e.gazeTracker.beginVideo({pipWidthPx:tr.pipWidthPx},(()=>{e._removeFloatInstructionElement(),(0,E.nB)(t),hr(e,tr,n,s)}))},er=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y,e.z-t.z),tr={pipWidthPx:0,decimalPlace:2,framerate:3,nearPoint:!0,showNearPoint:!1,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0},nr={current:null};let sr=null,rr=null,ir=null;const ar={framerate:20,break:!0};let or=null,lr=!1,ur=0,cr=1;const hr=async(e,t,n,s)=>{(0,E.yy)(1e3).then((async()=>{let r;ur=0,cr=1;const i=await e.gazeTracker.webgazer.getTracker().model,a=e.screenPpi?e.screenPpi.value:e._CONST.N.PPI_DONT_USE;!e.screenPpi&&t.nearPoint,t.nearPoint&&t.showNearPoint&&(or=document.createElement("div"),or.id="rc-near-point-dot",document.body.appendChild(or),Object.assign(or.style,{display:"block",zIndex:999999,width:"10px",height:"10px",background:"green",position:"fixed",top:"-15px",left:"-15px"})),lr=!1;const{desiredDistanceCm:o,desiredDistanceTolerance:l,desiredDistanceMonitor:u,desiredDistanceMonitorCancelable:c,desiredDistanceMonitorAllowRecalibrate:h}=t;e._distanceTrackNudging.distanceCorrectEnabled=!0,e._distanceTrackNudging.distanceDesired=o,e._distanceTrackNudging.distanceAllowedRatio=l,ir=async()=>{rr||(rr=document.getElementById("webgazerVideoCanvas"));const l=performance.now();if(r=await i.estimateFaces(rr),r.length){e._trackingVideoFrameTimestamps.distance+=l;const i=r[0].keypoints;if(5===cr){if(ur+=er(i[133],i[362]),ur/=5,e._trackingVideoFrameTimestamps.distance/=5,null!==nr.current){if(!sr){const t=pr(a),n=Math.sqrt(nr.current.value**2-t**2);nr.current.value=n,sr=ur*nr.current.value,!0!==s.options.check&&e._removeBackground(),e._trackingSetupFinishedStatus.distance=!0,lr=!0}const r=performance.now(),l=Math.round(r-e._trackingVideoFrameTimestamps.distance),d={value:(0,E.Nh)(sr/ur,t.decimalPlace),timestamp:r,method:e._CONST.VIEW_METHOD.F,latencyMs:l};let p;e.newViewingDistanceData=d,(lr||u)&&(o&&e.nudgeDistance(c,h,s),lr=!1),t.nearPoint&&(p=dr(e,t,rr,i,ur,r,a,l)),n&&"function"==typeof n&&(e.gazeTracker.defaultDistanceTrackCallback=n,n({value:{viewingDistanceCm:d.value,nearPointCm:p?p.value:[null,null],latencyMs:l},timestamp:r,method:e._CONST.VIEW_METHOD.F}))}ur=0,cr=1,e._trackingVideoFrameTimestamps.distance=0}else ur+=er(i[133],i[362]),++cr}},ar.break=!1,ar.framerate=5*t.framerate,Xs(ir,ar)}))},dr=(e,t,n,s,r,i,a,o)=>{const l=((e,t,n)=>[(-t.x-n.x+e.videoWidth)/2,(-t.y-n.y+e.videoHeight)/2])(n,s[133],s[362]);l.forEach(((t,n)=>{l[n]=(e.PDCm?e.PDCm.value:e._CONST.N.PD_DONT_USE)*t/r}));const u={value:{x:(0,E.Nh)(l[0],t.decimalPlace),y:(0,E.Nh)(l[1]+screen.height/2*2.54/a,t.decimalPlace),latencyMs:o},timestamp:i};e.newNearPointData=u;if(t.showNearPoint){const e=u.value.x*a/2.54,t=u.value.y*a/2.54;Object.assign(or.style,{left:screen.width/2-window.screenLeft+e-5+"px",top:screen.height/2-window.screenTop-(window.outerHeight-window.innerHeight)-t-5+"px"})}return u};_.A.prototype.pauseDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&!this._trackingPaused.distance?(ar.break=!0,or&&(or.style.display="none"),this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!0,this.pauseNudger(),this):null},_.A.prototype.resumeDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&this._trackingPaused.distance?(ar.break=!1,or&&(or.style.display="block"),ur=0,cr=1,this._trackingVideoFrameTimestamps.distance=0,Xs(ir,ar),this._trackingPaused.distance=!1,this.resumeNudger(),this):null},_.A.prototype.endDistance=function(e=!1,t=!0){return this.gazeTracker.checkInitialized("distance",!0)?(ar.break=!0,ar.framerate=20,tr.pipWidthPx=0,tr.decimalPlace=2,tr.framerate=3,tr.nearPoint=!0,tr.showNearPoint=!1,tr.desiredDistanceCm=void 0,tr.desiredDistanceTolerance=1.2,tr.desiredDistanceMonitor=!1,tr.desiredDistanceMonitorCancelable=!1,tr.desiredDistanceMonitorAllowRecalibrate=!0,nr.current=null,sr=null,rr=null,ir=null,lr=!1,this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!1,or&&(document.body.removeChild(or),or=null),this.endNudger(),t&&this.gazeTracker.end("distance",e),this):null},_.A.prototype.getDistanceNow=async function(e=null){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("distance",!0)||!ar.break)return;const t=e||this.gazeTracker.defaultDistanceTrackCallback,n=document.querySelector("#webgazerVideoFeed"),s=await this.gazeTracker.webgazer.getTracker().model,r=performance.now(),i=await s.estimateFaces(n);if(i.length){const e=i[0].scaledMesh,s=er(e[133],e[362]),a=performance.now(),o=a-r;this.newViewingDistanceData={value:(0,E.Nh)(sr/s,tr.decimalPlace),timestamp:a,method:this._CONST.VIEW_METHOD.F,latencyMs:o};const l=this.newViewingDistanceData;let u;return tr.nearPoint&&(u=dr(this,tr,n,e,s,a,this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,o)),(0,E.nB)(t,{value:{viewingDistanceCm:l.value,nearPointCm:u?u.value:null,latencyMs:o},timestamp:a,method:this._CONST.VIEW_METHOD.F}),l}return null},_.A.prototype.showNearPoint=function(e=!0){if(this.gazeTracker.checkInitialized("distance",!1)){const t=document.querySelector("#rc-near-point-dot");t&&(t.display=e?"block":"none")}};const pr=e=>2.54*(window.screen.height/2/e);_.A.prototype.nudgeDistance=function(e,t,n){if(this.checkInitialized()&&this._distanceTrackNudging.distanceDesired){if(this.viewingDistanceCm&&this.viewingDistanceCm.method===this._CONST.VIEW_METHOD.F){if(!fr(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)){const s=()=>{this._removeNudger(),clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,(0,V.l)(i)},r=async()=>{this.endDistance(),this._addBackground(),await(0,E.yy)(2e3),this.trackDistance(n.options,n.callbackStatic,n.callbackTrack)},i=(0,V.m)(e?{Escape:this.endNudger}:{});if(null===this._distanceTrackNudging.distanceCorrecting&&this._distanceTrackNudging.distanceCorrectEnabled){const[n,a,o,l]=mr(this);let u=e?{cancel:()=>{this.endNudger()}}:{};t&&(u={...u,custom:{callback:r,content:G.H.RC_distanceTrackingRedo[this.L]}}),(e||t)&&(0,W.F)(this.L,this.nudger,u,this.params.showCancelButton);const c=()=>{n.innerHTML=gr(this,this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired),a.innerHTML=this.viewingDistanceCm.value>100?Math.round(this.viewingDistanceCm.value):this.viewingDistanceCm.value.toFixed(1),o.innerHTML=Math.round(this._distanceTrackNudging.distanceDesired),this._distanceTrackNudging.needEasyEyesKeypadBeyondCm&&this._distanceTrackNudging.distanceDesired>this._distanceTrackNudging.needEasyEyesKeypadBeyondCm?l.innerHTML=` ${G.H.RC_canUsePhoneKeypad[this.L]}`:l.innerHTML=""};c(),this._distanceTrackNudging.distanceCorrecting=setInterval((()=>{c(),fr(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)&&(s(),(0,V.l)(i))}),200)}else this._distanceTrackNudging.distanceCorrecting&&!this._distanceTrackNudging.distanceCorrectEnabled&&s();return!1}return!0}return!1}};const fr=(e,t,n)=>{if(!yr(n))return!1;const s=t*n,r=t/n;return e<=Math.max(s,r)&&e>=Math.min(s,r)},mr=e=>(e._addNudger(`
      \n

      \n

      ${G.H.RC_distanceTrackingGuide[e.L].replace("xx1",'').replace("xx2",'')}

      \n
      \n `),[document.querySelector("#rc-distance-correct-instruction"),document.querySelector("#rc-distance-now"),document.querySelector("#rc-distance-desired"),document.querySelector("#rc-can-use-keypad")]),gr=(e,t,n)=>t>=n?G.H.RC_distanceTrackingMoveCloser[e.L]:G.H.RC_distanceTrackingMoveFurther[e.L],yr=e=>!Number.isNaN(e)&&(e>0&&1!==e);_.A.prototype.setDistanceDesired=function(e,t=null,n=null){return this._distanceTrackNudging.distanceDesired=e,n&&(this._distanceTrackNudging.needEasyEyesKeypadBeyondCm=n),t&&yr(t)&&(this._distanceTrackNudging.distanceAllowedRatio=t),e},_.A.prototype._addNudger=function(e){if(null!==this.nudger)return;let t=document.getElementById("calibration-nudger");return t||(t=document.createElement("div"),t.id="calibration-nudger",t.className=`calibration-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._nudger.element=t,this.nudger},_.A.prototype._removeNudger=function(){const e=document.getElementById("calibration-nudger");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._nudger={element:null},!0)},_.A.prototype.pauseNudger=function(){document.body.classList.add("hide-nudger")},_.A.prototype.resumeNudger=function(){document.body.classList.remove("hide-nudger")},_.A.prototype.endNudger=function(){return!!this._distanceTrackNudging.distanceCorrectEnabled&&(this._removeNudger(),this._distanceTrackNudging.distanceCorrectEnabled=!1,this._distanceTrackNudging.distanceCorrecting&&clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,this._distanceTrackNudging.distanceDesired=null,this._distanceAllowedRatio=null,!0)};function br(e,t,n,s,r){const i=setInterval((()=>{const a=document.getElementById("webgazerVideoContainer");a&&(clearInterval(i),a.style.height=t/Number.parseInt(a.style.width)*Number.parseInt(a.style.height)+"px",a.style.width=`${t}px`,a.style.opacity=n,s.setVideoViewerSize(Number.parseInt(a.style.width),Number.parseInt(a.style.height)),wr(e,a),setTimeout((()=>{e.videoOpacity(),e.isMobile.value?a.style.transition="right 0.5s, top 0.5s, width 0.5s, height 0.5s, border-radius 0.5s":a.style.transition="left 0.5s, bottom 0.5s, width 0.5s, height 0.5s, border-radius 0.5s",(0,E.nB)(r)}),700))}),100)}function wr(e,t){e.isMobile.value?(t.style.left="unset",t.style.right=e._CONST.N.VIDEO_MARGIN,t.style.top=e._CONST.N.VIDEO_MARGIN,t.style.bottom="unset"):(t.style.left=e._CONST.N.VIDEO_MARGIN,t.style.right="unset",t.style.top="unset",t.style.bottom=e._CONST.N.VIDEO_MARGIN)}const vr={video:!1,videoWidth:0,videoHeight:0,opacity:1,gaze:!1,faceOverlay:!1},Ar=.9;_.A.prototype._measurePD=async function(e={},t=void 0){if(!this.checkInitialized())return;(0,E.$k)();const n=Object.assign({fullscreen:!1,headline:`👁️ ${G.H.RC_nearPointTitle[this.L]}`,description:G.H.RC_nearPointIntro[this.L],shortDescription:G.H.RC_nearPointIntro[this.L]},e);this.getFullscreen(n.fullscreen),await(0,E.yy)(1e3),this._replaceBackground(),this._replaceBackground((0,E.$O)(n.headline,n.shortDescription,!0));const s=this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,[r,i]=xr(this),[a,o]=Sr(this,s,r,i),l=(e=!0)=>{a.removeEventListener("mousedown",o),this._removeBackground(),this.showVideo(vr.video),this.showGazer(vr.gaze),this.showFaceOverlay(vr.faceOverlay),this.gazeTracker.webgazer.showFaceFeedbackBox(!0),Object.assign(document.querySelector("#webgazerVideoContainer").style,{height:vr.videoHeight,width:vr.videoWidth,opacity:vr.opacity,borderRadius:"5px"}),wr(this,document.querySelector("#webgazerVideoContainer")),Object.assign(document.querySelector("#webgazerVideoFeed").style,{height:vr.videoHeight,width:vr.videoWidth,top:"unset",transform:"scale(-1, 1)",transformOrigin:"unset"}),vr.video=!1,vr.videoWidth=0,vr.videoHeight=0,vr.opacity=1,vr.gaze=!1,vr.faceOverlay=!1,!this._trackingSetupFinishedStatus.distance&&e&&(this._trackingSetupFinishedStatus.distance=!0,this.endDistance()),(0,V.l)(c)},u=()=>{if(-100!==kr){const e={value:2.54*kr/s,timestamp:performance.now()};return this.newPDData=e,l(!1),(0,E.nB)(t,e)}},c=(0,V.m)({Escape:l,Enter:u," ":u});(0,W.F)(this.L,this.background,{go:u,cancel:l},this.params.showCancelButton),setTimeout((()=>{zs.fire({...qs(this,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAADwCAIAAABXFyDtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGx2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuZGFiYWNiYiwgMjAyMS8wNC8xNC0wMDozOTo0NCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzE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Iq0FO47xVv5SnIkZz0Lz2g9zqdXGpoWCf6k4/v+rms9Dblwk2o4Znc3rRzKRmDt18oZ9x3/yf483VPlzLbdLDtAep/3I6VZRkWoqytThDJ2pKdQsvw+lECNN03RNQRgNw4sU0UaZOxJKGJbFGIF0qrSkQrC7IQWyLIXjcYuFlyUplUgihhn3owAgJt17qrSxacVttyVjUcFmc5eVEkL3v7rpxNYdkMHIxB7w3vKdzz/d3xe8/avf1iLnNO3Syr+yzuQFT8F7yra88qyK+A/ecWcwHhjSF9Fldx4/c6KjvaWystzmdF3Mvk9V1BJnia/E8+prW5Cz/FIQwtCUeUJBodc4AJRC8q8plX9RHCMD1svJg0EIJUmcO2PqXzZue+rl16vKSoxn/39nE9KqgqMETAAAAABJRU5ErkJggg==",imageWidth:480,imageAlt:"Measurement Instruction",html:n.description})}),700)};const xr=e=>{const t=document.querySelector("#webgazerVideoFeed");if(t)return Cr(e,t,document.querySelector("#webgazerVideoCanvas"),document.querySelector("#webgazerVideoContainer"))},Cr=(e,t,n,s,r=null)=>{const i=.3*window.innerWidth/Number.parseInt(t.style.width)*Number.parseInt(t.style.height);vr.videoWidth=s.style.width,vr.videoHeight=s.style.height,vr.opacity=s.style.opacity;const a={height:`${Math.round(i)}px`,width:`${Math.round(window.innerWidth*Ar)}px`,opacity:1,borderRadius:"15px"};Object.assign(s.style,a),e.isMobile.value?Object.assign(s.style,{right:`${Math.round(.5*window.innerWidth*(1-Ar))}px`,top:`${Math.round(.5*(window.innerHeight-i))}px`}):Object.assign(s.style,{left:`${Math.round(.5*window.innerWidth*(1-Ar))}px`,bottom:`${Math.round(.5*(window.innerHeight-i))}px`});const o={height:`${Math.round(i*Ar/.3)}px`,width:`${Math.round(window.innerWidth*Ar)}px`,top:`${Math.round(.6000000000000001*-i)}px`,transform:"scale(-2, 2)",transformOrigin:"center"};return Object.assign(t.style,o),vr.video=e.gazeTracker.webgazer.params.showVideo,vr.gaze=e.gazeTracker.webgazer.params.showGazeDot,vr.faceOverlay=e.gazeTracker.webgazer.params.showFaceOverlay,vr.video||e.showVideo(!0),vr.gaze&&e.showGazer(!1),vr.faceOverlay&&e.showFaceOverlay(!1),e.gazeTracker.webgazer.showFaceFeedbackBox(!1),[window.innerWidth*Ar,i]};let kr=-100;const Sr=(e,t,n,s)=>{const r=document.createElement("div");r.id="rc-ruler",Object.assign(r.style,{height:.9*(window.innerHeight-s)/2+"px",width:2*window.innerWidth+"px",left:.25*(window.innerWidth-n)+"px",bottom:0,backgroundColor:"#FFD523dd",borderRadius:"7px 0 0 0",boxSizing:"border-box",borderBottom:"5px solid #bb6600"}),e.background.appendChild(r);const i=document.createElement("div");i.id="rc-ruler-scales",r.appendChild(i);const a=2.54*(r.clientWidth-60)/t;for(let n=0;n<=10*(0,E.Nh)(a,1);n++){const s=document.createElement("div"),r=.1*n*t/2.54+"px";if(s.className="rc-ruler-scale "+(n%10==0?"rc-ruler-major":n%5==0?"rc-ruler-secondary":"rc-ruler-minor"),s.style.left=r,i.appendChild(s),n%10==0){const t=document.createElement("p");t.className="rc-ruler-scale-text",t.style.left=r,t.innerHTML=n/10,i.appendChild(t),0===n&&(t.style.color=e._CONST.COLOR.DARK_RED)}}let o=document.createElement("div");i.appendChild(o),o.outerHTML=D(),o=document.querySelector("#size-arrow"),o.setAttribute("preserveAspectRatio","none"),o.style.left="-100px",o.style.top="40px",document.getElementById("size-arrow-fill").setAttribute("fill",e._CONST.COLOR.DARK_RED);const l=e=>{kr=e.offsetX-30,o.style.left=`${kr}px`;const t=e=>{kr=e.offsetX-30,o.style.left=`${kr}px`};r.addEventListener("mousemove",t),r.addEventListener("mouseup",(function e(){r.removeEventListener("mousemove",t),r.removeEventListener("mouseup",e)}))};return r.addEventListener("mousedown",l),[r,l]};function _r(e){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(e)}var Er=/^\s+/,Ir=/\s+$/;function Tr(e,t){if(t=t||{},(e=e||"")instanceof Tr)return e;if(!(this instanceof Tr))return new Tr(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,s=null,r=null,i=null,a=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(Er,"").replace(Ir,"").toLowerCase();var t,n=!1;if(Hr[e])e=Hr[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=ii.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=ii.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=ii.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=ii.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=ii.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=ii.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=ii.hex8.exec(e))return{r:Yr(t[1]),g:Yr(t[2]),b:Yr(t[3]),a:ti(t[4]),format:n?"name":"hex8"};if(t=ii.hex6.exec(e))return{r:Yr(t[1]),g:Yr(t[2]),b:Yr(t[3]),format:n?"name":"hex"};if(t=ii.hex4.exec(e))return{r:Yr(t[1]+""+t[1]),g:Yr(t[2]+""+t[2]),b:Yr(t[3]+""+t[3]),a:ti(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=ii.hex3.exec(e))return{r:Yr(t[1]+""+t[1]),g:Yr(t[2]+""+t[2]),b:Yr(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==_r(e)&&(ai(e.r)&&ai(e.g)&&ai(e.b)?(t=function(e,t,n){return{r:255*Xr(e,255),g:255*Xr(t,255),b:255*Xr(n,255)}}(e.r,e.g,e.b),a=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):ai(e.h)&&ai(e.s)&&ai(e.v)?(s=Jr(e.s),r=Jr(e.v),t=function(e,t,n){e=6*Xr(e,360),t=Xr(t,100),n=Xr(n,100);var s=Math.floor(e),r=e-s,i=n*(1-t),a=n*(1-r*t),o=n*(1-(1-r)*t),l=s%6,u=[n,a,i,i,o,n][l],c=[o,n,n,a,i,i][l],h=[i,i,o,n,n,a][l];return{r:255*u,g:255*c,b:255*h}}(e.h,s,r),a=!0,o="hsv"):ai(e.h)&&ai(e.s)&&ai(e.l)&&(s=Jr(e.s),i=Jr(e.l),t=function(e,t,n){var s,r,i;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=Xr(e,360),t=Xr(t,100),n=Xr(n,100),0===t)s=r=i=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=a(l,o,e+1/3),r=a(l,o,e),i=a(l,o,e-1/3)}return{r:255*s,g:255*r,b:255*i}}(e.h,s,i),a=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=Kr(n),{ok:a,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Nr(e,t,n){e=Xr(e,255),t=Xr(t,255),n=Xr(n,255);var s,r,i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(i==a)s=r=0;else{var l=i-a;switch(r=o>.5?l/(2-i-a):l/(i+a),i){case e:s=(t-n)/l+(t>1)+720)%360;--t;)s.h=(s.h+r)%360,i.push(Tr(s));return i}function jr(e,t){t=t||6;for(var n=Tr(e).toHsv(),s=n.h,r=n.s,i=n.v,a=[],o=1/t;t--;)a.push(Tr({h:s,s:r,v:i})),i=(i+o)%1;return a}Tr.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Kr(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Or(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Or(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=Nr(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Nr(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return Rr(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,r){var i=[Qr(Math.round(e).toString(16)),Qr(Math.round(t).toString(16)),Qr(Math.round(n).toString(16)),Qr(ei(s))];if(r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Xr(this._r,255))+"%",g:Math.round(100*Xr(this._g,255))+"%",b:Math.round(100*Xr(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Xr(this._r,255))+"%, "+Math.round(100*Xr(this._g,255))+"%, "+Math.round(100*Xr(this._b,255))+"%)":"rgba("+Math.round(100*Xr(this._r,255))+"%, "+Math.round(100*Xr(this._g,255))+"%, "+Math.round(100*Xr(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&($r[Rr(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Dr(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var r=Tr(e);n="#"+Dr(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Tr(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(zr,arguments)},brighten:function(){return this._applyModification(Lr,arguments)},darken:function(){return this._applyModification(Pr,arguments)},desaturate:function(){return this._applyModification(Mr,arguments)},saturate:function(){return this._applyModification(Fr,arguments)},greyscale:function(){return this._applyModification(Br,arguments)},spin:function(){return this._applyModification(Vr,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(qr,arguments)},complement:function(){return this._applyCombination(Wr,arguments)},monochromatic:function(){return this._applyCombination(jr,arguments)},splitcomplement:function(){return this._applyCombination(Ur,arguments)},triad:function(){return this._applyCombination(Gr,[3])},tetrad:function(){return this._applyCombination(Gr,[4])}},Tr.fromRatio=function(e,t){if("object"==_r(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:Jr(e[s]));e=n}return Tr(e,t)},Tr.equals=function(e,t){return!(!e||!t)&&Tr(e).toRgbString()==Tr(t).toRgbString()},Tr.random=function(){return Tr.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Tr.mix=function(e,t,n){n=0===n?0:n||50;var s=Tr(e).toRgb(),r=Tr(t).toRgb(),i=n/100;return Tr({r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a})},Tr.readability=function(e,t){var n=Tr(e),s=Tr(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},Tr.isReadable=function(e,t,n){var s,r,i=Tr.readability(e,t);switch(r=!1,(s=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+s.size){case"AAsmall":case"AAAlarge":r=i>=4.5;break;case"AAlarge":r=i>=3;break;case"AAAsmall":r=i>=7}return r},Tr.mostReadable=function(e,t,n){var s,r,i,a,o=null,l=0;r=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var u=0;ul&&(l=s,o=Tr(t[u]));return Tr.isReadable(e,o,{level:i,size:a})||!r?o:(n.includeFallbackColors=!1,Tr.mostReadable(e,["#fff","#000"],n))};var Hr=Tr.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},$r=Tr.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(Hr);function Kr(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Xr(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Zr(e){return Math.min(1,Math.max(0,e))}function Yr(e){return parseInt(e,16)}function Qr(e){return 1==e.length?"0"+e:""+e}function Jr(e){return e<=1&&(e=100*e+"%"),e}function ei(e){return Math.round(255*parseFloat(e)).toString(16)}function ti(e){return Yr(e)/255}var ni,si,ri,ii=(si="[\\s|\\(]+("+(ni="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+ni+")[,|\\s]+("+ni+")\\s*\\)?",ri="[\\s|\\(]+("+ni+")[,|\\s]+("+ni+")[,|\\s]+("+ni+")[,|\\s]+("+ni+")\\s*\\)?",{CSS_UNIT:new RegExp(ni),rgb:new RegExp("rgb"+si),rgba:new RegExp("rgba"+ri),hsl:new RegExp("hsl"+si),hsla:new RegExp("hsla"+ri),hsv:new RegExp("hsv"+si),hsva:new RegExp("hsva"+ri),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function ai(e){return!!ii.CSS_UNIT.exec(e)}var oi=__webpack_require__(782);const li=e=>e/2.54,ui={video:!1,gazer:!1};function ci(e,t){e.background?e._replaceBackground((0,E.$O)(t.headline,t.description)):e._addBackground((0,E.$O)(t.headline,t.description)),e._constructFloatInstructionElement("gaze-system-instruction",G.H.RC_starting[e.L])}_.A.prototype.calibrateGaze=function(e={},t=void 0){if(!this.gazeTracker.checkInitialized("gaze",!0))return;(0,E.$k)();const n=Object.assign({greedyLearner:!1,calibrationCount:1,headline:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);n.nudge=!1,ui.video=this.gazeTracker.webgazer.params.showVideo,ui.gazer=this.gazeTracker.webgazer.params.showGazeDot,ui.video||this.showVideo(!0),ui.gazer||this.showGazer(!0),this.gazeTracker.webgazer.params.greedyLearner=n.greedyLearner,ci(this,n);const s=hi(this,n,(()=>{this._removeBackground(),(0,V.l)(r),(0,E.nB)(t,{timestamp:performance.now()})})),r=(0,V.m)({Escape:()=>{s.deleteSelf(!1),this._removeBackground(),this.showVideo(ui.video),this.showGazer(ui.gazer),ui.video=!1,ui.gazer=!1,this._trackingSetupFinishedStatus.gaze||(this._trackingSetupFinishedStatus.gaze=!0,this.endGaze()),(0,V.l)(r)}})};const hi=(e,t,n)=>(e._removeFloatInstructionElement(),new di(e,document.body,t,ui,n));class di{constructor(e,t,n,s,r){this._sequentialOrder(n.nudge),this.nudge=n.nudge,this.RC=e,this.clickThresholdBase=oi.Y?1:n.calibrationCount,this.clicks=0,this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.r=this.RC._CONST.N.GAZE_CALIBRATION.R,this.div=document.createElement("div");const i=document.createElement("div"),a=document.createElement("div");this.div.className="rc-crosshair",this.div.id="rc-crosshair",i.className="rc-crosshair-component rc-crosshair-vertical",a.className="rc-crosshair-component rc-crosshair-horizontal",a.style.height=i.style.width=`${Ps}px`,a.style.width=i.style.height=`${Ls}px`,this.div.style.background=e.params.backgroundColor;const o=Tr(e.params.backgroundColor).toRgb();this.div.style.background=`rgba(${o.r}, ${o.g}, ${o.b}, 0.75)`,this.div.appendChild(i),this.div.appendChild(a),this.parent=t,this.parent.appendChild(this.div),this.placeDot(),this.handleClick=this.takeClick.bind(this),this.div.addEventListener("click",this.handleClick,!1),this.originalStyles=s,this.endCalibrationCallback=r}placeDot(){Object.assign(this.div.style,[{left:`${this.RC._CONST.N.GAZE_CALIBRATION.MARGIN}px`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,right:"unset"},{left:window.innerWidth-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"}][this.position[0]],[{top:`${this.RC._CONST.N.GAZE_CALIBRATION.MARGIN}px`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,bottom:"unset"},{top:window.innerHeight-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"}][this.position[1]])}takeClick(e){if(this.clickAtCenter(e)){this.clicks++,this.clicks>=this.clickThreshold&&(this.order.length?(this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.placeDot(),this.clicks=0):this.deleteSelf(!0));const e=document.querySelectorAll(".leader-line");e&&e.map((e=>{e.style.opacity=0}))}}deleteSelf(e=!0){this.div.removeEventListener("click",this.handleClick,!1),this.parent.removeChild(this.div),e&&(this.nudge||this.RC.showVideo(this.originalStyles.video),this.nudge||(this.originalStyles.video=!1),this.RC.showGazer(this.originalStyles.gazer),this.originalStyles.gazer=!1,(0,E.nB)(this.endCalibrationCallback),this.nudge||(this.RC._trackingSetupFinishedStatus.gaze=!0))}clickAtCenter(e){const{x:t,y:n}=(0,E.KY)(e),{left:s,top:r,right:i,bottom:a}=this.div.getBoundingClientRect(),o=(s+i)/2,l=(r+a)/2;return t>=o-5&&t<=o+5&&n>=l-5&&n<=l+5}_randomOrder(){this.order=[];for(const e of[0,1,2])for(const t of[0,1,2])this.order.push([e,t]);(0,E.k4)(this.order)}_sequentialOrder(e=!1){this.order=e?[[1,1],[1,3],[4,1],[1,4],[3,1],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1]]:oi.Y?[[0,0],[2,0],[2,2],[0,2],[1,1]]:[[1,1],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1],[0,0],[1,1],[1,2],[2,2],[2,1],[2,0],[1,0],[0,0],[0,1],[0,2],[1,1],[1,5],[6,5],[6,1],[6,6],[1,6],[5,6],[5,1],[5,5],[1,1],[1,6],[6,6],[6,1],[6,5],[1,5],[5,5],[5,1],[5,6],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1],[1,3],[4,1],[1,4],[3,1],[1,1]]}getOffsetPx(e,t=null){const n=(s=e,r=this.RC.screenPpi?this.RC.screenPpi.value:this.RC._CONST.N.PPI_DONT_USE,i=this.RC.viewingDistanceCm?this.RC.viewingDistanceCm.value:this.RC._CONST.N.VIEW_DIST_DONT_USE,li(r)*i*Math.tan(s*(Math.PI/180)));var s,r,i;return t?Math.min(n,t):n}}_.A.prototype.trackGaze=async function(e={},t=null,n=null){if(!this.checkInitialized())return;(0,E.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel();const s=Object.assign({fullscreen:!1,greedyLearner:!1,framerate:60,showGazer:!0,showVideo:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showFaceOverlay:!1,calibrationCount:1,thresholdDeg:10,decimalPlace:0,headline:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);if(this.getFullscreen(s.fullscreen),this.gazeTracker.checkInitialized("gaze"))return this.gazeTracker._toFixedN=s.decimalPlace,this.showGazer(s.showGazer),this.showVideo(s.showVideo),this.showFaceOverlay(s.showFaceOverlay),this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n);this._addBackground(),await Ys(this),this.gazeTracker._init({greedyLearner:s.greedyLearner,framerate:s.framerate,toFixedN:s.decimalPlace,showVideo:s.showVideo,showFaceOverlay:s.showFaceOverlay,showGazer:s.showGazer},"gaze"),ci(this,s);const r={pipWidthPx:s.pipWidthPx},i={greedyLearner:s.greedyLearner,calibrationCount:s.calibrationCount,headline:s.headline,description:s.description};this.gazeTracker.begin(r,(()=>{this._trackingSetupFinishedStatus.gaze=!1,this.calibrateGaze(i,a)}));const a=e=>{(0,E.nB)(t,e),this.gazeTracker.webgazer.params.greedyLearner||this.gazeTracker.stopLearning({click:!0,move:!0});return s.thresholdDeg,this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n)}},_.A.prototype.getGazeNow=async function(e={},t=null){if(!(this.checkInitialized()&&this.gazeTracker.checkInitialized("gaze",!0)&&this.gazeTracker.webgazer.params.paused&&this._trackingPaused.gaze))return;const n=Object.assign({wait:0,frames:5},e),s=t||this.gazeTracker.defaultGazeCallback;return await this.gazeTracker.getGazeNow(n,s)},_.A.prototype.pauseGaze=function(){!this.gazeTracker.checkInitialized("gaze",!0)&&this._trackingPaused.gaze||(this._trackingPaused.gaze=!0,this.gazeTracker.pause())},_.A.prototype.resumeGaze=function(){(this.gazeTracker.checkInitialized("gaze",!0)||this._trackingPaused.gaze)&&(this._trackingPaused.gaze=!1,this.gazeTracker.resume())},_.A.prototype.endGaze=function(e=!1){this.gazeTracker.checkInitialized("gaze",!0)&&(this._trackingPaused.gaze=!1,this.gazeTracker.end("gaze",e))},_.A.prototype.gazeLearning=function(e,t){const n=Object.assign({click:!0,move:!0},t);e?this.gazeTracker.startLearning(n):this.gazeTracker.stopLearning(n)},_.A.prototype.showGazer=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showGazer(e)},_.A.prototype.showVideo=function(e=!0){this.gazeTracker.checkInitialized("",!1)&&this.gazeTracker.showVideo(e)},_.A.prototype.showFaceOverlay=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showFaceOverlay(e)};var pi=__webpack_require__(7158),fi=__webpack_require__.n(pi);const mi={gazer:!1,gazeLearning:!1,gazePaused:!1},gi={current:null};_.A.prototype.nudgeGaze=function(e={},t=void 0){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("gaze",!0))return;const n=Object.assign({showOffset:!0},e);if(this._gazeTrackNudging.isCorrectingGaze)return;this._gazeTrackNudging.isCorrectingGaze=!0;let s=document.getElementById("gaze-nudger");s||(s=document.createElement("div"),s.id="gaze-nudger",s.className=`gaze-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(s),s.style.background=this.params.backgroundColor);const r=`

      ${G.H.RC_gazeTrackingNudge[this.L]}

      `;s.innerHTML+=r;const i=yi(this,s,t);if(this._nudger.gazeElement=s,n.showOffset){const e=document.createElement("div");e.id="fake-gaze-dot",e.style.position="absolute",e.style.left=this.gazePositionPx.value.x-5+"px",e.style.top=this.gazePositionPx.value.y-5+"px",e.style.width="10px",e.style.height="10px",e.style.borderRadius="50%",e.style.background="transparent",e.style.zIndex="9999999999",document.body.appendChild(e),gi.current=new(fi())(fi().pointAnchor(e,{x:"50%",y:"50%"}),fi().pointAnchor(i,{x:"50%",y:"50%"}),{path:"straight",color:this._CONST.COLOR.DARK_RED,startPlug:"disc"});const t=document.querySelector(".leader-line");t.style.zIndex=9999999999,t.style.opacity=.7,t.style.transitionDuration="0.2s"}mi.gazePaused=this._trackingPaused.gaze,mi.gazer=this.gazeTracker.webgazer.params.showGazeDot,mi.gazeLearning=this.gazeTracker._learning,mi.gazePaused&&this.resumeGaze(),mi.gazer||this.showGazer(!0),mi.gazeLearning||this.gazeLearning(!0,{click:!0,move:!1})};const yi=(e,t,n)=>new di(e,t,{greedyLearner:!1,calibrationCount:1,nudge:!0},mi,(()=>{t.remove(),t=null,e._nudgerElement=null,document.body.classList.remove("lock-view"),mi.gazePaused&&e.pauseGaze(),mi.gazePaused=!1,gi.current&&(gi.current.remove(),gi.current=null),e._gazeTrackNudging.isCorrectingGaze=!1,(0,E.nB)(n)}));var bi=__webpack_require__(4948),wi=__webpack_require__.n(bi);let vi=!1;_.A.prototype.getGazeAccuracy=function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return!1;(0,E.$k)();const s=this.screenPpi,r=this.viewingDistanceCm;if(!s||!r)return!1;const i=Object.assign({backgroundColor:"#eee",thresholdDeg:10,decimalPlace:3},e);this._addBackground();const a=document.createElement("div");a.innerHTML='',this.background.appendChild(a);const o=document.querySelector("#gaze-accuracy-canvas"),l=o.getContext("2d"),u=()=>{o.width=window.innerWidth,o.height=window.innerHeight,o.style.width=`${o.width}px`,o.style.height=`${o.height}px`},c=new ResizeObserver((()=>{u()}));return c.observe(this.background),u(),wi().fire({...qs(this,{showIcon:!0}),html:"We will measure your gaze accuracy. Please do not move the mouse and look at the fixation at the middle of the screen for the next 5 seconds."}).then((()=>{vi=!0,Ai(o,l,i),this.gazeTracker.startStoringPoints(),(0,E.yy)(5e3).then((()=>{vi=!1,this.gazeTracker.stopStoringPoints();const e=this.gazeTracker.webgazer.getStoredPoints(),a=xi({x:o.width/2,y:o.height/2},e,s.value,r.value);this.newGazeAccuracyData={value:(0,E.Nh)(a,i.decimalPlace),timestamp:performance.now()},a{const s=()=>{t.fillStyle=n.backgroundColor,t.fillRect(0,0,e.width,e.height),Ws(t,e.width/2,e.height/2),vi&&requestAnimationFrame(s)};requestAnimationFrame(s)},xi=(e,t,n,s)=>{let r=0;for(let i=0;i0;)n=Math.random()*t|0,t--,Ti(e,t,n)}function Ei(e,t,n){return Math.max(e,Math.min(t,n))}function Ii(e){return e%2==0?e:e+1}function Ti(e,t,n){const s=e[t];e[t]=e[n],e[n]=s}function Ni(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function Oi(e,t,n=""){Ni(Mi(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function Ri(e){Ni(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function Di(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n0),n,s){return new Promise(((r,i)=>{let a=0;const o=()=>{if(e())return void r();a++;const l=t(a);null!=n&&a>=n?i():null!=s?s(o,l):setTimeout(o,l)};o()}))}function Pi(e,t){let n=1,s=-1;for(let t=0;t=0)n*=e[t];else if(-1===e[t]){if(-1!==s)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${s} and dim ${t}`);s=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===s){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);const r=e.slice();return r[s]=t/n,r}function Vi(e,t){const n=t.length;return Ni((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-n&&e`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),Ni(e.every((e=>Fi(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function Wi(e,t){const n=[],s=[],r=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||r?null:Vi(t,e).sort();let a=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),s.push(t)),i[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),s.push(t))}return{newShape:n,keptDims:s}}function Gi(e,t){return Ui(e,t)}function Ui(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function qi(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function ji(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function Hi(e){return"string"==typeof e||e instanceof String}function $i(e){return"number"==typeof e}function Ki(e){return Array.isArray(e)?Ki(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":$i(e)?"float32":Hi(e)?"string":"boolean"==typeof e?"bool":"float32"}function Xi(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Zi(e,t){for(let n=t;n=0;--s)n[s]=n[s+1]*e[s+1];return n}function Qi(e,t,n,s=!1){const r=new Array;if(1===t.length){const i=t[0]*(s?2:1);for(let t=0;te*t))*(s?2:1);for(let t=0;te*t))*(n?2:1);if(0===s)return[];if(s!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return Qi(0,e,t,n)}function ea(e,t){const n=ta(e,t);for(let e=0;ee*t),1);if(null==t||"float32"===t)return Ji(e,new Float32Array(n));if("int32"===t)return Ji(e,new Int32Array(n));if("bool"===t)return Ji(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function sa(e){e.forEach((t=>{Ni(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function ra(e,t,n){if(0===t)return 0;if(1===t)return e[0];let s=e[e.length-1];for(let t=0;t{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){const n=t.toLowerCase();return"true"===n||"false"===n?"true"===n:""+ +n===n?+n:t}(0,n)}))}}}function ua(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")))),t}function ca(){return da}let ha,da=null;function pa(){if(null==ha){let e;if("undefined"!=typeof window)e=window;else if(void 0!==__webpack_require__.g)e=__webpack_require__.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}ha=e}return ha}function fa(e,t){const n=function(){const e=pa();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const s=t();return n.set(e,s),n.get(e)}}const ma="Abs",ga="Acos",ya="Acosh",ba="Add",wa="AddN",va="All",Aa="Any",xa="ArgMax",Ca="ArgMin",ka="Asin",Sa="Asinh",_a="Atan",Ea="Atanh",Ia="Atan2",Ta="AvgPool",Na="AvgPoolGrad",Oa="AvgPool3D",Ra="AvgPool3DGrad",Da="BatchMatMul",Ma="BatchToSpaceND",Fa="Bincount",Ba="BitwiseAnd",za="BroadcastArgs",La="Cast",Pa="Ceil",Va="ClipByValue",Wa="Complex",Ga="ComplexAbs",Ua="Concat",qa="Conv2D",ja="Conv2DBackpropFilter",Ha="Conv2DBackpropInput",$a="Conv3D",Ka="Conv3DBackpropFilterV2",Xa="Conv3DBackpropInputV2",Za="Cos",Ya="Cosh",Qa="Cumprod",Ja="Cumsum",eo="CropAndResize",to="DenseBincount",no="DepthToSpace",so="DepthwiseConv2dNative",ro="DepthwiseConv2dNativeBackpropFilter",io="DepthwiseConv2dNativeBackpropInput",ao="Diag",oo="Dilation2D",lo="Dilation2DBackpropInput",uo="Dilation2DBackpropFilter",co="Draw",ho="RealDiv",po="Einsum",fo="Elu",mo="EluGrad",go="Erf",yo="Equal",bo="Exp",wo="ExpandDims",vo="Expm1",Ao="FFT",xo="Fill",Co="FlipLeftRight",ko="Floor",So="FloorDiv",_o="FusedBatchNorm",Eo="GatherV2",Io="GatherNd",To="Greater",No="GreaterEqual",Oo="Identity",Ro="IFFT",Do="Imag",Mo="IsFinite",Fo="IsInf",Bo="IsNan",zo="LeakyRelu",Lo="Less",Po="LessEqual",Vo="LinSpace",Wo="Log",Go="Log1p",Uo="LogicalAnd",qo="LogicalNot",jo="LogicalOr",Ho="LRN",$o="LRNGrad",Ko="Max",Xo="Maximum",Zo="MaxPool",Yo="MaxPoolGrad",Qo="MaxPool3D",Jo="MaxPool3DGrad",el="MaxPoolWithArgmax",tl="Mean",nl="Min",sl="Minimum",rl="MirrorPad",il="Mod",al="Multinomial",ol="Multiply",ll="Neg",ul="NotEqual",cl="NonMaxSuppressionV3",hl="NonMaxSuppressionV4",dl="NonMaxSuppressionV5",pl="OnesLike",fl="OneHot",ml="Pack",gl="PadV2",yl="Pow",bl="Prelu",wl="Prod",vl="RaggedGather",Al="RaggedRange",xl="RaggedTensorToTensor",Cl="Range",kl="Real",Sl="Reciprocal",_l="Relu",El="Reshape",Il="ResizeNearestNeighbor",Tl="ResizeNearestNeighborGrad",Nl="ResizeBilinear",Ol="ResizeBilinearGrad",Rl="Relu6",Dl="Reverse",Ml="Round",Fl="Rsqrt",Bl="ScatterNd",zl="TensorScatterUpdate",Ll="SearchSorted",Pl="Select",Vl="Selu",Wl="Slice",Gl="Sin",Ul="Sinh",ql="Sign",jl="Sigmoid",Hl="Softplus",$l="Sqrt",Kl="Sum",Xl="SpaceToBatchND",Zl="SplitV",Yl="Softmax",Ql="SparseFillEmptyRows",Jl="SparseReshape",eu="SparseSegmentMean",tu="SparseSegmentSum",nu="SparseToDense",su="SquaredDifference",ru="Square",iu="StaticRegexReplace",au="StridedSlice",ou="StringNGrams",lu="StringSplit",uu="StringToHashBucketFast",cu="Sub",hu="Tan",du="Tanh",pu="Tile",fu="TopK",mu="Transform",gu="Transpose",yu="Unique",bu="Unpack",wu="UnsortedSegmentSum",vu="ZerosLike",Au="Step",xu="FromPixels",Cu="RotateWithOffset",ku="_FusedMatMul",Su="FusedConv2D",_u="FusedDepthwiseConv2D";function Eu(...e){!ca().getBool("IS_TEST")&&ca().getBool("PROD")}function Iu(...e){!ca().getBool("IS_TEST")&&ca().getBool("PROD")}const Tu=fa("kernelRegistry",(()=>new Map)),Nu=fa("gradRegistry",(()=>new Map));function Ou(e,t){const n=Bu(e,t);return Tu.get(n)}function Ru(e){return Nu.get(e)}function Du(e){const t=Tu.entries(),n=[];for(;;){const{done:s,value:r}=t.next();if(s)break;const[i,a]=r,[o]=i.split("_");o===e&&n.push(a)}return n}function Mu(e){const{kernelName:t,backendName:n}=e,s=Bu(t,n);Tu.has(s)&&Eu(),Tu.set(s,e)}function Fu(e){const{kernelName:t}=e;Nu.has(t)&&ca().getBool("DEBUG")&&Eu(),Nu.set(t,e)}function Bu(e,t){return`${t}_${e}`}function zu(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var Lu=__webpack_require__(3122);const Pu=__webpack_require__.n(Lu)()||Lu;function Vu(e){return Pu.fromString(e,!0,16)}const Wu=Vu("c3a5c85c97cb3127"),Gu=Vu("b492b66fbe98f273"),Uu=Vu("9ae16a3b2f90404f");function qu(e){return e.xor(e.shru(47))}function ju(e,t,n){const s=e.slice(t,t+n);return Pu.fromBytes(Array.from(s),!0,!0)}function Hu(e,t){return ju(e,t,8)}function $u(e,t){return ju(e,t,4)}function Ku(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function Xu(e,t,n=Vu("9ddfea08eb382d69")){let s=e.xor(t).mul(n);s=s.xor(s.shru(47));let r=t.xor(s).mul(n);return r=r.xor(r.shru(47)),r=r.mul(n),r}function Zu(e,t,n,s){return function(e,t,n,s,r,i){r=r.add(e),i=Ku(i.add(r).add(s),21);const a=r;return r=(r=r.add(t)).add(n),i=i.add(Ku(r,44)),[r.add(s),i.add(a)]}(Hu(e,t),Hu(e,t+8),Hu(e,t+16),Hu(e,t+24),n,s)}function Yu(e,t=e.length){const n=Pu.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=Uu.add(2*t),s=Hu(e,0).add(Uu),r=Hu(e,t-8);return Xu(Ku(r,37).mul(n).add(s),Ku(s,25).add(r).mul(n),n)}if(t>=4){const n=Uu.add(2*t);return Xu($u(e,0).shl(3).add(t),$u(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),s=t+(e[t-1]<<2);return qu(Uu.mul(n).xor(Wu.mul(s))).mul(Uu)}return Uu}(e,t):function(e,t=e.length){const n=Uu.add(2*t),s=Hu(e,0).mul(Gu),r=Hu(e,8),i=Hu(e,t-8).mul(n),a=Hu(e,t-16).mul(Uu);return Xu(Ku(s.add(r),43).add(Ku(i,30)).add(a),s.add(Ku(r.add(Uu),18)).add(i),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=Uu.add(2*t),s=Hu(e,0).mul(Uu),r=Hu(e,8),i=Hu(e,t-8).mul(n),a=Hu(e,t-16).mul(Uu),o=Ku(s.add(r),43).add(Ku(i,30)).add(a),l=Xu(o,s.add(Ku(r.add(Uu),18)).add(i),n),u=Hu(e,16).mul(n),c=Hu(e,24),h=o.add(Hu(e,t-32)).mul(n),d=l.add(Hu(e,t-24)).mul(n);return Xu(Ku(u.add(c),43).add(Ku(h,30)).add(d),u.add(Ku(c.add(s),18)).add(h),n)}(e,t);let s=n,r=n.mul(Gu).add(113),i=qu(r.mul(Uu).add(113)).mul(Uu),a=[Pu.UZERO,Pu.UZERO],o=[Pu.UZERO,Pu.UZERO];s=s.mul(Uu).add(Hu(e,0));let l=0;const u=64*(t-1>>6),c=u+(t-1&63)-63;do{s=Ku(s.add(r).add(a[0]).add(Hu(e,l+8)),37).mul(Gu),r=Ku(r.add(a[1]).add(Hu(e,l+48)),42).mul(Gu),s=s.xor(o[1]),r=r.add(a[0]).add(Hu(e,l+40)),i=Ku(i.add(o[0]),33).mul(Gu),a=Zu(e,l,a[1].mul(Gu),s.add(o[0])),o=Zu(e,l+32,i.add(o[1]),r.add(Hu(e,l+16))),[i,s]=[s,i],l+=64}while(l!==u);const h=Gu.add(i.and(255).shl(1));return l=c,o[0]=o[0].add(t-1&63),a[0]=a[0].add(o[0]),o[0]=o[0].add(a[0]),s=Ku(s.add(r).add(a[0]).add(Hu(e,l+8)),37).mul(h),r=Ku(r.add(a[1]).add(Hu(e,l+48)),42).mul(h),s=s.xor(o[1].mul(9)),r=r.add(a[0].mul(9).add(Hu(e,l+40))),i=Ku(i.add(o[0]),33).mul(h),a=Zu(e,l,a[1].mul(h),s.add(o[0])),o=Zu(e,l+32,i.add(o[1]),r.add(Hu(e,l+16))),[i,s]=[s,i],Xu(Xu(a[0],o[0],h).add(qu(r).mul(Wu)).add(i),Xu(a[1],o[1],h).add(s),h)}function Qu(e,t){return"string"===t?tc(e):Ju([e],t)}function Ju(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=rc(e)),ca().getBool("DEBUG")&&function(e,t){for(let n=0;n{s=n()};let i;const a=ec();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(r);else{r();for(const e of s)e.dataSync();i=Promise.resolve({kernelMs:ec()-a})}if(ca().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{ac(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:i.then((e=>e.kernelMs)),extraInfo:i.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:s,inputs:r,extraInfo:i}=e;n.forEach((e=>{Promise.all([e.data(),s,i]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],r,n[2])}))}))}}function ac(e,t,n){if("float32"!==t)return!1;for(let t=0;t0?s:""} `}}}}const lc=20,uc=3,cc=7;function hc(e,t,n,s){const r=Yi(t),i=function(e,t,n,s){const r=Di(t),i=s[s.length-1],a=new Array(i).fill(0),o=t.length,l="complex64"===n?mc(e):e;if(o>1)for(let e=0;e" "+e)).join("\n")),l.join("\n")}function dc(e,t,n){let s;return s=Array.isArray(e)?`${parseFloat(e[0].toFixed(cc))} + ${parseFloat(e[1].toFixed(cc))}j`:Hi(e)?`'${e}'`:"bool"===n?pc(e):parseFloat(e.toFixed(cc)).toString(),zi(s,t)}function pc(e){return 0===e?"false":"true"}function fc(e,t,n,s,r,i=!0){const a="complex64"===n?2:1,o=t[0],l=t.length;if(0===l){if("complex64"===n){return[dc(mc(e)[0],0,n)]}return"bool"===n?[pc(e[0])]:[e[0].toString()]}if(1===l){if(o>lc){const t=uc*a;let s=Array.from(e.slice(0,t)),i=Array.from(e.slice((o-uc)*a,o*a));return"complex64"===n&&(s=mc(s),i=mc(i)),["["+s.map(((e,t)=>dc(e,r[t],n))).join(", ")+", ..., "+i.map(((e,t)=>dc(e,r[o-uc+t],n))).join(", ")+"]"]}return["["+("complex64"===n?mc(e):Array.from(e)).map(((e,t)=>dc(e,r[t],n))).join(", ")+"]"]}const u=t.slice(1),c=s.slice(1),h=s[0]*a,d=[];if(o>lc){for(let t=0;t0?d[0]+p:"");for(let e=1;e`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||Ui(t,this.size),this.strides=Yi(e)}set(e,...t){0===t.length&&(t=[0]),Ni(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;tnc(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),yc().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=yc().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>nc(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await yc().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),yc().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return bc.print(this,e)}clone(){return this.throwIfDisposed(),bc.clone(this)}toString(e=!1){return hc(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),bc.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),yc().makeVariable(this,e,t,n)}}function Ac(){return fa("Tensor",(()=>vc))}Object.defineProperty(vc,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Ac();class xc extends vc{constructor(e,t,n,s){super(e.shape,e.dtype,e.dataId,s),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!Mi(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);yc().disposeTensor(this),this.dataId=e.dataId,yc().incRef(this,null)}dispose(){yc().disposeVariable(this),this.isDisposedInternal=!0}}var Cc,kc,Sc,_c,Ec;Object.defineProperty(xc,Symbol.hasInstance,{value:e=>e instanceof vc&&null!=e.assign&&e.assign instanceof Function}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(Cc||(Cc={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(kc||(kc={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(Sc||(Sc={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(_c||(_c={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(Ec||(Ec={}));const Ic={float32:_c,int32:kc,bool:Sc,complex64:Ec};function Tc(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return Ic[e][t]}function Nc(e){return Tc(e,"int32")}function Oc(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function Rc(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}function Dc(e,t){if(e.dtype===t.dtype)return[e,t];const n=Tc(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Mc(e,t){return t.some((t=>t.id===e.id))}function Fc(e){const t=[];return Bc(e,t,new Set),t}function Bc(e,t,n){if(null==e)return;if(e instanceof vc)return void t.push(e);if(s=e,!Array.isArray(s)&&"object"!=typeof s)return;var s;const r=e;for(const e in r){const s=r[e];n.has(s)||(n.add(s),Bc(s,t,n))}}function zc(e){return null!=e.kernelName}class Lc{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class Pc{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Lc}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){Du(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof ki||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,s=n.then((n=>!(t(tthis.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;tthis.startScope(s)),(()=>this.endScope(n)),(()=>(n=t(),n)))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return Pc.nextTensorId++}nextVariableId(){return Pc.nextVariableId++}clone(e){const t=Wc.runKernel(Oo,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return Wc.runKernel(La,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=Ou(e,this.backendName)))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){const s=this.backend.numDataIds();let r=0;n.forEach((e=>{r+="complex64"===e.dtype?3:1}));const i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=s-t-r-i;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const s=this.isTapeOn(),r=this.state.numBytes,i=this.state.numTensors;let a,o;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=zc(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(zc(e)){const{kernelName:t,inputs:r,attrs:i}=e;null==this.backendName&&this.backend;const l=Ou(t,this.backendName);Ni(null!=l,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),a=()=>{const e=this.backend.numDataIds();o=l.kernelFunc({inputs:r,attrs:i,backend:this.backend});const a=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,a);const u=a.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(s){const e=this.getTensorsForGradient(t,r,u);n=this.saveTensorsForBackwardMode(e)}return u}}else{const{forwardFunc:t}=e,r=e=>{s&&(n=e.map((e=>this.keep(this.clone(e)))))};a=()=>{const e=this.backend.numDataIds();o=this.tidy((()=>t(this.backend,r)));const n=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,e,n),n}}const{inputs:u,attrs:c}=e,h=zc(e)?null:e.backwardsFunc;let d;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,u,(()=>a())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=a()})),s&&this.addTapeNode(l,u,t,h,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map((e=>null!=u[e]?u[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map((e=>this.keep(this.clone(e))));return t}getTensorsForGradient(e,t,n){const s=Ru(e);if(null!=s){const e=s.inputsToSave||[],r=s.outputsToSave||[];let i;s.saveAllInputs?(Ni(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),i=Object.keys(t).map((e=>t[e]))):i=e.map((e=>t[e]));const a=n.filter(((e,t)=>r[t]));return i.concat(a)}return[]}makeTensor(e,t,n,s){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",s=s||this.backend;let r=e;"string"===n&&Hi(e[0])&&(r=e.map((e=>tc(e))));const i=s.write(r,t,n),a=new vc(t,n,i,this.nextTensorId());if(this.trackTensor(a,s),"string"===n){const e=this.state.tensorInfo.get(i),t=function(e){if(null==e)return 0;let t=0;return e.forEach((e=>t+=e.length)),t}(r);this.state.numBytes+=t-e.bytes,e.bytes=t}return a}makeTensorFromDataId(e,t,n,s){const r={dataId:e,shape:t,dtype:n=n||"float32"};return this.makeTensorFromTensorInfo(r,s)}makeTensorFromTensorInfo(e,t){const{dataId:n,shape:s,dtype:r}=e,i=new vc(s,r,n,this.nextTensorId());return this.trackTensor(i,t),i}makeVariable(e,t=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==e.dtype&&(e=e.cast(s));const r=new xc(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[r.name])throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*ji(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof xc||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*ji(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,s,r,i){const a={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=Ru(e);null!=o&&(s=o.gradFunc),null!=s&&(a.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],s=ta(e.size,e.dtype);return this.makeTensor(s,e.shape,e.dtype)}return e})),s(e.length>1?e:e[0],r,i))),this.state.activeTape.push(a)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=Fc(e),n=new Set(t.map((e=>e.id)));for(let e=0;e{e.kept||e.scopeId!==s.id||this.track(e)}))}gradients(e,t,n,s=!1){if(Ni(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const r=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));Ni(r instanceof vc,(()=>"The result y returned by f() must be a tensor."));const i=function(e,t,n){const s={},r={};for(let e=0;es[e.id]=!0)),o=!0,r[i.id]=!0;break}if(o)break}}const i={};i[n.id]=!0;const a={};for(let t=e.length-1;t>=0;t--){const n=e[t],s=n.inputs;for(let e=0;e0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[r.id]=null==n?function(e){const t=ea(Di(e),"float32");return Wc.makeTensor(t,e,"float32")}(r.shape):n,function(e,t,n,s){for(let r=t.length-1;r>=0;r--){const i=t[r],a=[];if(i.outputs.forEach((t=>{const n=e[t.id];null!=n?a.push(n):a.push(null)})),null==i.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${i.kernelName}.`);const o=i.gradient(a);for(const t in i.inputs){if(!(t in o))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(o)}.`);const r=n((()=>o[t]()));if("float32"!==r.dtype)throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${r.dtype}'`);const a=i.inputs[t];if(!Mi(r.shape,a.shape))throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input '${t}' has shape '${r.shape}', which does not match the shape of the input '${a.shape}'`);if(null==e[a.id])e[a.id]=r;else{const t=e[a.id];e[a.id]=s(t,r),t.dispose()}}}}(e,i,(e=>this.tidy(e)),Gc);const s=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:r,grads:s}}))}customGrad(e){return Ni(Xi(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;Ni(t.every((e=>e instanceof vc)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const s={};t.forEach(((e,t)=>{s[t]=e}));return this.runKernelFunc({forwardFunc:(s,r)=>(n=e(...t,r),Ni(n.value instanceof vc,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),Ni(Xi(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(e,s)=>{const r=n.gradFunc(e,s),i=Array.isArray(r)?r:[r];Ni(i.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),Ni(i.every((e=>e instanceof vc)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const a={};return i.forEach(((e,t)=>{a[t]=()=>e})),a},inputs:s})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=ec(),n=await this.backend.time(e);return n.wallMs=ec()-t,n}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Lc;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function Vc(){const e=pa();if(null==e._tfengine){const t=new la(e);e._tfengine=new Pc(t)}var t;return t=e._tfengine.ENV,da=t,yc=()=>e._tfengine,e._tfengine}Pc.nextTensorId=0,Pc.nextVariableId=0;const Wc=Vc();function Gc(e,t){const n={a:e,b:t};return Wc.runKernel(ba,n)}let Uc;function qc(e){if(void 0!==Uc)return Uc;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function jc(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const Hc=ca();function $c(e,t){let n=e;if(sc(e))return"string"===t?[]:[e.length];if(Oc(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Rc(e))return[e.buffer.size/(null==t?4:ji(t))];if(!Array.isArray(e))return[];const s=[];for(;Array.isArray(n)||sc(n)&&"string"!==t;)s.push(n.length),n=n[0];return Array.isArray(e)&&ca().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Kc(e,s,[]),s}function Kc(e,t,n){if(n=n||[],!Array.isArray(e)&&!sc(e))return void Ni(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));Ni(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),Ni(e.length===t[0],(()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const s=t.slice(1);for(let t=0;t=0&&(r=s),Xc(s,r,t,n),null==e||!sc(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const s=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const i=$c(e,r);sc(e)||Array.isArray(e)||(e=[e]);const a="string"!==r?Ju(e,r):rc(e,[],!0);return Wc.makeTensor(a,i,r)}function Yc(e,t,n,s="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,r)=>Zc(e,`${t}[${r}]`,n,s)))}Hc.registerFlag("DEBUG",(()=>!1),(e=>{})),Hc.registerFlag("IS_BROWSER",(()=>jc())),Hc.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),Hc.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),Hc.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),Hc.registerFlag("PROD",(()=>!1)),Hc.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>Hc.getBool("DEBUG"))),Hc.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),Hc.registerFlag("IS_TEST",(()=>!1)),Hc.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>Hc.getBool("DEBUG"))),Hc.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),Hc.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),Hc.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1));const Qc="__op";function Jc(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const s=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=Qc;const r=(...e)=>{Wc.startScope(n);try{const t=s(...e);return aa(t),Wc.endScope(t),t}catch(e){throw Wc.endScope(null),e}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}const eh=Jc({complex_:function(e,t){const n=Zc(e,"real","complex"),s=Zc(t,"imag","complex");Oi(n.shape,s.shape,`real and imag shapes, ${n.shape} and ${s.shape}, must match in call to tf.complex().`);const r={real:n,imag:s};return Wc.runKernel(Wa,r)}});function th(e,t,n,s){if(null==s)s=Ki(e);else if("complex64"===s)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(Rc(e)||Oc(e)){if("float32"!==s&&"int32"!==s)throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${s}.`);return Wc.backend.createTensorFromGPUData(e,t||n,s)}if(!sc(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){sa(t);const e=Di(t),s=Di(n);Ni(e===s,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${s}`));for(let e=0;e`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `))}}return sc(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==s?Ju(e,s):rc(e,[],!0),Wc.makeTensor(e,t,s)}function nh(e,t,n){return th(e,t,$c(e,n),n)}const sh={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};class rh{static join(e){return new rh(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>sc(e)?e.buffer:e))).length)return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let n=0;n=this.byteLength)return-1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;const n=function(e,t){let n=0,s=e.length;for(;n<=s;){const r=Math.floor((s-n)/2)+n,i=t(e[r]);if(0===i)return r;i<0?s=r:n=r+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}function ih(){return Wc}function ah(){return Wc.memory()}function oh(e,t){return Wc.tidy(e,t)}function lh(e){Fc(e).forEach((e=>e.dispose()))}function uh(e){return Wc.keep(e)}function ch(e,t,n=1){return Wc.registerBackend(e,t,n)}function hh(){return Wc.backend}wc=function(e){ca().getBool("DEPRECATION_WARNINGS_ENABLED")};const dh=4;async function ph(e,t){const n=[],s=[],r=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let i=0;i{const t=await o.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+dh*t.length,s=new Uint8Array(n);let r=0;for(let e=0;en.slice(r+e,r+t)));s[e.name]=yh(e,n.slice(r,r+t)),r+=t}return s}function mh(e,t){const n=Di(e.shape);let s;if("quantization"in e){const t=e.quantization;s=sh[t.dtype]}else{if("string"===e.dtype){let e=0;for(let s=0;s{let t=e<<13,n=0;for(;!(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return s=>{const r=new ArrayBuffer(4*s.length),i=new Uint32Array(r);for(let r=0;r>10]+(1023&a)]+t[a>>10];i[r]=o}return new Float32Array(r)}}();a=e(u)}}else{if("int32"!==s)throw new Error(`Unsupported dtype in weight '${n}': ${s}`);if("uint8"!==r.dtype&&"uint16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type int32.`);a=new Int32Array(u.length);for(let e=0;e(r=await bh(s,r,t),r.slice(e,t))));r=await bh(s,r,t);const i=r.slice(0,t);r=r.slice(t);const a=yh(e,i);if(n[e.name]=a,"webgpu"===Wc.backendName){const e=hh();"uploadToGPU"in e&&Di(a.shape)>=ca().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(a.dataId)}}return n}function vh(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const n=[];e.forEach((e=>{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const s=new Uint8Array(t);let r=0;return n.forEach((e=>{s.set(new Uint8Array(e.buffer),r),r+=e.byteLength})),s.buffer}const Ah="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function xh(e){return Ah?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function Ch(e){return rh.join(e)}function kh(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function Sh(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(n.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function _h(e,t,n){const s={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(s.trainingConfig=e.trainingConfig),null!=e.weightsManifest){if(!t)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");s.weightSpecs=t,s.weightData=n}return null!=e.signature&&(s.signature=e.signature),null!=e.userDefinedMetadata&&(s.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(s.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(s.initializerSignature=e.initializerSignature),s}async function Eh(e,t){let n,s;return null!=e.weightsManifest&&([n,s]=await t(e.weightsManifest)),_h(e,n,s)}function Ih(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:xh(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:xh(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new rh(e.weightData).byteLength}}function Th(e){const t=[];for(const n of e)t.push(...n.weights);return t}class Nh{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==Nh.instance&&(Nh.instance=new Nh),Nh.instance}static registerSaveRouter(e){Nh.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Nh.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Nh.getHandlers(e,"save")}static getLoadHandlers(e,t){return Nh.getHandlers(e,"load",t)}static getHandlers(e,t,n){const s=[];return("load"===t?Nh.getInstance().loadRouters:Nh.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&s.push(r)})),s}}const Oh=e=>Nh.registerSaveRouter(e),Rh=e=>Nh.registerLoadRouter(e),Dh=e=>Nh.getSaveHandlers(e),Mh=(e,t)=>Nh.getLoadHandlers(e,t),Fh="tensorflowjs",Bh="models_store",zh="model_info_store";function Lh(){if(!ca().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Ph(e){const t=e.result;t.createObjectStore(Bh,{keyPath:"modelPath"}),t.createObjectStore(zh,{keyPath:"modelPath"})}class Vh{constructor(e){if(this.indexedDB=Lh(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,n)=>{const s=this.indexedDB.open(Fh,1);s.onupgradeneeded=()=>Ph(s),s.onsuccess=()=>{const r=s.result;if(null==t){const t=r.transaction(Bh,"readonly"),s=t.objectStore(Bh).get(this.modelPath);s.onsuccess=()=>{if(null==s.result)return r.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(s.result.modelArtifacts)},s.onerror=e=>(r.close(),n(s.error)),t.oncomplete=()=>r.close()}else{t.weightData=rh.join(t.weightData);const s=Ih(t),i=r.transaction(zh,"readwrite");let a,o,l=i.objectStore(zh);try{a=l.put({modelPath:this.modelPath,modelArtifactsInfo:s})}catch(e){return n(e)}a.onsuccess=()=>{o=r.transaction(Bh,"readwrite");const a=o.objectStore(Bh);let u;try{u=a.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:s})}catch(e){return n(e)}u.onsuccess=()=>e({modelArtifactsInfo:s}),u.onerror=e=>{l=i.objectStore(zh);const t=l.delete(this.modelPath);t.onsuccess=()=>(r.close(),n(u.error)),t.onerror=e=>(r.close(),n(u.error))}},a.onerror=e=>(r.close(),n(a.error)),i.oncomplete=()=>{null==o?r.close():o.oncomplete=()=>r.close()}}},s.onerror=e=>n(s.error)}))}}Vh.URL_SCHEME="indexeddb://";const Wh=e=>{return ca().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Vh.URL_SCHEME)?(t=e.slice(Vh.URL_SCHEME.length),new Vh(t)):null;var t};Nh.registerSaveRouter(Wh),Nh.registerLoadRouter(Wh);class Gh{constructor(){this.indexedDB=Lh()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(Fh,1);n.onupgradeneeded=()=>Ph(n),n.onsuccess=()=>{const s=n.result,r=s.transaction(zh,"readonly"),i=r.objectStore(zh).getAll();i.onsuccess=()=>{const t={};for(const e of i.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},i.onerror=e=>(s.close(),t(i.error)),r.oncomplete=()=>s.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(Vh.URL_SCHEME)?t.slice(Vh.URL_SCHEME.length):t,new Promise(((t,n)=>{const s=this.indexedDB.open(Fh,1);s.onupgradeneeded=()=>Ph(s),s.onsuccess=()=>{const r=s.result,i=r.transaction(zh,"readwrite"),a=i.objectStore(zh),o=a.get(e);let l;o.onsuccess=()=>{if(null==o.result)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const s=a.delete(e),i=()=>{l=r.transaction(Bh,"readwrite");const s=l.objectStore(Bh).delete(e);s.onsuccess=()=>t(o.result.modelArtifactsInfo),s.onerror=e=>n(o.error)};s.onsuccess=i,s.onerror=e=>(i(),r.close(),n(o.error))}},o.onerror=e=>(r.close(),n(o.error)),i.oncomplete=()=>{null==l?r.close():l.oncomplete=()=>r.close()}},s.onerror=e=>n(s.error)}))}}const Uh="/",qh="tensorflowjs_models",jh="info",Hh="model_topology",$h="weight_specs",Kh="weight_data",Xh="model_metadata";function Zh(e){return{info:[qh,e,jh].join(Uh),topology:[qh,e,Hh].join(Uh),weightSpecs:[qh,e,$h].join(Uh),weightData:[qh,e,Kh].join(Uh),modelMetadata:[qh,e,Xh].join(Uh)}}function Yh(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function Qh(e){const t=e.split(Uh);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(Uh)}class Jh{constructor(e){if(!ca().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Zh(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),s=Ih(e),r=rh.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(s)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(Ah)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,s=t.length;e{return ca().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Jh.URL_SCHEME)?(t=e.slice(Jh.URL_SCHEME.length),new Jh(t)):null;var t};Nh.registerSaveRouter(ed),Nh.registerLoadRouter(ed);class td{constructor(){Ni(ca().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),Ni("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=qh+Uh,n=Uh+jh;for(let s=0;s"scheme must not be undefined or null.")),e.endsWith(nd)&&(e=e.slice(0,e.indexOf(nd))),Ni(e.length>0,(()=>"scheme must not be an empty string."));const n=sd.getInstance();Ni(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=sd.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(sd.getInstance().managers)}}function rd(e){if(-1===e.indexOf(nd))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${sd.getSchemes().join(",")}`);return{scheme:e.split(nd)[0],path:e.split(nd)[1]}}async function id(e,t,n=!1){Ni(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=Nh.getLoadHandlers(e);Ni(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),Ni(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const r=s[0],i=Nh.getSaveHandlers(t);Ni(i.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),Ni(i.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const a=i[0],o=rd(e).scheme,l=rd(e).path,u=o===rd(e).scheme,c=await r.load();n&&u&&await sd.getManager(o).removeModel(l);const h=await a.save(c);return n&&!u&&await sd.getManager(o).removeModel(l),h.modelArtifactsInfo}async function ad(){const e=sd.getSchemes(),t={};for(const n of e){const e=await sd.getManager(n).listModels();for(const s in e){t[n+nd+s]=e[s]}}return t}async function od(e){const t=rd(e);return sd.getManager(t.scheme).removeModel(t.path)}async function ld(e,t){return id(e,t,!1)}async function ud(e,t){return id(e,t,!0)}class cd{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){"undefined"!=typeof window&&ca().getBool("USE_SETTIMEOUTCUSTOM")?(this.functionRefs.push(e),setTimeout((()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")}),t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",(e=>{if(e.source===window&&e.data.name===this.messageName){e.stopPropagation();(0,this.functionRefs[e.data.index])(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}}),!0))):setTimeout(e,t)}isTypedArray(e){return zu(e)}}if(ca().get("IS_BROWSER")){ca().setPlatform("browser",new cd);try{sd.registerManager(Jh.URL_SCHEME,new td)}catch(e){}try{sd.registerManager(Vh.URL_SCHEME,new Gh)}catch(e){}}const hd=()=>__webpack_require__(8273);let dd;class pd{constructor(){this.util=__webpack_require__(9830),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=ca().global.fetch?ca().global.fetch(e,t):(null==dd&&(dd=hd()),dd(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}function fd(e,t="float32",n){return t=t||"float32",sa(e),new gc(e,t,n)}ca().get("IS_NODE")&&!ca().get("IS_BROWSER")&&ca().setPlatform("node",new pd);const md=Jc({cast_:function(e,t){const n=Zc(e,"x","cast");if(!function(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const s={x:n},r={dtype:t};return Wc.runKernel(La,s,r)}});const gd=Jc({clone_:function(e){const t={x:Zc(e,"x","clone","string_or_numeric")};return Wc.runKernel(Oo,t)}});function yd(e,t=!1){}Vc();bc={buffer:fd,cast:md,clone:gd,print:yd};const bd=Jc({add_:function(e,t){let n=Zc(e,"a","add"),s=Zc(t,"b","add");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(ba,r)}});const wd=Jc({floorDiv_:function(e,t){let n=Zc(e,"a","floorDiv"),s=Zc(t,"b","floorDiv");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(So,r)}});const vd=Jc({div_:function(e,t){let n=Zc(e,"a","div"),s=Zc(t,"b","div");if([n,s]=Dc(n,s),"int32"===n.dtype&&"int32"===s.dtype)return wd(n,s);const r={a:n,b:s};return Wc.runKernel(ho,r,{})}});const Ad=Jc({mul_:function(e,t){let n=Zc(e,"a","mul"),s=Zc(t,"b","mul");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(ol,r)}});const xd=Jc({sqrt_:function(e){const t={x:Zc(e,"x","sqrt","float32")};return Wc.runKernel($l,t)}});const Cd=Jc({square_:function(e){const t=Zc(e,"x","square");return Wc.runKernel("Square",{x:t},{})}});const kd=Jc({zerosLike_:function(e){const t={x:Zc(e,"x","zerosLike")};return Wc.runKernel(vu,t)}});function Sd(e){return Wc.customGrad(e)}function _d(e,t){if((sc(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&sc(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return th(e,[],[],t)}const Ed=new Map,Id=new Map;class Td{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Nd{constructor(){this.classNameMap={}}static getMap(){return null==Nd.instance&&(Nd.instance=new Nd),Nd.instance}static register(e){Nd.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Od(e,t,n){Ni(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),Ni("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),Ni(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),void 0===t&&(t="Custom"),void 0===n&&(n=e.className);const s=t+">"+n;return Nd.register(e),Ed.set(s,e),Id.set(e,s),e}class Rd extends Td{minimize(e,t=!1,n){const{value:s,grads:r}=this.computeGradients(e,n);if(null!=n){const e=n.map((e=>({name:e.name,tensor:r[e.name]})));this.applyGradients(e)}else this.applyGradients(r);return lh(r),t?s:(s.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return function(e,t){Ni(Xi(e),(()=>"The f passed in variableGrads(f) must be a function")),Ni(null==t||Array.isArray(t)&&t.every((e=>e instanceof xc)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in Wc.registeredVariables)t.push(Wc.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,r=t.length;t=t.filter((e=>e.trainable)),Ni(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`));const{value:i,grads:a}=Wc.gradients(e,t,null,!0);Ni(a.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),Ni(0===i.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`));const o={};return t.forEach(((e,t)=>{null!=a[t]&&(o[e.name]=a[t])})),null!=s&&s.forEach((e=>o[e.name]=null)),{value:i,grads:o}}(e,t)}dispose(){null!=this.iterations_&&lh(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:_d(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(Rd,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class Dd extends Rd{static get className(){return"Adadelta"}constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=Wc.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t],r=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:oh((()=>kd(s).variable(r)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:oh((()=>kd(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;oh((()=>{const e=bd(Ad(a,this.rho),Ad(Cd(i),1-this.rho)),t=Ad(vd(xd(bd(o,this.epsilon)),xd(bd(a,this.epsilon))),i),n=bd(Ad(o,this.rho),Ad(Cd(t),1-this.rho));a.assign(e),o.assign(n);const r=bd(Ad(t,-this.learningRate),s);s.assign(r)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(lh(this.accumulatedGrads.map((e=>e.variable))),lh(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}function Md(e,t,n){sa(e);const s={shape:e,value:t,dtype:n=n||Ki(t)};return Wc.runKernel(xo,{},s)}class Fd extends Rd{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:oh((()=>Md(s.shape,this.initialAccumulatorValue).variable(e)))}}const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const i=this.accumulatedGrads[n].variable;oh((()=>{const e=bd(i,Cd(r));i.assign(e);const t=bd(Ad(vd(r,xd(bd(e,Wc.backend.epsilon()))),-this.learningRate),s);s.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&lh(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}const Bd=Jc({pow_:function(e,t){let n=Zc(e,"base","pow"),s=Zc(t,"exp","pow");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(yl,r)}});const zd=Jc({sub_:function(e,t){let n=Zc(e,"a","sub"),s=Zc(t,"b","sub");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(cu,r)}});class Ld extends Rd{static get className(){return"Adam"}constructor(e,t,n,s=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=s,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],oh((()=>{this.accBeta1=_d(t).variable(),this.accBeta2=_d(n).variable()})),null==s&&(this.epsilon=Wc.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);oh((()=>{const n=zd(1,this.accBeta1),s=zd(1,this.accBeta2);t.forEach(((t,r)=>{const i=Wc.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:oh((()=>kd(i).variable(a)))}),null==this.accumulatedSecondMoment[r]&&(this.accumulatedSecondMoment[r]={originalName:`${t}/v`,variable:oh((()=>kd(i).variable(a)))});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedSecondMoment[r].variable,c=bd(Ad(l,this.beta1),Ad(o,1-this.beta1)),h=bd(Ad(u,this.beta2),Ad(Cd(o),1-this.beta2)),d=vd(c,n),p=vd(h,s);l.assign(c),u.assign(h);const f=bd(Ad(vd(d,bd(xd(p),this.epsilon)),-this.learningRate),i);i.assign(f)})),this.accBeta1.assign(Ad(this.accBeta1,this.beta1)),this.accBeta2.assign(Ad(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&lh(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&lh(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),oh((()=>{this.accBeta1.assign(Bd(this.beta1,this.iterations_+1)),this.accBeta2.assign(Bd(this.beta2,this.iterations_+1))}));const t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}const Pd=Jc({abs_:function(e){const t=Zc(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return Wc.runKernel(Ga,e)}{const e={x:t};return Wc.runKernel(ma,e)}}});function Vd(e,t){const n=e.length,s=[];for(let r=0;r1&&1===a&&s.unshift(i)}return s}function Wd(e,t){const n=[];for(let s=0;s1)&&n.unshift(i)}return n}function Gd(e,t){const n=Math.max(e.length,t.length),s=new Array(n);for(let r=0;r{this.iteration=_d(0).variable(),this.accBeta1=_d(t).variable()})),null==s&&(this.epsilon=Wc.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);oh((()=>{const n=zd(1,this.accBeta1),s=vd(-this.learningRate,bd(Ad(this.iteration,this.decay),1));t.forEach(((t,r)=>{const i=Wc.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:kd(i).variable(a)}),null==this.accumulatedWeightedInfNorm[r]&&(this.accumulatedWeightedInfNorm[r]={originalName:`${t}/v`,variable:kd(i).variable(a)});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedWeightedInfNorm[r].variable,c=bd(Ad(l,this.beta1),Ad(o,1-this.beta1)),h=Ad(u,this.beta2),d=Pd(o),p=Ud(h,d);l.assign(c),u.assign(p);const f=bd(Ad(vd(s,n),vd(c,bd(p,this.epsilon))),i);i.assign(f)})),this.iteration.assign(bd(this.iteration,1)),this.accBeta1.assign(Ad(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&lh(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&lh(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}class jd extends Rd{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const r=Wc.registeredVariables[t];oh((()=>{const e=bd(Ad(this.c,s),r);r.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=uh(_d(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}class Hd extends jd{static get className(){return"Momentum"}constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=_d(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:oh((()=>kd(s).variable(e)))}}const r=this.accumulations[n].variable,i=Array.isArray(e)?e[n].tensor:e[t];null!=i&&oh((()=>{let e;const t=bd(Ad(this.m,r),i);e=this.useNesterov?bd(Ad(this.c,bd(i,Ad(t,this.m))),s):bd(Ad(this.c,t),s),r.assign(t),s.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&lh(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}class $d extends Rd{static get className(){return"RMSProp"}constructor(e,t=.9,n=0,s=null,r=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=s,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,null==s&&(this.epsilon=Wc.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t],r=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:oh((()=>kd(s).variable(r)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:oh((()=>kd(s).variable(r)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:oh((()=>kd(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;oh((()=>{const e=bd(Ad(a,this.decay),Ad(Cd(i),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,r=bd(Ad(t,this.decay),Ad(i,1-this.decay)),l=vd(Ad(i,this.learningRate),xd(zd(e,bd(Cd(r),this.epsilon)))),u=bd(Ad(o,this.momentum),l);a.assign(e),t.assign(r),o.assign(u);const c=zd(s,u);s.assign(c)}else{const e=bd(Ad(a,this.decay),Ad(Cd(i),1-this.decay)),t=bd(Ad(o,this.momentum),vd(Ad(i,this.learningRate),xd(bd(e,this.epsilon))));a.assign(e),o.assign(t);const n=zd(s,t);s.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&lh(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&lh(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&lh(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}const Kd=[Dd,Fd,Ld,qd,Hd,$d,jd];function Xd(e){return new Promise((e=>setTimeout(e))).then(e)}class Zd{constructor(e){if(!ca().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(Zd.URL_SCHEME)&&(e=e.slice(Zd.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=rh.join(e.weightData),n=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const t=Sh(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),s=window.URL.createObjectURL(new Blob([JSON.stringify(t)],{type:"application/json"})),r=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(r.download=this.modelJsonFileName,r.href=s,await Xd((()=>r.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=n,await Xd((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Ih(e)}}}}Zd.URL_SCHEME="downloads://";class Yd{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const s=JSON.parse(n.target.result),r=s.modelTopology;if(null==r)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==s.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:r});const i=Eh(s,(e=>this.loadWeights(e)));e(i)},n.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),n.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],n=[];for(const s of e)t.push(...s.weights),n.push(...s.paths);const s=this.checkManifestAndWeightFiles(e),r=n.map((e=>this.loadWeightsFile(e,s[e])));return Promise.all(r).then((e=>[t,e]))}loadWeightsFile(e,t){return new Promise(((n,s)=>{const r=new FileReader;r.onload=e=>{const t=e.target.result;n(t)},r.onerror=t=>s(`Failed to weights data from file of path '${e}'.`),r.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map((e=>kh(e.name))),s={};for(const r of e)r.paths.forEach((e=>{const r=kh(e);if(-1!==t.indexOf(r))throw new Error(`Duplicate file basename found in weights manifest: '${r}'`);if(t.push(r),-1===n.indexOf(r))throw new Error(`Weight file with basename '${r}' is not provided.`);s[e]=this.weightsFiles[n.indexOf(r)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return s}}function Qd(e){return new Yd(e)}function Jd(e,t,n,s){!function(e){Ni(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){Ni(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),Ni(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),Ni(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(n=null==n?0:n,s=null==s?1:s);let r=0;return Promise.all(e.map((i=>(i.then((i=>{const a=n+ ++r/e.length*(s-n);return t(a),i})),i))))}async function ep(e,t){null==t&&(t={});const n=null==t.fetchFunc?ca().platform.fetch:t.fetchFunc,s=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),r=(null==t.onProgress?await Promise.all(s):await Jd(s,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(r):await Jd(r,t.onProgress,.5,1)}async function tp(e,t="",n,s){return np((e=>ep(e,{requestInit:s})))(e,t,n)}function np(e){return async(t,n="",s)=>{const r=t.map((()=>!1)),i={},a=null!=s?s.map((()=>!1)):[],o=[];if(t.forEach(((e,t)=>{let n=0;e.weights.forEach((e=>{const l="quantization"in e?e.quantization.dtype:e.dtype,u=sh[l]*Di(e.shape),c=()=>{r[t]=!0,null==i[t]&&(i[t]=[]),i[t].push({manifestEntry:e,groupOffset:n,sizeBytes:u})};null!=s?s.forEach(((t,n)=>{t===e.name&&(c(),a[n]=!0)})):c(),o.push(e.name),n+=u}))})),!a.every((e=>e))){const e=s.filter(((e,t)=>!a[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${o.join(", ")}.`)}const l=r.reduce(((e,t,n)=>(t&&e.push(n),e)),[]),u=[];l.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;u.push(t)}))}));const c=await e(u),h={};let d=0;return l.forEach((e=>{const n=t[e].paths.length,s=new rh(c.slice(d,d+n));i[e].forEach((e=>{const t=fh(s.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)h[e]=t[e]})),d+=n})),h}}Nh.registerSaveRouter((e=>ca().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Zd.URL_SCHEME)?function(e="model"){return new Zd(e)}(e.slice(Zd.URL_SCHEME.length)):null));class sp{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(Ni("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=ca().platform.fetch,Ni(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&Ni(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{},this.loadOptions=t}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=Sh(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData){const n=rh.join(e.weightData);t.body.append("model.weights.bin",new Blob([n],{type:"application/octet-stream"}),"model.weights.bin")}const s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:Ih(e),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,s=t.weightsManifest;if(null==n&&null==s)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();return Eh(await this.loadModelJSON(),(e=>this.loadWeights(e)))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),n=Th(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:n,getWeightStream:()=>function(e,t){var n;const s=null==t.fetchFunc?ca().platform.fetch:t.fetchFunc;let r,i=0;return null===(n=t.onProgress)||void 0===n||n.call(t,0),new ReadableStream({pull:async n=>{for(var a;it?e.substring(n):"";return[s+"/",r]}(t),r=this.weightPathPrefix||n,i=[],a=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?a.push(this.weightUrlConverter(e)):i.push(r+e+s);return this.weightUrlConverter&&i.push(...await Promise.all(a)),i}async loadWeights(e){const t=await this.getWeightUrls(e);return[Th(e),await ep(t,this.loadOptions)]}}function rp(e){return null!=e.match(sp.URL_SCHEME_REGEX)}sp.URL_SCHEME_REGEX=/^https?:\/\//;const ip=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>rp(e))):rp(e),n)return ap(e,t)}return null};function ap(e,t){return new sp(e,t)}function op(e,t){return ap(e,t)}Nh.registerSaveRouter(ip),Nh.registerLoadRouter(ip);class lp{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class up{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class cp{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function hp(e,t,n,s){return new cp(dp(...arguments))}function dp(e,t,n,s){if(1===arguments.length){const t=null!=e.modelTopology||null!=e.weightSpecs;return new lp(t?e:{modelTopology:e})}return new lp({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:s})}function pp(e){return new up(e)}function fp(e){return new up(e)}function mp(e,t,n){if(Ri(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const s=$c(e,n);if(3!==s.length&&1!==s.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return th(e,t,s,n)}let gp,yp=!1;function bp(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,s=!1,r=!1,i=!1,a=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)s=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)r=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)i=!0;else if(null!=e.getContext)a=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);o=!0}if(null!=Ou(xu,Wc.backendName)){const n={pixels:e},s={numChannels:t};return Wc.runKernel(xu,n,s)}const[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height];let c,h;if(a)c=e.getContext("2d").getImageData(0,0,l,u).data;else if(s||n)c=e.data;else if(i||r||o){if(null==gp)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");gp=new OffscreenCanvas(1,1).getContext("2d")}else gp=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});gp.canvas.width=l,gp.canvas.height=u,gp.drawImage(e,0,0,l,u),c=gp.getImageData(0,0,l,u).data}if(4===t)h=new Int32Array(c);else{const e=l*u;h=new Int32Array(e*t);for(let n=0;n4||2===t)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if("float32"!==e.dtype&&"int32"!==e.dtype)throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}async function vp(e,t){let n=Zc(e,"img","toPixels");if(!(e instanceof vc)){const e=n;n=md(e,"int32"),e.dispose()}wp(n);const[s,r]=n.shape.slice(0,2),i=2===n.rank?1:n.shape[2],a=await n.data(),o="float32"===n.dtype?255:1,l=new Uint8ClampedArray(r*s*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${r}.`)}else if("int32"===n.dtype&&(r<0||r>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${r}.`);1===i?(t[0]=r*o,t[1]=r*o,t[2]=r*o):t[s]=r*o}const s=4*e;l[s+0]=Math.round(t[0]),l[s+1]=Math.round(t[1]),l[s+2]=Math.round(t[2]),l[s+3]=Math.round(t[3])}if(null!=t){if(!yp){null!=Ou(co,Wc.backendName)&&(yp=!0)}t.width=r,t.height=s;const e=t.getContext("2d"),n=new ImageData(l,r,s);e.putImageData(n,0,0)}return n!==e&&n.dispose(),l}const Ap=Jc({fromPixels_:bp}),xp=-2,Cp=-1;function kp(e,t,n){const s=e.shape.length;Ni(s===t.length,(()=>`Error in slice${s}D: Length of begin ${t} must match the rank of the array (${s}).`)),Ni(s===n.length,(()=>`Error in slice${s}D: Length of size ${n} must match the rank of the array (${s}).`));for(let r=0;r`Error in slice${s}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`))}function Sp(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function _p(e,t,n){const s=[];for(let r=0;r0){const l=t[0],u=n+1;c=Op(a,l,u,s,e),h=Rp(o,l,u,r,e),d=Ep(i,l,u,e)}else for(let t=0;t-1)i[r]=0;else{const a=Ip(t,n,r);let o=s[a];e&1<-1)i[r]=Number.MAX_SAFE_INTEGER;else{const a=Ip(t,n,r);let o=s[a];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=Ei(0,a,l-1),a}function Fp(e,t,n,s,r,i){let a=t[r];const o=n[r]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=o>0?Ei(0,a,l):Ei(-1,a,l-1),a}function Bp(e,t,n){let s=n.length;for(let e=0;e1){s=e;break}for(let r=s+1;r0||n[r]!==e[r])return!1;return!0}function zp(e,t){let n=e.length>0?e[e.length-1]:1;for(let s=0;s{Ni(-1!==e,(()=>"slice() does not support negative begin indexing."))})),i=null==n?new Array(r).fill(-1):"number"==typeof n?[n,...new Array(r-1).fill(-1)]:n.lengtht>=0?t:(Ni(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`)),e.shape[n]-s[n]))),[s,i]}function Pp(e,t,n,s,r,i,a,o,l){let u;if(null==s?(u=new Array(t.length),u.fill(1)):u=s,null!=a&&a&a-1)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const h={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:u.slice(),beginMask:r,endMask:i,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};for(let e=0;e0?0:-1,d.strides[t]>0?s:s-1];if(n&&d.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===d.strides[t];const a=!!(d.beginMask&1<=s)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=Vp(d.begin[t],0,d.strides[t],s,r,i),d.end[t]=Vp(d.end[t],1,d.strides[t],s,r,i);const e=1===d.strides[t]&&0===d.begin[t]&&d.end[t]===s;p=p&&e,f=f&&(0===t&&1===d.strides[t]||e)}else p=p&&1===d.strides[t]&&a,f=f&&(0===t&&1===d.strides[t]||a);let o,l=!1;if(d.beginValid&&d.endValid?(o=d.end[t]-d.begin[t],l=!0):n?(o=1,l=!0):a&&s>=0&&(o=d.strides[t]<0?-s:s,l=!0),l){let e;e=0===o||o<0!=d.strides[t]<0?0:Math.trunc(o/d.strides[t])+(o%d.strides[t]!=0?1:0),g.push(e)}else g.push(-1)}for(let e=0;e=0?y.push(g[t]):t===xp&&y.push(1)}return{finalShapeSparse:y.filter(((e,t)=>d.finalShapeGatherIndices[t]!==xp)),finalShape:y,isIdentity:p,sliceDim0:f,isSimpleSlice:m,begin:d.begin,end:d.end,strides:d.strides}}function Vp(e,t,n,s,r,i){if(r[t])return n>0?i[t]:i[t+1&1];{const t=e<0?s+e:e;return ti[1]?i[1]:t}}const Wp=Jc({acos_:function(e){const t={x:Zc(e,"x","acos")};return Wc.runKernel(ga,t)}});const Gp=Jc({acosh_:function(e){const t={x:Zc(e,"x","acosh")};return Wc.runKernel(ya,t)}});const Up=Jc({addN_:function(e){Ni(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),Ni(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>Zc(e,`tensors${t}`,"addN"))),n=t[0];t.forEach((e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!Mi(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const s=t;return Wc.runKernel(wa,s)}});const qp=Jc({all_:function(e,t=null,n=!1){const s={x:Zc(e,"x","all","bool")},r={axis:t,keepDims:n};return Wc.runKernel(va,s,r)}});const jp=Jc({any_:function(e,t=null,n=!1){const s={x:Zc(e,"x","any","bool")},r={axis:t,keepDims:n};return Wc.runKernel(Aa,s,r)}});const Hp=Jc({argMax_:function(e,t=0){const n={x:Zc(e,"x","argMax")},s={axis:t};return Wc.runKernel(xa,n,s)}});const $p=Jc({argMin_:function(e,t=0){const n={x:Zc(e,"x","argMin")},s={axis:t};return Wc.runKernel(Ca,n,s)}});const Kp=Jc({asin_:function(e){const t={x:Zc(e,"x","asin")};return Wc.runKernel(ka,t)}});const Xp=Jc({asinh_:function(e){const t={x:Zc(e,"x","asinh")};return Wc.runKernel(Sa,t)}});const Zp=Jc({atan_:function(e){const t={x:Zc(e,"x","atan")};return Wc.runKernel(_a,t)}});const Yp=Jc({atan2_:function(e,t){let n=Zc(e,"a","atan2"),s=Zc(t,"b","atan2");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(Ia,r)}});const Qp=Jc({atanh_:function(e){const t={x:Zc(e,"x","atanh")};return Wc.runKernel(Ea,t)}});function Jp(e,t,n,s,r="NHWC",i){return nf(e,[...t,e[3]],n,i,s,null,null,pf(r))}function ef(e,t,n,s,r,i,a="channelsLast"){const[o,l]=af(t);let u;if("channelsLast"===a)u=[o,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);u=[o,l,e[1],e[1]]}return nf(e,u,n,s,r,i,!1,a)}function tf(e,t,n,s,r,i,a="NDHWC"){const[o,l,u]=of(t);let c,h;if("NDHWC"===a)h="channelsLast",c=[o,l,u,e[4],e[4]];else{if("NCDHW"!==a)throw new Error(`Unknown dataFormat ${a}`);h="channelsFirst",c=[o,l,u,e[1],e[1]]}return sf(e,c,n,s,r,!1,h,i)}function nf(e,t,n,s,r,i,a=!1,o="channelsLast"){let[l,u,c,h]=[-1,-1,-1,-1];if("channelsLast"===o)[l,u,c,h]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,h,u,c]=e}const[d,p,,f]=t,[m,g]=af(n),[y,b]=af(s),w=lf(d,y),v=lf(p,b),{padInfo:A,outHeight:x,outWidth:C}=function(e,t,n,s,r,i,a,o,l){let u,c,h;if("number"==typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const r=function(e,t,n,s,r){null==s&&(s=rf(e,t,n));const i=e[0],a=e[1],o=uf((i-t+2*s)/n+1,r),l=uf((a-t+2*s)/n+1,r);return[o,l]}([t,n],i,s,e,o);c=r[0],h=r[1]}else if("same"===e){c=Math.ceil(t/s),h=Math.ceil(n/r);const e=Math.max(0,(c-1)*s+i-t),o=Math.max(0,(h-1)*r+a-n),l=Math.floor(e/2),d=e-l,p=Math.floor(o/2);u={top:l,bottom:d,left:p,right:o-p,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((t-i+1)/s),h=Math.ceil((n-a+1)/r);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const d="channelsLast"===l?e[1][0]:e[2][0],p="channelsLast"===l?e[1][1]:e[2][1],f="channelsLast"===l?e[2][0]:e[3][0],m="channelsLast"===l?e[2][1]:e[3][1];u={top:d,bottom:p,left:f,right:m,type:0===d&&0===p&&0===f&&0===m?"VALID":"EXPLICIT"},c=uf((t-i+d+p)/s+1,o),h=uf((n-a+f+m)/r+1,o)}}return{padInfo:u,outHeight:c,outWidth:h}}(r,u,c,m,g,w,v,i,o),k=a?f*h:f;let S;return"channelsFirst"===o?S=[l,k,x,C]:"channelsLast"===o&&(S=[l,x,C,k]),{batchSize:l,dataFormat:o,inHeight:u,inWidth:c,inChannels:h,outHeight:x,outWidth:C,outChannels:k,padInfo:A,strideHeight:m,strideWidth:g,filterHeight:d,filterWidth:p,effectiveFilterHeight:w,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:b,inShape:e,outShape:S,filterShape:t}}function sf(e,t,n,s,r,i=!1,a="channelsLast",o){let[l,u,c,h,d]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[l,u,c,h,d]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[l,d,u,c,h]=e}const[p,f,m,,g]=t,[y,b,w]=of(n),[v,A,x]=of(s),C=lf(p,v),k=lf(f,A),S=lf(m,x),{padInfo:_,outDepth:E,outHeight:I,outWidth:T}=function(e,t,n,s,r,i,a,o,l,u,c){let h,d,p,f;"valid"===e&&(e=0);if("number"==typeof e){h={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const m=function(e,t,n,s,r,i){null==r&&(r=rf(e,t[0],s[0]));const a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*r>=t[n]&&(a[n]=uf((e[n]-t[n]+2*r)/s[n]+1,i));return a}([t,n,s,1],[o,l,u],1,[r,i,a],e,c);d=m[0],p=m[1],f=m[2]}else{if("same"!==e)throw Error(`Unknown padding parameter: ${e}`);{d=Math.ceil(t/r),p=Math.ceil(n/i),f=Math.ceil(s/a);const e=(d-1)*r+o-t,c=(p-1)*i+l-n,m=(f-1)*a+u-s,g=Math.floor(e/2),y=e-g,b=Math.floor(c/2),w=c-b,v=Math.floor(m/2);h={top:b,bottom:w,left:v,right:m-v,front:g,back:y,type:"SAME"}}}return{padInfo:h,outDepth:d,outHeight:p,outWidth:f}}(r,u,c,h,y,b,w,C,k,S,o),N=i?g*d:g;let O;return"channelsFirst"===a?O=[l,N,E,I,T]:"channelsLast"===a&&(O=[l,E,I,T,N]),{batchSize:l,dataFormat:a,inDepth:u,inHeight:c,inWidth:h,inChannels:d,outDepth:E,outHeight:I,outWidth:T,outChannels:N,padInfo:_,strideDepth:y,strideHeight:b,strideWidth:w,filterDepth:p,filterHeight:f,filterWidth:m,effectiveFilterDepth:C,effectiveFilterHeight:k,effectiveFilterWidth:S,dilationDepth:v,dilationHeight:A,dilationWidth:x,inShape:e,outShape:O,filterShape:t}}function rf(e,t,n,s=1){const r=lf(t,s);return Math.floor((e[0]*(n-1)-n+r)/2)}function af(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function of(e){return"number"==typeof e?[e,e,e]:e}function lf(e,t){return t<=1?e:e+(e-1)*(t-1)}function uf(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function cf(e){const[t,n,s]=af(e);return 1===t&&1===n&&1===s}function hf(e,t){return cf(e)||cf(t)}function df(e){return af(e).every((e=>e>0))}function pf(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function ff(e,t,n){if(null!=n){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`);if("number"==typeof t)Ni(Fi(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`));else{if("object"!=typeof t)throw Error(`Error in ${e}: Unknown padding parameter: ${t}`);t.forEach((t=>{t.forEach((t=>{Ni(Fi(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}const mf=Jc({reshape_:function(e,t){const n={x:Zc(e,"x","reshape","string_or_numeric")},s={shape:t};return Wc.runKernel(El,n,s)}});const gf=Jc({avgPool_:function(e,t,n,s,r){const i=Zc(e,"x","avgPool","float32");Ni(hf(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let a=i,o=!1;3===i.rank&&(o=!0,a=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Ni(4===a.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${a.rank}.`)),ff("avgPool",s,r);const l={x:a},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r};let c=Wc.runKernel(Ta,l,u);return c=md(c,i.dtype),o?mf(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const yf=Jc({avgPool3d_:function(e,t,n,s,r,i="NDHWC"){const a=Zc(e,"x","avgPool3d","float32");let o=a,l=!1;4===a.rank&&(l=!0,o=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Ni(5===o.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`)),Ni("NDHWC"===i,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),Ni("number"==typeof n&&n>0||Array.isArray(n)&&n[0]>0&&n[1]>0&&n[2]>0,(()=>`Error in avgPool3d: Stride must be > 0, but got '${n}'`)),ff("avgPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i};let h=Wc.runKernel(Oa,u,c);return h=md(h,o.dtype),l?mf(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const bf=Jc({concat_:function(e,t=0){Ni(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=Yc(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${e.dtype}. `)})),1===n.length)return gd(n[0]);const s=n,r={axis:t};return Wc.runKernel(Ua,s,r)}});const wf=Jc({matMul_:function(e,t,n=!1,s=!1){let r=Zc(e,"a","matMul"),i=Zc(t,"b","matMul");[r,i]=Dc(r,i);const a={a:r,b:i},o={transposeA:n,transposeB:s};return Wc.runKernel(Da,a,o)}});const vf=Jc({sigmoid_:function(e){const t={x:Zc(e,"x","sigmoid","float32")};return Wc.runKernel(jl,t)}});const Af=Jc({slice_:function(e,t,n){const s=Zc(e,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const r={x:s},i={begin:t,size:n};return Wc.runKernel(Wl,r,i)}});const xf=Jc({tanh_:function(e){const t={x:Zc(e,"x","tanh","float32")};return Wc.runKernel(du,t)}});const Cf=Jc({basicLSTMCell_:function(e,t,n,s,r,i){const a=Zc(e,"forgetBias","basicLSTMCell"),o=Zc(t,"lstmKernel","basicLSTMCell"),l=Zc(n,"lstmBias","basicLSTMCell"),u=Zc(s,"data","basicLSTMCell"),c=Zc(r,"c","basicLSTMCell"),h=Zc(i,"h","basicLSTMCell"),d=bf([u,h],1),p=wf(d,o),f=bd(p,l),m=f.shape[0],g=f.shape[1]/4,y=[m,g],b=Af(f,[0,0],y),w=Af(f,[0,g],y),v=Af(f,[0,2*g],y),A=Af(f,[0,3*g],y),x=bd(Ad(vf(b),xf(w)),Ad(c,vf(bd(a,v))));return[x,Ad(xf(x),vf(A))]}});const kf=Jc({batchToSpaceND_:function(e,t,n){const s=Zc(e,"x","batchToSpaceND"),r=t.reduce(((e,t)=>e*t));Ni(s.rank>=1+t.length,(()=>`input rank is ${s.rank} but should be > than blockShape.length ${t.length}`)),Ni(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),Ni(s.shape[0]%r==0,(()=>`input tensor batch is ${s.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`));const i={x:s},a={blockShape:t,crops:n};return Wc.runKernel(Ma,i,a)}});const Sf=Jc({batchNorm_:function(e,t,n,s,r,i){null==i&&(i=.001);const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(o.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),Ni(null==c||o.rank===c.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),Ni(null==u||o.rank===u.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const h={x:function(e){let t;return t=0===e.rank||1===e.rank?mf(e,[1,1,1,e.size]):2===e.rank?mf(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?mf(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(a),scale:u,offset:c,mean:o,variance:l},d={varianceEpsilon:i},p=Wc.runKernel(_o,h,d);return mf(p,a.shape)}});const _f=Jc({batchNorm2d_:function(e,t,n,s,r,i){const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;return null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(2===a.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`)),Ni(2===o.rank||1===o.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`)),Ni(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=u&&Ni(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`)),null!=c&&Ni(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`)),Sf(a,o,l,c,u,i)}});const Ef=Jc({batchNorm3d_:function(e,t,n,s,r,i){const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;return null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(3===a.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`)),Ni(3===o.rank||1===o.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`)),Ni(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=u&&Ni(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`)),null!=c&&Ni(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`)),Sf(a,o,l,c,u,i)}});const If=Jc({batchNorm4d_:function(e,t,n,s,r,i){const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;return null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(4===a.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`)),Ni(4===o.rank||1===o.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`)),Ni(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=u&&Ni(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`)),null!=c&&Ni(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`)),Sf(a,o,l,c,u,i)}});const Tf=Jc({bincount_:function(e,t,n){const s=Zc(e,"x","bincount"),r=Zc(t,"weights","bincount");Ni("int32"===s.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${s.dtype}`)),Ni(n>=0,(()=>`size must be non-negative, but got ${n}.`)),Ni(r.size===s.size||0===r.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${s.shape}, weights shape: ${r.shape}.`));const i={x:s,weights:r},a={size:n};return Wc.runKernel(Fa,i,a)}});const Nf=Jc({bitwiseAnd_:function(e,t){const n=Zc(e,"x","bitwiseAnd"),s=Zc(t,"y","bitwiseAnd");if(!Mi(n.shape,s.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${n.shape}, y: ${s.shape}`);if("int32"!==n.dtype||"int32"!==s.dtype)throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${n.dtype} and type of y: ${s.dtype}`);const r={a:n,b:s};return Wc.runKernel(Ba,r)}});const Of=Jc({broadcastArgs_:function(e,t){const n=Zc(e,"s0","broadcastArgs","int32"),s=Zc(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==s.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${s.rank}`);const r={s0:n,s1:s};return Wc.runKernel(za,r)}});const Rf=Jc({broadcastTo_:function(e,t){let n=Zc(e,"broadcastTo","x");const s=n.shape;if(sa(t),t.lengthn.rank){const e=n.shape.slice();for(;e.length=0;e--)if(r[e]===t[e])i[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${t}].`);if(0===i.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return gd(n);const a={x:n},o={reps:i};return Wc.runKernel(pu,a,o)}});const Df=Jc({ceil_:function(e){const t={x:Zc(e,"x","ceil","float32")};return Wc.runKernel(Pa,t)}});const Mf=Jc({clipByValue_:function(e,t,n){const s=Zc(e,"x","clipByValue");if(Ni(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return Md(s.shape,t,s.dtype);const r={x:s},i={clipValueMin:t,clipValueMax:n};return Wc.runKernel(Va,r,i)}});const Ff=Jc({concat1d_:function(e){return bf(e,0)}});const Bf=Jc({concat2d_:function(e,t){return bf(e,t)}});const zf=Jc({concat3d_:function(e,t){return bf(e,t)}});const Lf=Jc({concat4d_:function(e,t){return bf(e,t)}});const Pf=Jc({conv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=Zc(e,"x","conv2d","float32"),l=Zc(t,"filter","conv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),Ni(4===u.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`)),Ni(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),ff("conv2d",s,a);const h="NHWC"===r?u.shape[3]:u.shape[1];Ni(h===l.shape[2],(()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`)),Ni(hf(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),Ni(df(i),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),Ni(df(n),(()=>"Error in conv2D: Strides should be larger than 0."));const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=Wc.runKernel(qa,d,p);return c?mf(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Vf=Jc({conv1d_:function(e,t,n,s,r="NWC",i=1,a){const o=Zc(e,"x","conv1d"),l=Zc(t,"filter","conv1d");let u=o,c=!1;2===o.rank&&(c=!0,u=mf(o,[1,o.shape[0],o.shape[1]])),Ni(3===u.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`)),Ni(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),ff("conv1d",s,a),Ni(u.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),Ni(hf(n,i),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`)),Ni(df(i),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),Ni(df(n),(()=>"Error in conv1D: Stride should be larger than 0.")),Ni("NWC"===r,(()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`));const h=mf(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=mf(u,[u.shape[0],1,u.shape[1],u.shape[2]]),p=Pf(d,h,[1,n],s,"NHWC",[1,i],a);return mf(p,c?[p.shape[2],p.shape[3]]:[p.shape[0],p.shape[2],p.shape[3]])}});const Wf=Jc({conv2DBackpropInput_:function(e,t,n,s,r,i="NHWC",a){Ni(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let o=e,l=t,u=!1;3===t.rank&&(u=!0,l=mf(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),Ni(4===o.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`)),Ni(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),Ni(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const c="NHWC"===i?o[3]:o[1],h="NHWC"===i?l.shape[3]:l.shape[1];Ni(c===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${n.shape[2]}.`)),Ni(h===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`)),ff("conv2dDerInput",r,a);const d={dy:l,filter:n},p={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,inputShape:o},f=Wc.runKernel(Ha,d,p);return u?mf(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Gf=Jc({conv2dTranspose_:function(e,t,n,s,r,i){const a=Zc(e,"x","conv2dTranspose"),o=Zc(t,"filter","conv2dTranspose");return Wf(n,a,o,s,r,"NHWC",i)}});const Uf=Jc({conv3d_:function(e,t,n,s,r="NDHWC",i=[1,1,1]){const a=Zc(e,"x","conv3d"),o=Zc(t,"filter","conv3d");let l=a,u=!1;4===a.rank&&(u=!0,l=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Ni(5===l.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`)),Ni(5===o.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`)),Ni(l.shape[4]===o.shape[3],(()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`)),Ni(hf(n,i),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),Ni("NDHWC"===r,(()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`)),Ni(df(i),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),Ni(df(n),(()=>"Error in conv3D: Strides should be larger than 0."));const c={x:l,filter:o},h={strides:n,pad:s,dataFormat:r,dilations:i},d=Wc.runKernel($a,c,h);return u?mf(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const qf=Jc({conv3DBackpropInput_:function(e,t,n,s,r){Ni(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let i=e,a=t,o=!1;4===t.rank&&(o=!0,a=mf(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),i=[1,e[0],e[1],e[2],e[3]]);const l=i[4],u=a.shape[4];Ni(5===i.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`)),Ni(5===a.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`)),Ni(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),Ni(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),Ni(u===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`));const c={dy:a,filter:n},h={pad:r,strides:s,inputShape:i},d=Wc.runKernel(Xa,c,h);return o?mf(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const jf=Jc({conv3dTranspose_:function(e,t,n,s,r){const i=Zc(e,"x","conv3dTranspose"),a=Zc(t,"filter","conv3dTranspose");return qf(n,i,a,s,r)}});const Hf=Jc({cos_:function(e){const t={x:Zc(e,"x","cos","float32")};return Wc.runKernel(Za,t)}});const $f=Jc({cosh_:function(e){const t={x:Zc(e,"x","cosh","float32")};return Wc.runKernel(Ya,t)}});const Kf=Jc({cumprod_:function(e,t=0,n=!1,s=!1){const r={x:Zc(e,"x","cumprod")},i={axis:t,exclusive:n,reverse:s};return Wc.runKernel(Qa,r,i)}});const Xf=Jc({cumsum_:function(e,t=0,n=!1,s=!1){const r={x:Zc(e,"x","cumsum")},i={axis:t,exclusive:n,reverse:s};return Wc.runKernel(Ja,r,i)}});const Zf=Jc({denseBincount_:function(e,t,n,s=!1){const r=Zc(e,"x","denseBincount"),i=Zc(t,"weights","denseBincount");Ni("int32"===r.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`)),Ni(r.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`)),Ni(n>=0,(()=>`size must be non-negative, but got ${n}.`)),Ni(i.size===r.size||0===i.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${i.shape}.`));const a={x:r,weights:i},o={size:n,binaryOutput:s};return Wc.runKernel(to,a,o)}});const Yf=Jc({depthToSpace_:function(e,t,n="NHWC"){const s=Zc(e,"x","depthToSpace","float32"),r="NHWC"===n?s.shape[1]:s.shape[2],i="NHWC"===n?s.shape[2]:s.shape[3],a="NHWC"===n?s.shape[3]:s.shape[1];Ni(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),Ni(r*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${t} for depthToSpace with input shape\n ${s.shape}`)),Ni(i*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${i} and ${t} for depthToSpace with input shape\n ${s.shape}`)),Ni(a%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${s.shape}`));const o={x:s},l={blockSize:t,dataFormat:n};return Wc.runKernel(no,o,l)}});const Qf=Jc({depthwiseConv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=Zc(e,"x","depthwiseConv2d","float32"),l=Zc(t,"filter","depthwiseConv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),Ni(4===u.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`)),Ni(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`));const h="NHWC"===r?u.shape[3]:u.shape[1];Ni(h===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${h}) must match the inChannels dimension in filter ${l.shape[2]}.`)),ff("depthwiseConv2d",s,a);const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=Wc.runKernel(so,d,p);return c?mf(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Jf=Jc({diag_:function(e){const t={x:Zc(e,"x","diag")};return Wc.runKernel(ao,t)}});const em=Jc({dilation2d_:function(e,t,n,s,r=[1,1],i="NHWC"){const a=Zc(e,"x","dilation2d"),o=Zc(t,"filter","dilation2d");Ni(3===a.rank||4===a.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`)),Ni(3===o.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`)),Ni("NHWC"===i,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`));let l=a,u=!1;3===a.rank&&(l=mf(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0),Ni(l.shape[3]===o.shape[2],(()=>`Error in dilation2d: input and filter must have the same depth: ${l.shape[3]} vs ${o.shape[2]}`));const c={x:l,filter:o},h={strides:n,pad:s,dilations:r},d=Wc.runKernel(oo,c,h);return u?mf(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const tm=Jc({equal_:function(e,t){let n=Zc(e,"a","equal","string_or_numeric"),s=Zc(t,"b","equal","string_or_numeric");[n,s]=Dc(n,s),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(yo,r)}});const nm=Jc({where_:function(e,t,n){const s=Zc(t,"a","where"),r=Zc(n,"b","where"),i=Zc(e,"condition","where","bool"),a=Gd(Gd(i.shape,s.shape),r.shape),o={condition:Rf(i,a),t:Rf(s,a),e:Rf(r,a)};return Wc.runKernel(Pl,o)}});const sm=Jc({divNoNan_:function(e,t){let n=Zc(e,"a","div"),s=Zc(t,"b","div");[n,s]=Dc(n,s);const r=vd(n,s),i=kd(r),a=tm(s,i);return nm(a,i,r)}});const rm=Jc({dot_:function(e,t){const n=Zc(e,"t1","dot"),s=Zc(t,"t2","dot");Ni(!(1!==n.rank&&2!==n.rank||1!==s.rank&&2!==s.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${s.rank}.`));const r=1===n.rank?n.size:n.shape[1],i=1===s.rank?s.size:s.shape[0];if(Ni(r===i,(()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${i}.`)),1===n.rank&&1===s.rank){const e=mf(n,[1,-1]),t=mf(s,[-1,1]),r=wf(e,t);return mf(r,[])}if(1===n.rank&&2===s.rank){const e=mf(n,[1,-1]),t=mf(s,[s.shape[0],s.shape[1]]),r=wf(e,t);return mf(r,[r.size])}if(2===n.rank&&1===s.rank){const e=mf(s,[-1,1]),t=wf(n,e);return mf(t,[t.size])}{const e=mf(s,[s.shape[0],s.shape[1]]);return wf(n,e)}}});const im=Jc({einsum_:function(e,...t){const n=t.map(((e,t)=>Zc(e,`tensors${t}`,"einsum"))),s={equation:e};return Wc.runKernel(po,n,s)}});const am=Jc({elu_:function(e){const t={x:Zc(e,"x","elu","float32")};return Wc.runKernel(fo,t)}});const om=Jc({ensureShape_:function(e,t){const n=Zc(e,"x","ensureShape","string_or_numeric");if(!function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=md(t,"float32"));const n={x:t};return Wc.runKernel(go,n)}});function um(e,t){for(let n=0;ne[t]))]}function dm(e,t){return cm(e,t.map((e=>1)),t)}function pm(e,t,n){Ni(um(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function fm(e,t){if(um(e,t))return null;const n=[];for(let s=0;sn.push(e))),n}function mm(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function gm(e,t){const n=[];for(let s=t-e;s"Axis must be <= rank of the tensor"));const s={input:n},r={dim:t};return Wc.runKernel(wo,s,r)}});const Sm=Jc({expm1_:function(e){const t={x:Zc(e,"x","expm1")};return Wc.runKernel(vo,t)}});const _m=Jc({tile_:function(e,t){const n=Zc(e,"x","tile","string_or_numeric");Ni(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`));const s={x:n},r={reps:t};return Wc.runKernel(pu,s,r)}});const Em=Jc({eye_:function(e,t,n,s="float32"){null==t&&(t=e);const r=fd([e,t],s),i=e<=t?e:t;for(let e=0;e`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${i.rank}.`)),Ni(Fi(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let a=i,o=!1;3===i.rank&&(o=!0,a=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:a},u={depthRadius:t,bias:n,alpha:s,beta:r},c=Wc.runKernel(Ho,l,u);return o?mf(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Wm=Jc({log_:function(e){const t={x:Zc(e,"x","log","float32")};return Wc.runKernel(Wo,t)}});const Gm=Jc({log1p_:function(e){const t={x:Zc(e,"x","log1p")};return Wc.runKernel(Go,t)}});const Um=Jc({neg_:function(e){const t={x:Zc(e,"x","neg")};return Wc.runKernel(ll,t)}});const qm=Jc({softplus_:function(e){const t={x:Zc(e,"x","softplus")};return Wc.runKernel(Hl,t)}});const jm=Jc({logSigmoid_:function(e){const t=Zc(e,"x","logSigmoid");return Sd((e=>({value:Um(qm(Um(e))),gradFunc:t=>Ad(t,vf(Um(e)))})))(t)}});const Hm=Jc({logSoftmax_:function(e,t=-1){const n=Zc(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);const s=Sd(((e,n)=>{const s=ym(e,t,!0),r=zd(e,s),i=zd(md(r,"float32"),Wm(wm(Cm(r),t,!0)));n([i]);return{value:i,gradFunc:(e,n)=>{const[s]=n,r=Cm(s);return zd(e,Ad(wm(e,t,!0),r))}}}));return s(n)}});const $m=Jc({logSumExp_:function(e,t=null,n=!1){const s=Zc(e,"x","logSumExp"),r=Vi(t,s.shape),i=ym(s,r,!0),a=zd(s,i),o=Cm(a),l=wm(o,r),u=Wm(l),c=bd(mf(i,u.shape),u);if(n){const e=dm(c.shape,r);return mf(c,e)}return c}});const Km=Jc({logicalAnd_:function(e,t){const n=Zc(e,"a","logicalAnd","bool"),s=Zc(t,"b","logicalAnd","bool");Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(Uo,r)}});const Xm=Jc({logicalNot_:function(e){const t={x:Zc(e,"x","logicalNot","bool")};return Wc.runKernel(qo,t)}});const Zm=Jc({logicalOr_:function(e,t){const n=Zc(e,"a","logicalOr","bool"),s=Zc(t,"b","logicalOr","bool");Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(jo,r)}});const Ym=Jc({logicalXor_:function(e,t){const n=Zc(e,"a","logicalXor","bool"),s=Zc(t,"b","logicalXor","bool");return Gd(n.shape,s.shape),Km(Zm(e,t),Xm(Km(e,t)))}}),Qm=2147483648;const Jm=Jc({searchSorted_:function(e,t,n="left"){const s=Zc(e,"sortedSequence","searchSorted"),r=Zc(t,"values","searchSorted"),i=s.shape[s.shape.length-1],a=r.shape[r.shape.length-1],o=mf(s,[-1,i]),l=mf(r,[-1,a]);if(o.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(o.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(Di(l.shape)>=Qm)throw new Error("values tensor size must less than 2147483648");if(o.shape[1]>=Qm)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${o.shape[1]}`);const u={sortedSequence:o,values:l},c={side:n};return Wc.runKernel(Ll,u,c)}});function eg(e,t){return Jm(e,t,"left")}const tg=Jc({maxPool_:function(e,t,n,s,r){const i=Zc(e,"x","maxPool");let a=i,o=!1;3===i.rank&&(o=!0,a=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Ni(4===a.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${a.rank}.`)),Ni(hf(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),ff("maxPool",s,r);const l={x:a},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r},c=Wc.runKernel(Zo,l,u);return o?mf(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const ng=Jc({maxPool3d_:function(e,t=[1,1,1],n,s,r,i="NDHWC"){const a=Zc(e,"x","maxPool3d");let o=a,l=!1;4===a.rank&&(l=!0,o=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Ni(5===o.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`)),Ni("NDHWC"===i,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),ff("maxPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i},h=Wc.runKernel(Qo,u,c);return l?mf(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const sg=Jc({maxPoolWithArgmax_:function(e,t,n,s,r=!1){const i={x:Zc(e,"x","maxPoolWithArgmax")},a={filterSize:t,strides:n,pad:s,includeBatchInIndex:r},o=Wc.runKernel(el,i,a);return{result:o[0],indexes:o[1]}}});const rg=Jc({mean_:function(e,t=null,n=!1){const s={x:Zc(e,"x","mean")},r={axis:t,keepDims:n};return Wc.runKernel(tl,s,r)}});function ig(e,t="float32"){if(sa(e),"complex64"===t){const t=ig(e,"float32"),n=ig(e,"float32");return eh(t,n)}const n=ta(Di(e),t);return Wc.makeTensor(n,e,t)}function ag(e,t="float32"){if(sa(e),"complex64"===t){const t=ag(e,"float32"),n=ig(e,"float32");return eh(t,n)}const n=ea(Di(e),t);return Wc.makeTensor(n,e,t)}function og(e,t,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===e)return[];let s=Zc(e,"x","meshgrid",e instanceof vc?e.dtype:"float32");if(void 0===t)return[s];let r=Zc(t,"y","meshgrid",t instanceof vc?t.dtype:"float32");const i=Di(s.shape),a=Di(r.shape);return"xy"===n?(s=mf(s,[1,-1]),r=mf(r,[-1,1]),[wf(ag([a,1],s.dtype),s),wf(r,ag([1,i],r.dtype))]):(s=mf(s,[-1,1]),r=mf(r,[1,-1]),[wf(s,ag([1,a],s.dtype)),wf(ag([i,1],r.dtype),r)])}const lg=Jc({minimum_:function(e,t){let n=Zc(e,"a","minimum"),s=Zc(t,"b","minimum");[n,s]=Dc(n,s),"bool"===n.dtype&&(n=md(n,"int32"),s=md(s,"int32")),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(sl,r)}});const ug=Jc({mirrorPad_:function(e,t,n){Ni("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const s=Zc(e,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");Ni(t.length===s.rank,(()=>`Padding doesn't match input. Must be ${s.rank}. Got ${t.length}.`));const r="reflect"===n?1:0;for(let e=0;e"Invalid number of paddings. Must be length of 2 each.")),Ni(t[e][0]>=0&&t[e][0]<=s.shape[e]-r&&t[e][1]>=0&&t[e][1]<=s.shape[e]-r,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${s.shape[e]-r} or less than 0 for input of shape ${s.shape}`));const i={paddings:t,mode:n},a={x:s};return Wc.runKernel(rl,a,i)}});const cg=Jc({mod_:function(e,t){let n=Zc(e,"a","mod"),s=Zc(t,"b","mod");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(il,r)}});const hg=Jc({moments_:function(e,t=null,n=!1){const s=Vi(t,(e=Zc(e,"x","moments")).shape),r=rg(e,s,n);let i=r.shape;n||(i=dm(r.shape,s));const a=Cd(zd(md(e,"float32"),mf(r,i)));return{mean:r,variance:rg(a,s,n)}}});const dg=Jc({multiRNNCell_:function(e,t,n,s){const r=Zc(t,"data","multiRNNCell"),i=Yc(n,"c","multiRNNCell"),a=Yc(s,"h","multiRNNCell");let o=r;const l=[];for(let t=0;t2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);n=n||Math.random();const o={logits:1===a?mf(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:s},u=Wc.runKernel(al,o,l);return 1===a?mf(u,[u.size]):u}});const fg=Jc({notEqual_:function(e,t){let n=Zc(e,"a","notEqual","string_or_numeric"),s=Zc(t,"b","notEqual","string_or_numeric");[n,s]=Dc(n,s),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(ul,r)}});const mg=Jc({oneHot_:function(e,t,n=1,s=0,r="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const i={indices:Zc(e,"indices","oneHot","int32")},a={dtype:r,depth:t,onValue:n,offValue:s};return Wc.runKernel(fl,i,a)}});const gg=Jc({onesLike_:function(e){const t={x:Zc(e,"x","onesLike")};return Wc.runKernel(pl,t)}});const yg=Jc({outerProduct_:function(e,t){const n=Zc(e,"v1","outerProduct"),s=Zc(t,"v2","outerProduct");Ni(1===n.rank&&1===s.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${s.rank}.`));const r=mf(n,[-1,1]),i=mf(s,[1,-1]);return wf(r,i)}});const bg=Jc({pad_:function(e,t,n=0){const s=Zc(e,"x","pad");if(0===s.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const r={paddings:t,constantValue:n},i={x:s};return Wc.runKernel(gl,i,r)}});const wg=Jc({pad1d_:function(e,t,n=0){return Ni(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),bg(e,[t],n)}});const vg=Jc({pad2d_:function(e,t,n=0){return Ni(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),bg(e,t,n)}});const Ag=Jc({pad3d_:function(e,t,n=0){return Ni(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),bg(e,t,n)}});const xg=Jc({pad4d_:function(e,t,n=0){return Ni(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),bg(e,t,n)}});const Cg=Jc({spaceToBatchND_:function(e,t,n){const s=Zc(e,"x","spaceToBatchND");Ni(s.rank>=1+t.length,(()=>`input rank ${s.rank} should be > than [blockShape] ${t.length}`)),Ni(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),Ni(s.shape.reduce(((e,s,r)=>r>0&&r<=t.length?e&&(s+n[r-1][0]+n[r-1][1])%t[r-1]==0:e),!0),(()=>`input spatial dimensions ${s.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`));const r={x:s},i={blockShape:t,paddings:n};return Wc.runKernel(Xl,r,i)}});const kg=Jc({pool_:function(e,t,n,s,r,i,a){null==r&&(r=[1,1]),null==i&&(i=1),0===s&&(s="valid");const o=Zc(e,"x","maxPool");let l=o,u=!1;3===o.rank&&(u=!0,l=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),Ni(hf(i,r),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${r}'`));const c=ef(l.shape,t,i,r,s),h=[c.dilationHeight,c.dilationWidth];let d;d="same"===s?function(e,t){const n=e.map(((e,n)=>e+(e-1)*(t[n]-1))),s=n.map((e=>e-1)),r=s.map((e=>Math.floor(e/2))),i=s.map(((e,t)=>e-r[t]));return s.map(((e,t)=>[r[t],i[t]]))}([c.filterHeight,c.filterWidth],h):[[0,0],[0,0]];const p=1===h[0]&&1===h[1],[f,m]=function(e,t,n){const s=n.map((e=>e[0])),r=n.map((e=>e[1])),i=e.concat(s,r),a=t.map(((e,t)=>(e-i[t]%e)%e)),o=r.map(((e,t)=>e+a[t])),l=t.map(((e,t)=>[s[t],o[t]])),u=t.map(((e,t)=>[0,a[t]]));return[l,u]}([c.inHeight,c.inWidth],h,d),g=p?s:"valid",y=p?l:Cg(l,h,f),b=("avg"===n?()=>gf(y,t,i,g,a):()=>tg(y,t,i,g,a))(),w=p?b:kf(b,h,m);return u?mf(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});const Sg=Jc({prelu_:function(e,t){const n={x:Zc(e,"x","prelu"),alpha:Zc(t,"alpha","prelu")};return Wc.runKernel(bl,n)}});const _g=Jc({prod_:function(e,t=null,n=!1){let s=Zc(e,"x","prod");"bool"===s.dtype&&(s=md(s,"int32"));const r={x:s},i={axis:t,keepDims:n};return Wc.runKernel(wl,r,i)}});const Eg=Jc({raggedGather_:function(e,t,n,s){const r={paramsNestedSplits:e.map(((e,t)=>Zc(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:Zc(t,"paramsDenseValues","raggedGather"),indices:Zc(n,"indices","raggedGather","int32")},i={outputRaggedRank:s},a=Wc.runKernel(vl,r,i);return{outputNestedSplits:a.slice(0,a.length-1),outputDenseValues:a[a.length-1]}}});const Ig=Jc({raggedRange_:function(e,t,n){const s=Zc(e,"starts","raggedRange"),r={starts:s,limits:Zc(t,"limits","raggedRange",s.dtype),deltas:Zc(n,"deltas","raggedRange",s.dtype)},i=Wc.runKernel(Al,r);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}});const Tg=Jc({raggedTensorToTensor_:function(e,t,n,s,r){const i=Zc(e,"shape","raggedTensorToTensor","int32"),a=Zc(t,"values","raggedTensorToTensor"),o={shape:i,values:a,defaultValue:Zc(n,"defaultValue","raggedTensorToTensor",a.dtype),rowPartitionTensors:s.map(((e,t)=>Zc(e,`tensors${t}`,"raggedTensorToTensor","int32")))},l={rowPartitionTypes:r};return Wc.runKernel(xl,o,l)}});const Ng=Jc({rand_:function(e,t,n){sa(e);const s=Di(e);let r=null;if(null==n||"float32"===n)r=new Float32Array(s);else if("int32"===n)r=new Int32Array(s);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);r=new Uint8Array(s)}for(let e=0;e=1||0===i);const a=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*s*a,t=this.mean+this.stdDev*r*a,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class Dg{constructor(e,t,n,s){this.alpha=e,this.beta=1/t,this.dtype=n;const r=s||Math.random();this.randu=Og.alea(r.toString()),this.randn=new Rg(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,s,r,i;for(;;){do{s=this.randn.nextValue(),i=1+this.c*s}while(i<=0);if(i*=i*i,e=s*s,t=1-.331*e*e,n=.5*e+this.d*(1-i+Math.log(i)),r=this.randu(),rnull==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==s&&(s=Math.random()),"number"==typeof s&&(s=s.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=Og.alea(s)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const Fg=Jc({randomGamma_:function(e,t,n=1,s="float32",r){if(sa(e),null==n&&(n=1),null==s&&(s="float32"),"float32"!==s&&"int32"!==s)throw new Error(`Unsupported data type ${s}`);const i=new Dg(t,n,s,r),a=fd(e,s);for(let e=0;e`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),jg(t,0)}});const $g=Jc({reverse2d_:function(e,t){const n=Zc(e,"x","reverse");return Ni(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),jg(n,t)}});const Kg=Jc({reverse3d_:function(e,t){const n=Zc(e,"x","reverse");return Ni(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),jg(n,t)}});const Xg=Jc({reverse4d_:function(e,t){const n=Zc(e,"x","reverse");return Ni(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),jg(n,t)}});const Zg=Jc({round_:function(e){const t={x:Zc(e,"x","round")};return Wc.runKernel(Ml,t)}});const Yg=Jc({rsqrt_:function(e){const t={x:Zc(e,"x","rsqrt","float32")};return Wc.runKernel(Fl,t)}});const Qg=Jc({selu_:function(e){const t={x:Zc(e,"x","selu")};return Wc.runKernel(Vl,t)}});const Jg=Jc({separableConv2d_:function(e,t,n,s,r,i=[1,1],a="NHWC"){const o=Zc(e,"x","separableConv2d"),l=Zc(t,"depthwiseFilter","separableConv2d"),u=Zc(n,"pointwiseFilter","separableConv2d");let c=o,h=!1;if(3===o.rank&&(h=!0,c=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");Ni(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),Ni(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),Ni(4===u.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),Ni(1===u.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`)),Ni(1===u.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`));const d=l.shape[2],p=l.shape[3];Ni(u.shape[2]===d*p,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${u.shape[2]}.`));const f=Qf(c,l,s,r,a,i),m=Pf(f,u,1,"valid",a);return h?mf(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const ey=async function(e,t){const n=Zc(e,"x","setdiff1d"),s=Zc(t,"y","setdiff1d");Ni(n.dtype===s.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${s.dtype}).`)),Ni(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),Ni(1===s.rank,(()=>`y should be 1D tensor, but got y (${s.shape}).`));const r=await n.data(),i=await s.data(),a=new Set(i);let o=0;for(let e=0;e`slice1d expects a rank-1 tensor, but got a rank-${s.rank} tensor`)),Af(s,[t],[n])}});const iy=Jc({slice2d_:function(e,t,n){const s=Zc(e,"x","slice2d");return Ni(2===s.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${s.rank} tensor`)),Af(s,t,n)}});const ay=Jc({slice3d_:function(e,t,n){const s=Zc(e,"x","slice3d");return Ni(3===s.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${s.rank} tensor`)),Af(s,t,n)}});const oy=Jc({slice4d_:function(e,t,n){const s=Zc(e,"x","slice4d");return Ni(4===s.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${s.rank} tensor`)),Af(s,t,n)}});const ly=Jc({softmax_:function(e,t=-1){const n=Zc(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);const s={logits:n},r={dim:t};return Wc.runKernel(Yl,s,r)}});const uy=Jc({fft_:function(e){Ni("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return Wc.runKernel(Ao,t)}});const cy=Jc({ifft_:function(e){Ni("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return Wc.runKernel(Ro,t)}});const hy=Jc({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let s;if(t<=2){const r=mf(e,[n,t]);s=cy(r)}else{const r=[n,2*(t-1)],i=mf(Wg(e),[n,t]),a=mf(Rm(e),[n,t]),o=jg(Af(i,[0,1],[n,t-2]),1),l=Ad(jg(Af(a,[0,1],[n,t-2]),1),_d(-1)),u=bf([i,o],1),c=bf([a,l],1),h=mf(eh(u,c),[r[0],r[1]]);s=cy(h)}if(s=Wg(s),3===e.rank&&0!==e.shape[0]){const t=s,n=e.shape[0];s=mf(s,[n,s.shape[0]/n,s.shape[1]]),t.dispose()}return s}});const dy=Jc({split_:function(e,t,n=0){const s={x:Zc(e,"x","split")},r={numOrSizeSplits:t,axis:n};return Wc.runKernel(Zl,s,r)}});const py=Jc({rfft_:function(e,t){Ni("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let n=e.shape[e.shape.length-1];const s=e.size/n;let r;if(null!=t&&t0)),i=e.shape.map((e=>e));i[e.shape.length-1]=t,r=Af(e,s,i),n=t}else if(null!=t&&t>n){const s=e.shape.map((e=>e));s[e.shape.length-1]=t-n,r=bf([e,ig(s)],e.shape.length-1),n=t}else r=e;const i=kd(r),a=mf(eh(r,i),[s,n]),o=uy(a),l=Math.floor(n/2)+1,u=Wg(o),c=Rm(o),h=dy(u,[l,n-l],u.shape.length-1),d=dy(c,[l,n-l],c.shape.length-1),p=r.shape.slice();return p[r.shape.length-1]=l,mf(eh(h[0],d[0]),p)}});const fy=Jc({squaredDifference_:function(e,t){let n=Zc(e,"a","squaredDifference"),s=Zc(t,"b","squaredDifference");[n,s]=Dc(n,s),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(su,r,{})}});const my=Jc({squeeze_:function(e,t){const n=Zc(e,"x","squeeze","string_or_numeric");return mf(n,Wi(n.shape,t).newShape)}});const gy=Jc({stack_:function(e,t=0){const n=Yc(e,"tensors","stack","string_or_numeric");Ni(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&Ni(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const s=n,r={axis:t};return Wc.runKernel(ml,s,r)}});const yy=Jc({step_:function(e,t=0){const n={x:Zc(e,"x","step")},s={alpha:t};return Wc.runKernel(Au,n,s)}});const by=Jc({stridedSlice_:function(e,t,n,s,r=0,i=0,a=0,o=0,l=0){const u={x:Zc(e,"x","stridedSlice","string_or_numeric")},c={begin:t,end:n,strides:s,beginMask:r,endMask:i,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};return Wc.runKernel(au,u,c)}});const wy=Jc({tan_:function(e){const t={x:Zc(e,"x","tan","float32")};return Wc.runKernel(hu,t)}});function vy(e,t){Ri(e);const n=$c(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return th(e,null,n,t)}function Ay(e,t,n){if(Ri(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const s=$c(e,n);if(2!==s.length&&1!==s.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return th(e,t,s,n)}function xy(e,t,n){if(Ri(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const s=$c(e,n);if(4!==s.length&&1!==s.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return th(e,t,s,n)}function Cy(e,t,n){if(Ri(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const s=$c(e,n);if(5!==s.length&&1!==s.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return th(e,t,s,n)}function ky(e,t,n){if(Ri(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const s=$c(e,n);if(6!==s.length&&1!==s.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return th(e,t=t||s,s,n)}function Sy(e,t,n){const s=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,i=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${s}, and batchDim: ${r}.`;if(n.rank1?t.shape[s-1]:1,i=n.length;let a=1;for(let e=r;e= 0 but got ${t}`);if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);const i={x:s},a={k:t,sorted:n},[o,l]=Wc.runKernel(fu,i,a);return{values:o,indices:l}}});const Ny=Jc({truncatedNormal_:function(e,t=0,n=1,s,r){if(sa(e),null!=s&&"bool"===s)throw new Error("Unsupported data type $ { dtype }");const i=new Rg(t,n,s,!0,r),a=fd(e,s);for(let e=0;e0,(()=>"The input tensor must be at least 1D"));const s={x:n},r={axis:t},[i,a]=Wc.runKernel(yu,s,r);return{values:i,indices:a}}});const Ry=Jc({unsortedSegmentSum_:function(e,t,n){const s=Zc(e,"x","unsortedSegmentSum"),r=Zc(t,"segmentIds","unsortedSegmentSum","int32");Ni(Fi(n),(()=>"numSegments must be of dtype int"));const i={x:s,segmentIds:r},a={numSegments:n};return Wc.runKernel(wu,i,a)}});const Dy=Jc({unstack_:function(e,t=0){const n=Zc(e,"x","unstack","string_or_numeric");Ni(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const s={value:n},r={axis:t};return Wc.runKernel(bu,s,r)}});function My(e,t){return Jm(e,t,"right")}function Fy(e,t=!0,n,s){return Wc.makeVariable(e,t,n,s)}function By(e,t){const n=[];for(let e=0;e0,(()=>"mask cannot be scalar")),Oi(o.slice(i,i+a),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=i;et)).reverse()),Ni(s.rank===t.length,(()=>`Error in transpose: rank of input ${s.rank} must match length of perm ${t}.`)),t.forEach((e=>{Ni(e>=0&&e"All entries in 'perm' must be between 0 and "+(s.rank-1)+` but got ${t}`))})),s.rank<=1)return s.clone();const r={x:s},i={perm:t};return"complex64"===s.dtype?oh((()=>{let e=Wg(s),t=Rm(s);return e=Wc.runKernel(gu,{x:e},i),t=Wc.runKernel(gu,{x:t},i),n&&(t=Um(t)),eh(e,t)})):Wc.runKernel(gu,r,i)}});const Vy=Jc({movingAverage_:function(e,t,n,s,r=!0){const i=Zc(e,"v","movingAverage"),a=Zc(t,"x","movingAverage"),o=Zc(n,"decay","movingAverage");var l,u;u=a,Ni((l=i).dtype===u.dtype,(()=>`The dtypes of the first(${l.dtype}) and second(${u.dtype}) input must match`)),Ni(Mi(i.shape,a.shape),(()=>"Shape mismatch in v and x"));const c=_d(1),h=zd(c,o);let d=Ad(zd(a,i),h);if(r){Ni(null!=s,(()=>"When using zeroDebias: true, step is required."));const e=Zc(s,"step","movingAverage");d=vd(d,zd(c,Bd(o,e)))}return bd(i,d)}});const Wy=Jc({scatterND_:function(e,t,n){sa(n);const s=Zc(e,"indices","scatterND","int32"),r=Zc(t,"updates","scatterND");_y(r,s,n);const i={indices:s,updates:r},a={shape:n};return Wc.runKernel(Bl,i,a)}});const Gy=Jc({sparseToDense_:function(e,t,n,s=0){sa(n);const r=Zc(e,"sparseIndices","sparseToDense","int32"),i=Zc(t,"sparseValues","sparseToDense","string_or_numeric"),a=Zc(s,"defaultValue","sparseToDense",i.dtype);!function(e,t,n,s){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const r=e.rank>0?e.shape[0]:1,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const a=t.size;if(0!==t.rank&&(1!==t.rank||a!==r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==s.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(r,i,n,a);const o={sparseIndices:r,sparseValues:i,defaultValue:a},l={outputShape:n};return Wc.runKernel(nu,o,l)}});const Uy=Jc({gatherND_:function(e,t){const n=Zc(t,"indices","gatherND","int32"),s={params:Zc(e,"x","gatherND","string_or_numeric"),indices:n};return Wc.runKernel(Io,s)}});const qy=Jc({dropout_:function(e,t,n,s){const r=Zc(e,"x","dropout");if(Ni("float32"===r.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`)),Ni(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof vc?r.clone():r;const i=function(e,t){if(null==t)return e.shape.slice();if(Mi(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let s=0;s1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${s.rank}`)),Ni(s.rank-1===r.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${s.rank} and targets rank ${r.rank}`)),Oi(s.shape.slice(0,s.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const i=s.shape[s.shape.length-1];Ni(n>0&&n<=i,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${i}), but got ${n}`));const a=await s.data(),o=await r.data(),[l,u]=[a.length/i,i],c=Gi("bool",l);for(let e=0;et.value-e.value)),c[e]=0;for(let t=0;t`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`)),Ni(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),Ni(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const u="NHWC"===i?o.shape[3]:o.shape[1],c="NHWC"===i?l.shape[3]:l.shape[1];Ni(u===n[2],(()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`)),Ni(c===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${n[3]}).`)),ff("conv2dDerFilter",r,a);const h={x:o,dy:l},d={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,filterShape:n};return Wc.runKernel(ja,h,d)}});function Xy(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Ad(e,yy(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Zy(e,t){let n=t;const s=Wd(e.shape,t.shape);return s.length>0&&(n=wm(n,s)),mf(n,e.shape)}function Yy(e,t,n,s){if("linear"===t)return e;if("relu"===t)return Ug(e);if("elu"===t)return am(e);if("relu6"===t)return qg(e);if("prelu"===t)return Sg(e,n);if("leakyrelu"===t)return Bm(e,s);if("sigmoid"===t)return vf(e);throw new Error(`Unknown fused activation ${t}.`)}const Qy=(e,t)=>!(e>0)||"linear"===t;const Jy=Jc({fusedConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(l=l||"linear",!1===Qy(Wc.state.gradientDepth,l)){Ni("NHWC"===r,(()=>`Error in fused conv2d: got dataFormat of ${r} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`));let h=Pf(e,t,n,s,r,i,a);return null!=o&&(h=bd(h,o)),Yy(h,l,u,c)}const h=Zc(e,"x","conv2d","float32"),d=Zc(t,"filter","conv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=mf(h,[1,h.shape[0],h.shape[1],h.shape[2]])),Ni(4===p.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`)),Ni(4===d.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`)),ff("fused conv2d",s,a);const m="NHWC"===r?p.shape[3]:p.shape[1];Ni(d.shape[2]===m,(()=>`Error in conv2d: depth of input (${m}) must match input depth for filter ${d.shape[2]}.`)),Ni(hf(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`));const g=nf(p.shape,d.shape,n,i,s,a);let y,b;if(null!=o&&(y=Zc(o,"bias","fused conv2d"),[y]=Dc(y,h),"NHWC"===r?Gd(g.outShape,y.shape):(Ni(y.shape.length<=1,(()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${y.shape.length}.`)),Ni(0===y.shape.length||y.shape[0]===g.outChannels||1===y.shape[0],(()=>`Error in fused conv2d: bias shape (${y.shape}) is not compatible with the number of output channels (${g.outChannels})`)))),null!=u){const e=u.shape;if(Ni(e.length<=1||3===e.length,(()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${e.length}.`)),1===e.length)Ni(1===e[0]||e[0]===g.outChannels,(()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${g.outChannels}).`));else if(3===e.length)try{Gd(e,g.outShape)}catch(t){const n=`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(n)}b=Zc(u,"prelu weights","fused conv2d")}const w=(e,t)=>{Ni("NHWC"===r,(()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`));const[a,o,u,c]=t,h=Xy(e,u,l);Ni(cf(i),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const d=[Wf(o.shape,h,a,n,s),Ky(o,h,a.shape,n,s)];if(null!=c){const e=Zy(c,h);d.push(e)}return d},v={x:p,filter:d,bias:y,preluActivationWeights:b},A={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:c};if(null==o){const e=Sd(((e,t,n)=>{let s=Wc.runKernel(Su,v,A);return n([t,e,s]),f&&(s=mf(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:w}}));return e(p,d)}{const e=Sd(((e,t,n,s)=>{let r=Wc.runKernel(Su,v,A);return s([t,e,r,n]),f&&(r=mf(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}}));return e(p,d,y)}}});const eb=Jc({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,s,r,i=[1,1],a){let o=e;3===e.rank&&(o=mf(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=mf(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={x:o,dy:l},c={strides:s,pad:r,dimRoundingMode:a,dilations:i,filterShape:n};return Wc.runKernel(ro,u,c)}});const tb=Jc({depthwiseConv2dNativeBackpropInput_:function(e,t,n,s,r,i=[1,1],a){let o=t,l=!1;3===t.rank&&(l=!0,o=mf(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={dy:o,filter:n},c={strides:s,pad:r,dimRoundingMode:a,dilations:i,inputShape:e},h=Wc.runKernel(io,u,c);return l?mf(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const nb=Jc({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(!1===Qy(Wc.state.gradientDepth,l)){let h=Qf(e,t,n,s,r,i,a);return null!=o&&(h=bd(h,o)),Yy(h,l,u,c)}const h=Zc(e,"x","depthwiseConv2d","float32"),d=Zc(t,"filter","depthwiseConv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=mf(h,[1,h.shape[0],h.shape[1],h.shape[2]])),Ni(4===p.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`)),Ni(4===d.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`)),Ni(p.shape[3]===d.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${p.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`)),null==i&&(i=[1,1]),Ni(hf(n,i),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),ff("fused depthwiseConv2d",s,a);const m=nf(p.shape,d.shape,n,i,s,a,!0);let g,y;null!=o&&(g=Zc(o,"bias","fused conv2d"),[g]=Dc(g,h),Gd(m.outShape,g.shape)),null!=u&&(y=Zc(u,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>{Ni(cf(i),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`));const[r,o,u,c]=t,h=Xy(e,u,l),d=tb(o.shape,h,r,n,s,i,a),p=eb(o,h,r.shape,n,s,i,a);if(null!=c){return[d,p,Zy(g,h)]}return[d,p]},w={x:p,filter:d,bias:g,preluActivationWeights:y},v={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:c};if(null==o){const e=Sd(((e,t,n)=>{let s=Wc.runKernel(_u,w,v);return n([t,e,s]),f&&(s=mf(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:b}}));return e(p,d)}{const e=Sd(((e,t,n,s)=>{let r=Wc.runKernel(_u,w,v);return s([t,e,r,n]),f&&(r=mf(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}}));return e(p,d,g)}}});const sb=Jc({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:s=!1,bias:r,activation:i="linear",preluActivationWeights:a,leakyreluAlpha:o=.2}){if(!1===Qy(Wc.state.gradientDepth,i)){let l=wf(e,t,n,s);return null!=r&&(l=bd(l,r)),Yy(l,i,a,o)}let l=Zc(e,"a","fused matMul"),u=Zc(t,"b","fused matMul");[l,u]=Dc(l,u);const c=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=s?u.shape[u.rank-1]:u.shape[u.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=s?u.shape[u.rank-2]:u.shape[u.rank-1],f=l.shape.slice(0,-2),m=u.shape.slice(0,-2),g=Di(f),y=Di(m);Ni(c===h,(()=>`Error in fused matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${s} must match.`));const b=Gd(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([d,p]),w=mf(l,n?[g,c,d]:[g,d,c]),v=mf(u,s?[y,p,h]:[y,h,p]);let A,x;null!=r&&(A=Zc(r,"bias","fused matMul"),[A]=Dc(A,l),Gd(b,A.shape)),null!=a&&(x=Zc(a,"prelu weights","fused matMul"));const C=(e,t)=>{const[a,o,l,u]=t,c=Xy(mf(e,l.shape),l,i);let h,d;if(n||s?!n&&s?(h=wf(c,o,!1,!1),d=wf(c,a,!0,!1)):n&&!s?(h=wf(o,c,!1,!0),d=wf(a,c,!1,!1)):(h=wf(o,c,!0,!0),d=wf(c,a,!0,!0)):(h=wf(c,o,!1,!0),d=wf(a,c,!0,!1)),null!=r){return[h,d,Zy(u,c)]}return[h,d]},k={a:w,b:v,bias:A,preluActivationWeights:x},S={transposeA:n,transposeB:s,activation:i,leakyreluAlpha:o};if(null==r){const e=Sd(((e,t,n)=>{const s=Wc.runKernel(ku,k,S);return n([e,t,s]),{value:mf(s,b),gradFunc:C}}));return e(w,v)}{const e=Sd(((e,t,n,s)=>{const r=Wc.runKernel(ku,k,S);return s([e,t,r,n]),{value:mf(r,b),gradFunc:C}}));return e(w,v,A)}}});const rb=Jc({hammingWindow_:function(e){return Hy(e,.54,.46)}});const ib=Jc({hannWindow_:function(e){return Hy(e,.5,.5)}});const ab=Jc({frame_:function(e,t,n,s=!1,r=0){let i=0;const a=[];for(;i+t<=e.size;)a.push(Af(e,i,t)),i+=n;if(s)for(;i`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`)),Ni(2===o.rank&&4===o.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${o.shape}.`)),Ni(1===l.rank&&l.shape[0]===u,(()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${o.shape}.`)),Ni(2===s.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${s.length}.`)),Ni(s[0]>=1&&s[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${s}`)),Ni("bilinear"===r||"nearest"===r,(()=>`method must be bilinear or nearest, but was ${r}`));const c={image:a,boxes:o,boxInd:l},h={method:r,extrapolationValue:i,cropSize:s};return Wc.runKernel(eo,c,h)}});const ub=Jc({flipLeftRight_:function(e){const t=Zc(e,"image","flipLeftRight","float32");Ni(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return Wc.runKernel(Co,n,{})}});const cb=Jc({grayscaleToRGB_:function(e){const t=Zc(e,"image","grayscaleToRGB"),n=t.rank-1,s=t.shape[n];Ni(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),Ni(1===s,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${s}.`));const r=new Array(t.rank);return r.fill(1,0,n),r[n]=3,_m(t,r)}});const hb=Jc({rgbToGrayscale_:function(e){const t=Zc(e,"image","RGBToGrayscale"),n=t.rank-1,s=t.shape[n];Ni(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),Ni(3===s,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${s}.`));const r=t.dtype,i=md(t,"float32"),a=vy([.2989,.587,.114]);let o;switch(t.rank){case 2:o=im("ij,j->i",i,a);break;case 3:o=im("ijk,k->ij",i,a);break;case 4:o=im("ijkl,l->ijk",i,a);break;case 5:o=im("ijklm,m->ijkl",i,a);break;case 6:o=im("ijklmn,n->ijklm",i,a);break;default:throw new Error("Not a valid tensor rank.")}return o=km(o,-1),md(o,r)}});const db=Jc({rotateWithOffset_:function(e,t,n=0,s=.5){const r=Zc(e,"image","rotateWithOffset","float32");Ni(4===r.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`));const i={image:r},a={radians:t,fillValue:n,center:s};return Wc.runKernel(Cu,i,a)}});function pb(e,t,n,s,r,i){null==s&&(s=.5),null==r&&(r=Number.NEGATIVE_INFINITY),null==i&&(i=0);const a=e.shape[0];return n=Math.min(n,a),Ni(0<=s&&s<=1,(()=>`iouThreshold must be in [0, 1], but was '${s}'`)),Ni(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),Ni(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),Ni(1===t.rank,(()=>"scores must be a 1D tensor")),Ni(t.shape[0]===a,(()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`)),Ni(0<=i&&i<=1,(()=>`softNmsSigma must be in [0, 1], but was '${i}'`)),{maxOutputSize:n,iouThreshold:s,scoreThreshold:r,softNmsSigma:i}}const fb=Jc({nonMaxSuppression_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=Zc(e,"boxes","nonMaxSuppression","float32"),a=Zc(t,"scores","nonMaxSuppression","float32"),o=pb(i,a,n,s,r),l={maxOutputSize:n=o.maxOutputSize,iouThreshold:s=o.iouThreshold,scoreThreshold:r=o.scoreThreshold};return Wc.runKernel(cl,{boxes:i,scores:a},l)}});function mb(e,t,n){const s=function(e,t,n){return function(e,t,n){let s=0,r=e.length,i=0,a=!1;for(;s>>1);const o=n(t,e[i]);o>0?s=i+1:(r=i,a=!o)}return a?s:-s-1}(e,t,n||gb)}(e,t,n),r=s<0?-(s+1):s;e.splice(r,0,t)}function gb(e,t){return e>t?1:er&&u.push({score:t[e],boxIndex:e,suppressBeginIndex:0});u.sort(Cb);const c=i>0?-.5/i:0,h=[],d=[];for(;h.length0;){const t=u.pop(),{score:n,boxIndex:i,suppressBeginIndex:a}=t;if(n=a;--n){const a=Ab(e,i,h[n]);if(a>=s){o=!0;break}if(t.score=t.score*xb(s,c,a),t.score<=r)break}t.suppressBeginIndex=h.length,o||(t.score===n?(h.push(i),d.push(t.score)):t.score>r&&mb(u,t,Cb))}const p=h.length,f=n-p;o&&f>0&&(h.push(...new Array(f).fill(0)),d.push(...new Array(f).fill(0)));const m={selectedIndices:h};return a&&(m.selectedScores=d),l&&(m.validOutputs=p),m}function Ab(e,t,n){const s=e.subarray(4*t,4*t+4),r=e.subarray(4*n,4*n+4),i=Math.min(s[0],s[2]),a=Math.min(s[1],s[3]),o=Math.max(s[0],s[2]),l=Math.max(s[1],s[3]),u=Math.min(r[0],r[2]),c=Math.min(r[1],r[3]),h=Math.max(r[0],r[2]),d=Math.max(r[1],r[3]),p=(o-i)*(l-a),f=(h-u)*(d-c);if(p<=0||f<=0)return 0;const m=Math.max(i,u),g=Math.max(a,c),y=Math.min(o,h),b=Math.min(l,d),w=Math.max(y-m,0)*Math.max(b-g,0);return w/(p+f-w)}function xb(e,t,n){const s=Math.exp(t*n*n);return n<=e?s:0}function Cb(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const kb=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=Zc(e,"boxes","nonMaxSuppressionAsync"),a=Zc(t,"scores","nonMaxSuppressionAsync"),o=pb(i,a,n,s,r);n=o.maxOutputSize,s=o.iouThreshold,r=o.scoreThreshold;const l=await Promise.all([i.data(),a.data()]),u=l[0],c=l[1],{selectedIndices:h}=yb(u,c,n,s,r);return i!==e&&i.dispose(),a!==t&&a.dispose(),vy(h,"int32")};const Sb=Jc({nonMaxSuppressionWithScore_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=Zc(e,"boxes","nonMaxSuppression"),o=Zc(t,"scores","nonMaxSuppression"),l=pb(a,o,n,s,r,i),u={boxes:a,scores:o},c={maxOutputSize:n=l.maxOutputSize,iouThreshold:s=l.iouThreshold,scoreThreshold:r=l.scoreThreshold,softNmsSigma:i=l.softNmsSigma},h=Wc.runKernel(dl,u,c);return{selectedIndices:h[0],selectedScores:h[1]}}});const _b=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=Zc(e,"boxes","nonMaxSuppressionAsync"),o=Zc(t,"scores","nonMaxSuppressionAsync"),l=pb(a,o,n,s,r,i);n=l.maxOutputSize,s=l.iouThreshold,r=l.scoreThreshold,i=l.softNmsSigma;const u=await Promise.all([a.data(),o.data()]),c=u[0],h=u[1],{selectedIndices:d,selectedScores:p}=wb(c,h,n,s,r,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:vy(d,"int32"),selectedScores:vy(p)}};const Eb=Jc({nonMaxSuppressionPadded_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=Zc(e,"boxes","nonMaxSuppression"),o=Zc(t,"scores","nonMaxSuppression"),l=pb(a,o,n,s,r,null),u={boxes:a,scores:o},c={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:i},h=Wc.runKernel(hl,u,c);return{selectedIndices:h[0],validOutputs:h[1]}}});const Ib=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=Zc(e,"boxes","nonMaxSuppressionAsync"),o=Zc(t,"scores","nonMaxSuppressionAsync"),l=pb(a,o,n,s,r,null),u=l.maxOutputSize,c=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([a.data(),o.data()]),{selectedIndices:f,validOutputs:m}=bb(d,p,u,c,h,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:vy(f,"int32"),validOutputs:_d(m,"int32")}};const Tb=Jc({resizeBilinear_:function(e,t,n=!1,s=!1){const r=Zc(e,"images","resizeBilinear");Ni(3===r.rank||4===r.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`)),Ni(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),Ni(!1===s||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=mf(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},u=Wc.runKernel(Nl,o,l);return a?mf(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const Nb=Jc({resizeNearestNeighbor_:function(e,t,n=!1,s=!1){const r=Zc(e,"images","resizeNearestNeighbor");Ni(3===r.rank||4===r.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`)),Ni(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),Ni("float32"===r.dtype||"int32"===r.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),Ni(!1===s||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=mf(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},u=Wc.runKernel(Il,o,l);return a?mf(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const Ob=Jc({threshold_:function(e,t="binary",n=!1,s=.5){const r=Zc(e,"image","threshold"),i=r.shape[0]*r.shape[1];let a,o,l,u,c=Ad(vy([s]),255);if(Ni(3===r.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`)),Ni(3===r.shape[2]||1===r.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`)),Ni("int32"===r.dtype||"float32"===r.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`)),Ni("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===r.shape[2]){[a,o,l]=dy(r,[1,1,1],-1);const e=Ad(a,.2989),t=Ad(o,.587),n=Ad(l,.114);u=bd(bd(e,t),n)}else u=e;if("otsu"===t){c=function(e,t){let n,s,r,i,a,o,l=vy([-1]),u=vy([0]),c=vy([0]);for(let h=0;h`Error in transform: image must be rank 4,but got rank ${a.rank}.`)),Ni(2===o.rank&&(o.shape[0]===a.shape[0]||1===o.shape[0])&&8===o.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),Ni(null==i||2===i.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`));const l={image:a,transforms:o},u={interpolation:n,fillMode:s,fillValue:r,outputShape:i};return Wc.runKernel(mu,l,u)}});const Db=Jc({bandPart_:function(e,t,n){const s=Zc(e,"a","bandPart");Ni(s.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${s.rank}.`));const r=s.shape,[i,a]=s.shape.slice(-2);let o,l;"number"==typeof t?(Ni(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),Ni(t<=i,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${i}).`)),o=Zc(t<0?i:t,"numLower","bandPart")):(Ni("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),o=nm(zm(t,0),i,lg(t,i))),"number"==typeof n?(Ni(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),Ni(n<=a,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${a}).`)),l=Zc(n<0?a:n,"numUpper","bandPart")):(Ni("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),l=nm(zm(n,0),a,lg(n,a)));const u=mf(Vg(0,i,1,"int32"),[-1,1]),c=Vg(0,a,1,"int32"),h=zd(u,c),d=Km(Lm(h,o),Om(h,Um(l))),p=ig([i,a],s.dtype);return mf(gy(Dy(mf(s,[-1,i,a])).map((e=>nm(d,e,p)))),r)}});const Mb=Jc({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,Ni(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const n=e[0].shape[0];for(let t=1;t`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`))}else t=!0,e=dy(e,e.shape[0],0).map((e=>my(e,[0])));Ni(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const n=[],s=e;for(let t=0;t{let e=s[t];if(t>0)for(let s=0;s{Ni(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const n=e.shape[0],s=e.shape[1];let r=Em(n),i=gd(e);const a=Ay([[1]],[1,1]);let o=gd(a);const l=n>=s?s:n;for(let e=0;e{const t=Af(i,[e,e],[n-e,1]),l=Am(t),u=Af(i,[e,e],[1,1]),c=nm(Nm(u,0),Ay([[-1]]),Ay([[1]])),h=zd(u,Ad(c,l)),d=vd(t,h);o=1===d.shape[0]?gd(a):bf([a,Af(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const p=Um(vd(wf(c,h),l)),f=Af(i,[e,0],[n-e,s]),m=Ad(p,o),g=Py(o);if(0===e)i=zd(f,wf(m,wf(g,f)));else{const t=zd(f,wf(m,wf(g,f)));i=bf([Af(i,[0,0],[e,s]),t],0)}const y=Py(m),b=Af(r,[0,e],[n,r.shape[1]-e]);if(0===e)r=zd(b,wf(wf(b,o),y));else{const t=zd(b,wf(wf(b,o),y));r=bf([Af(r,[0,0],[n,e]),t],1)}return[o,i,r]})),lh([t,l,u])}return!t&&n>s&&(r=Af(r,[0,0],[n,s]),i=Af(i,[0,0],[s,s])),[r,i]}))}const Bb=Jc({qr_:function(e,t=!1){if(Ni(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return Fb(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),s=Dy(mf(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],i=[];s.forEach((e=>{const[n,s]=Fb(e,t);r.push(n),i.push(s)}));return[mf(gy(r,0),e.shape),mf(gy(i,0),e.shape)]}}});var zb;!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(zb||(zb={}));const Lb=Jc({computeWeightedLoss_:function(e,t,n=zb.SUM_BY_NONZERO_WEIGHTS){const s=Zc(e,"losses","computeWeightedLoss");let r=null;null!=t&&(r=Zc(t,"weights","computeWeightedLoss"));const i=null==r?s:Ad(s,r);if(n===zb.NONE)return i;if(n===zb.SUM)return wm(i);if(n===zb.MEAN){if(null==r)return rg(i);{const e=s.size/r.size,t=vd(wm(i),wm(r));return e>1?vd(t,_d(e)):t}}if(n===zb.SUM_BY_NONZERO_WEIGHTS){if(null==r)return vd(wm(i),_d(s.size));{const e=Ad(r,ag(s.shape)),t=md(wm(fg(e,_d(0))),"float32");return vd(wm(i),t)}}throw Error(`Unknown reduction: ${n}`)}});const Pb=Jc({absoluteDifference_:function(e,t,n,s=zb.SUM_BY_NONZERO_WEIGHTS){const r=Zc(e,"labels","absoluteDifference"),i=Zc(t,"predictions","absoluteDifference");let a=null;null!=n&&(a=Zc(n,"weights","absoluteDifference")),Oi(r.shape,i.shape,"Error in absoluteDifference: ");const o=Pd(zd(r,i));return Lb(o,a,s)}});const Vb=Jc({cosineDistance_:function(e,t,n,s,r=zb.SUM_BY_NONZERO_WEIGHTS){const i=Zc(e,"labels","cosineDistance"),a=Zc(t,"predictions","cosineDistance");let o=null;null!=s&&(o=Zc(s,"weights","cosineDistance")),Oi(i.shape,a.shape,"Error in cosineDistance: ");const l=_d(1),u=zd(l,wm(Ad(i,a),n,!0));return Lb(u,o,r)}});const Wb=Jc({hingeLoss_:function(e,t,n,s=zb.SUM_BY_NONZERO_WEIGHTS){let r=Zc(e,"labels","hingeLoss");const i=Zc(t,"predictions","hingeLoss");let a=null;null!=n&&(a=Zc(n,"weights","hingeLoss")),Oi(r.shape,i.shape,"Error in hingeLoss: ");const o=_d(1);r=zd(Ad(_d(2),r),o);const l=Ug(zd(o,Ad(r,i)));return Lb(l,a,s)}});const Gb=Jc({huberLoss_:function(e,t,n,s=1,r=zb.SUM_BY_NONZERO_WEIGHTS){const i=Zc(e,"labels","huberLoss"),a=Zc(t,"predictions","huberLoss");let o=null;null!=n&&(o=Zc(n,"weights","huberLoss")),Oi(i.shape,a.shape,"Error in huberLoss: ");const l=_d(s),u=Pd(zd(a,i)),c=lg(u,l),h=zd(u,c),d=bd(Ad(_d(.5),Cd(c)),Ad(l,h));return Lb(d,o,r)}});const Ub=Jc({logLoss_:function(e,t,n,s=1e-7,r=zb.SUM_BY_NONZERO_WEIGHTS){const i=Zc(e,"labels","logLoss"),a=Zc(t,"predictions","logLoss");let o=null;null!=n&&(o=Zc(n,"weights","logLoss")),Oi(i.shape,a.shape,"Error in logLoss: ");const l=_d(1),u=_d(s),c=Um(Ad(i,Wm(bd(a,u)))),h=Ad(zd(l,i),Wm(bd(zd(l,a),u))),d=zd(c,h);return Lb(d,o,r)}});const qb=Jc({meanSquaredError_:function(e,t,n,s=zb.SUM_BY_NONZERO_WEIGHTS){const r=Zc(e,"labels","meanSquaredError"),i=Zc(t,"predictions","meanSquaredError");let a=null;null!=n&&(a=Zc(n,"weights","meanSquaredError")),Oi(r.shape,i.shape,"Error in meanSquaredError: ");const o=fy(r,i);return Lb(o,a,s)}});const jb=Jc({sigmoidCrossEntropy_:function(e,t,n,s=0,r=zb.SUM_BY_NONZERO_WEIGHTS){let i=Zc(e,"multiClassLabels","sigmoidCrossEntropy");const a=Zc(t,"logits","sigmoidCrossEntropy");let o=null;if(null!=n&&(o=Zc(n,"weights","sigmoidCrossEntropy")),Oi(i.shape,a.shape,"Error in sigmoidCrossEntropy: "),s>0){const e=_d(s),t=_d(1),n=_d(.5);i=bd(Ad(i,zd(t,e)),Ad(n,e))}const l=function(e,t){const n=Zc(e,"labels","sigmoidCrossEntropyWithLogits"),s=Zc(t,"logits","sigmoidCrossEntropyWithLogits");Oi(n.shape,s.shape,"Error in sigmoidCrossEntropyWithLogits: ");const r=Ug(s),i=Ad(s,n),a=Gm(Cm(Um(Pd(s))));return bd(zd(r,i),a)}(i,a);return Lb(l,o,r)}});const Hb=Jc({softmaxCrossEntropy_:function(e,t,n,s=0,r=zb.SUM_BY_NONZERO_WEIGHTS){let i=Zc(e,"onehotLabels","softmaxCrossEntropy");const a=Zc(t,"logits","softmaxCrossEntropy");let o=null;if(null!=n&&(o=Zc(n,"weights","softmaxCrossEntropy")),Oi(i.shape,a.shape,"Error in softmaxCrossEntropy: "),s>0){const e=_d(s),t=_d(1),n=_d(i.shape[1]);i=bd(Ad(i,zd(t,e)),vd(e,n))}const l=function(e,t,n=-1){if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);const s=Sd(((e,t,s)=>{const r=$m(t,[n],!0),i=zd(md(t,"float32"),r);s([e,i]);const a=Um(Ad(i,e));return{value:wm(a,[n]),gradFunc:(e,t)=>{const[s,r]=t,i=dm(e.shape,[n]);return[Ad(mf(e,i),zd(md(s,"float32"),Cm(r))),Ad(mf(e,i),zd(Cm(r),md(s,"float32")))]}}}));return s(e,t)}(i,a);return Lb(l,o,r)}});const $b=Jc({sparseFillEmptyRows_:function(e,t,n,s){const r=Zc(e,"indices","sparseFillEmptyRows","int32"),i=Zc(t,"values","sparseFillEmptyRows"),a=Zc(n,"denseShape","sparseFillEmptyRows","int32"),o=Zc(s,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==r.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==a.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(0!==o.rank)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);const l={indices:r,values:i,denseShape:a,defaultValue:o},u=Wc.runKernel(Ql,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}});const Kb=Jc({sparseReshape_:function(e,t,n){const s=Zc(e,"inputIndices","sparseReshape","int32"),r=Zc(t,"inputShape","sparseReshape","int32"),i=Zc(n,"newShape","sparseReshape","int32");if(2!==s.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${s.shape}`);if(1!==r.rank)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(1!==i.rank)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const a={inputIndices:s,inputShape:r,newShape:i},o=Wc.runKernel(Jl,a);return{outputIndices:o[0],outputShape:o[1]}}});const Xb=Jc({sparseSegmentMean_:function(e,t,n){const s=Zc(e,"data","sparseSegmentMean"),r=Zc(t,"indices","sparseSegmentMean","int32"),i=Zc(n,"segmentIds","sparseSegmentMean","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return Wc.runKernel(eu,a)}});const Zb=Jc({sparseSegmentSum_:function(e,t,n){const s=Zc(e,"data","sparseSegmentSum"),r=Zc(t,"indices","sparseSegmentSum","int32"),i=Zc(n,"segmentIds","sparseSegmentSum","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return Wc.runKernel(tu,a)}});const Yb=Jc({stringNGrams_:function(e,t,n,s,r,i,a,o){const l=Zc(e,"data","stringNGrams","string");if("string"!==l.dtype)throw new Error("Data must be of datatype string");if(1!==l.shape.length)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=Zc(t,"dataSplits","stringNGrams");if("int32"!==u.dtype)throw new Error("Data splits must be of datatype int32");const c={separator:n,nGramWidths:s,leftPad:r,rightPad:i,padWidth:a,preserveShortSequences:o},h={data:l,dataSplits:u},d=Wc.runKernel(ou,h,c);return{nGrams:d[0],nGramsSplits:d[1]}}});const Qb=Jc({stringSplit_:function(e,t,n=!0){const s=Zc(e,"input","stringSplit","string"),r=Zc(t,"delimiter","stringSplit","string");if(1!==s.rank)throw new Error(`Input should be Tensor1D but received shape ${s.shape}`);if(0!==r.rank)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);const i={skipEmpty:n},a={input:s,delimiter:r},o=Wc.runKernel(lu,a,i);return{indices:o[0],values:o[1],shape:o[2]}}});const Jb=Jc({stringToHashBucketFast_:function(e,t){const n=Zc(e,"input","stringToHashBucketFast","string"),s={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const r={input:n};return Wc.runKernel(uu,r,s)}});const ew=Jc({staticRegexReplace_:function(e,t,n,s=!0){const r=Zc(e,"input","staticRegexReplace","string"),i={pattern:t,rewrite:n,replaceGlobal:s};return Wc.runKernel(iu,{x:r},i)}}),tw={fft:uy,ifft:cy,rfft:py,irfft:hy},nw={hammingWindow:rb,hannWindow:ib,frame:ab,stft:ob},sw={flipLeftRight:ub,grayscaleToRGB:cb,resizeNearestNeighbor:Nb,resizeBilinear:Tb,rgbToGrayscale:hb,rotateWithOffset:db,cropAndResize:lb,nonMaxSuppression:fb,nonMaxSuppressionAsync:kb,nonMaxSuppressionWithScore:Sb,nonMaxSuppressionWithScoreAsync:_b,nonMaxSuppressionPadded:Eb,nonMaxSuppressionPaddedAsync:Ib,threshold:Ob,transform:Rb},rw={bandPart:Db,gramSchmidt:Mb,qr:Bb},iw={absoluteDifference:Pb,computeWeightedLoss:Lb,cosineDistance:Vb,hingeLoss:Wb,huberLoss:Gb,logLoss:Ub,meanSquaredError:qb,sigmoidCrossEntropy:jb,softmaxCrossEntropy:Hb},aw={sparseFillEmptyRows:$b,sparseReshape:Kb,sparseSegmentMean:Xb,sparseSegmentSum:Zb},ow={stringNGrams:Yb,stringSplit:Qb,stringToHashBucketFast:Jb,staticRegexReplace:ew};const lw=class{static sgd(e){return new jd(e)}static momentum(e,t,n=!1){return new Hd(e,t,n)}static rmsprop(e,t=.9,n=0,s=null,r=!1){return new $d(e,t,n,s,r)}static adam(e=.001,t=.9,n=.999,s=null){return new Ld(e,t,n,s)}static adadelta(e=.001,t=.95,n=null){return new Dd(e,t,n)}static adamax(e=.002,t=.9,n=.999,s=null,r=0){return new qd(e,t,n,s,r)}static adagrad(e,t=.1){return new Fd(e,t)}},uw="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function cw(){return new Promise((e=>uw((()=>e()))))}function hw(e,t){const n=e[0].length;e.forEach(((e,t)=>{Ni(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),Ni(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const s=e[0];e.forEach(((e,r)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${r}] (${e}) does not match the shape of the rest (${s}) along the non-concatenated axis ${r}.`))}))}function dw(e,t){const n=e[0].slice();for(let s=1;s=0)if(o>=0){if(o!==i)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${i} but shape[${r+e}] = ${o}`)}else s[a]=i}return s}function mw(e){const t={FIRST_DIM_SIZE:pw.FIRST_DIM_SIZE,VALUE_ROWIDS:pw.VALUE_ROWIDS,ROW_LENGTHS:pw.ROW_LENGTHS,ROW_SPLITS:pw.ROW_SPLITS,ROW_LIMITS:pw.ROW_LIMITS,ROW_STARTS:pw.ROW_STARTS},n=[];for(const s of e){if(!(s in t))break;n.push(t[s])}return n}function gw(e){return 0===e.length?0:e[0]===pw.FIRST_DIM_SIZE?e.length-1:e.length}function yw(e,t){if(null==e||null==t)return;const n=e.length,s=t.length;if(n>=s)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${s})`);for(let r=0;r=0&&s>=0&&1!==n&&n!==s)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${r-e.length}] = ${n} but ragged tensor input.flatValues.shape[${r-e.length}] = ${s}`)}}!function(e){e[e.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",e[e.VALUE_ROWIDS=1]="VALUE_ROWIDS",e[e.ROW_LENGTHS=2]="ROW_LENGTHS",e[e.ROW_SPLITS=3]="ROW_SPLITS",e[e.ROW_LIMITS=4]="ROW_LIMITS",e[e.ROW_STARTS=5]="ROW_STARTS"}(pw||(pw={}));const bw=30;function ww(e){return e<=bw?e:Zi(e,Math.floor(Math.sqrt(e)))}function vw(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function Aw(e,t,n,s=!0){let r=[];if(s)r=r.concat(t.slice(0)),r.push(e[0]/n),r=r.concat(e.slice(1));else{r=r.concat(e[0]);const n=t.length;for(let s=0;s=2*t+1||s%2==1?r.push(s):n.push(s);s.push(...n),s.push(0),s.push(...r)}return s}function Cw(e,t,n,s=!0){const r=[];s?r.push(e[0]/n):r.push(e[0]*n);for(let n=1;nn)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[s-1]} vs. ${n}`);if(0===Di(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const r=t.shape,i=r[r.length-1];let a=1;for(let e=0;ee/u)),1].slice(0,i);return[l,a,u,c]}const Ew=1.7580993408473768,Iw=1.0507009873554805,Tw=.3275911,Nw=.254829592,Ow=-.284496736,Rw=1.421413741,Dw=-1.453152027,Mw=1.061405429;function Fw(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let s=0;s/g,jw=",",Hw="...";function $w(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(qw,"").length)/Uw.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${Uw}").`);const[s,r]=e.split(Uw);Ni(-1===s.indexOf(Hw),(()=>`The ellipsis notation ("${Hw}") is not supported yet.`));const i=s.split(jw),a=i.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const o=[];for(let e=0;e-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===o.indexOf(t)&&o.push(t)}for(let e=0;e-1!==e)),{permutationIndices:n,expandDims:s}}function Xw(e,t,n){const s=new Array(e);for(let e=0;e`Expected dimension ${s[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(r)}, but got dimension ${r[n]}`))}}function Zw(e,t){const n=e,s=[];let r=0;0===e.length&&n.push(-1),r=e.length+1;for(let e=0;ee===t))}function Qw(e,t){const n=[];for(let s=0;s"Number of splits must evenly divide the axis.")),s=new Array(t).fill(e.shape[n]/t);else{const r=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);Ni(r<=1,(()=>"There should be only one negative value in split array."));const i=t.indexOf(-1);if(-1!==i){const s=t.reduce(((e,t)=>t>0?e+t:e));t[i]=e.shape[n]-s}Ni(e.shape[n]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),s=t}return s}function ev(e){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${e}`}function tv(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function nv(e,t,n){return`indices(${e}, 0) is invalid: ${t} >= ${n}`}function sv(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function rv(e,t){return`size ${e} must be non-negative, not ${t}`}function iv(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function av(e,t){return`Input to reshape is a SparseTensor with ${Di(e)}\n dense values, but the requested shape requires a multiple of ${Di(t)}. inputShape=${e} outputShape= ${t}`}function ov(e,t){return`Input to reshape is a tensor with ${Di(e)} dense values, but the requested shape has ${Di(t)}. inputShape=${e} outputShape=${t}`}function lv(){return"segment ids must be >= 0"}function uv(){return"segment ids are not increasing"}function cv(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function hv(e,t,n){return`Bad: indices[${e}] == ${t} out of range [0, ${n})`}function dv(e,t){let n,s=!1;for(e<=bw?(n=e,s=!0):n=Zi(e,Math.floor(Math.sqrt(e)));!s;)n>t||n===e?s=!0:n=Zi(e,n+1);return n}function pv(e,t,n){const s=[],r=e.length;for(let i=0;ir))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${s}`);if(s<0&&(s+=r),s>i)throw new Error(`batchDims (${s}) must be less than rank(x) (\n ${i}).`);if(nnc(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function gv(e){return e.map((e=>tc(e)))}!function(){for(const e of Kd)Od(e)}();const yv={kernelName:ma,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,yy(md(n,"float32"),-1))}}},bv={kernelName:ga,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Cd(md(n,"float32")),s=xd(zd(_d(1),t));return Um(vd(e,s))}}}},wv={kernelName:ya,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=xd(zd(Cd(md(n,"float32")),1));return vd(e,t)}}}},vv={kernelName:ba,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{let t=e;const s=Wd(n.shape,r);return s.length>0&&(t=wm(t,s)),mf(t,n.shape)},b:()=>{let t=e;const n=Wd(s.shape,r);return n.length>0&&(t=wm(t,n)),mf(t,s.shape)}}}},Av={kernelName:wa,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach(((t,s)=>{n[s]=()=>e.clone()})),n}},xv={kernelName:xa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>kd(n)}}},Cv={kernelName:Ca,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>kd(n)}}},kv={kernelName:ka,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,xd(zd(_d(1),Cd(md(n,"float32")))))}}},Sv={kernelName:Sa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=xd(bd(_d(1),Cd(md(n,"float32"))));return vd(e,t)}}}},_v={kernelName:Ia,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=bd(Cd(n),Cd(s));let i=Ad(e,vd(s,t));const a=Wd(n.shape,r);return a.length>0&&(i=wm(i,a)),mf(i,n.shape)},b:()=>{const t=bd(Cd(n),Cd(s));let i=Um(Ad(e,vd(n,t)));const a=Wd(s.shape,r);return a.length>0&&(i=wm(i,a)),mf(i,s.shape)}}}},Ev={kernelName:_a,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,bd(Cd(md(n,"float32")),1))}}},Iv={kernelName:Ea,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,zd(_d(1),Cd(md(n,"float32"))))}}};const Tv=Jc({avgPool3dGrad_:function(e,t,n,s,r,i){const a=Zc(e,"dy","avgPool3dGrad"),o=Zc(t,"input","avgPool3dGrad");let l=a,u=o,c=!1;4===o.rank&&(c=!0,l=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),u=mf(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),Ni(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),Ni(5===u.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`)),ff("avgPool3dGrad",r,i);const h={dy:l,input:u},d={filterSize:n,strides:s,pad:r,dimRoundingMode:i},p=Wc.runKernel(Ra,h,d);return c?mf(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),Nv={kernelName:Oa,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a,dimRoundingMode:o}=n;return{x:()=>Tv(e,s,r,i,a,o)}}};const Ov=Jc({avgPoolGrad_:function(e,t,n,s,r){const i=Zc(e,"dy","avgPoolGrad"),a=Zc(t,"input","avgPoolGrad");Ni(a.rank===i.rank,(()=>`Rank of input (${a.rank}) does not match rank of dy (${i.rank})`));let o=a,l=i,u=!1;3===a.rank&&(u=!0,o=mf(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Ni(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),Ni(4===o.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`));const c={dy:l,input:o},h={filterSize:n,strides:s,pad:r},d=Wc.runKernel(Na,c,h);return u?mf(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),Rv={kernelName:Ta,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a}=n;return{x:()=>Ov(e,s,r,i,a)}}},Dv={kernelName:Da,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[s,r]=t,{transposeA:i,transposeB:a}=n;return i||a?!i&&a?{a:()=>wf(e,r,!1,!1),b:()=>wf(e,s,!0,!1)}:i&&!a?{a:()=>wf(r,e,!1,!0),b:()=>wf(s,e,!1,!1)}:{a:()=>wf(r,e,!0,!0),b:()=>wf(e,s,!0,!0)}:{a:()=>wf(e,r,!1,!0),b:()=>wf(s,e,!0,!1)}}},Mv={kernelName:Ma,gradFunc:(e,t,n)=>{const{blockShape:s,crops:r}=n;return{x:()=>Cg(e,s,r)}}},Fv={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const s=n,r=s.inputShape,i=s.shape,a=Array.from(i);for(let e=r.length-1;e>=0;e--)if(r[e]===i[e])a[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${i}].`);const o=[];for(let e=0;e1&&o.push(e);return{x:()=>wm(e,o,!0)}}},Bv={kernelName:La,gradFunc:e=>({x:()=>e.clone()})},zv={kernelName:Pa,gradFunc:e=>({x:()=>kd(e)})},Lv={kernelName:Va,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{clipValueMin:r,clipValueMax:i}=n;return{x:()=>nm(Km(Om(s,r),Lm(s,i)),e,kd(e))}}},Pv={kernelName:Ga,inputsToSave:["x"],gradFunc:yv.gradFunc},Vv={kernelName:Ua,saveAllInputs:!0,gradFunc:(e,t,n)=>{const s=t.map((e=>e.shape)),{axis:r}=n,i=Vi(r,t[0].shape)[0],a=s.map((e=>e[i]));return dy(e,a,i).map((e=>()=>e))}},Wv={kernelName:qa,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{dilations:i,strides:a,pad:o,dataFormat:l}=n;return Ni(cf(i),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`)),{x:()=>Wf(s.shape,e,r,a,o,l),filter:()=>Ky(s,e,r.shape,a,o,l)}}},Gv={kernelName:Ha,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{strides:i,pad:a,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>Pf(e,r,i,a,o,1,l),filter:()=>Ky(e,s,r.shape,i,a,o,l)}}};const Uv=Jc({conv3DBackpropFilter_:function(e,t,n,s,r){let i=e;4===e.rank&&(i=mf(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let a=t;4===a.rank&&(a=mf(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),Ni(5===i.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${i.shape}.`)),Ni(5===a.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${a.shape}.`)),Ni(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),Ni(i.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${i.shape[4]}) must match input depth in filter (${n[3]}.`)),Ni(a.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${a.shape[4]}) must match output depth for filter (${n[4]}).`));const o={x:i,dy:a},l={strides:s,pad:r,filterShape:n};return Wc.runKernel(Ka,o,l)}}),qv={kernelName:$a,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i}=n;Ni(cf(s),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`));const[a,o]=t;return{x:()=>qf(a.shape,e,o,r,i),filter:()=>Uv(a,e,o.shape,r,i)}}},jv={kernelName:Za,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(Um(ny(md(n,"float32"))),e)}}},Hv={kernelName:Ya,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(sy(md(n,"float32")),e)}}},$v={kernelName:Ja,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r,exclusive:i,reverse:a}=n;return{x:()=>{const t=fm([r],s.rank);let n=Xf(e,r,i,!a);return null!=t&&(n=Py(n,t)),n}}}},Kv={kernelName:so,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i,dimRoundingMode:a}=n,o=null==s?[1,1]:s;Ni(cf(o),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`));const[l,u]=t;return Ni(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),Ni(4===u.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`)),Ni(l.shape[3]===u.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`)),Ni(hf(r,o),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`)),ff("depthwiseConv2d",i,a),{x:()=>tb(l.shape,e,u,r,i,o,a),filter:()=>eb(l,e,u.shape,r,i,o,a)}}},Xv={kernelName:oo,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,i={x:s,filter:r,dy:e},a={x:s,filter:r,dy:e};return{x:()=>Wc.runKernel(lo,i,n),filter:()=>Wc.runKernel(uo,a,n)}}},Zv={kernelName:fo,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,s={dy:e,y:n};return{x:()=>Wc.runKernel(mo,s)}}},Yv={kernelName:go,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Ad(Cm(Um(Cd(n))),2/Math.sqrt(Math.PI));return{x:()=>Ad(e,s)}}},Qv={kernelName:bo,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,n)}}},Jv={kernelName:wo,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>mf(e,n.shape)}}},eA={kernelName:vo,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,Cm(n))}}},tA={kernelName:ko,gradFunc:e=>({x:()=>kd(e)})},nA={kernelName:So,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=vd(e,md(s,"float32")),i=Wd(n.shape,r);return i.length>0?mf(wm(t,i),n.shape):t},b:()=>{let t=Ad(e,md(n,"float32"));const i=Wd(s.shape,r);i.length>0&&(t=mf(wm(t,i),s.shape));const a=Cd(s);return Um(vd(t,md(a,"float32")))}}}},sA={kernelName:_o,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:s}=n,[r,i,a,o]=t,l=null==o?_d(1):o,u=Wd(i.shape,r.shape),c=[];if(1===i.rank){for(let e=0;e1===i.rank?mf(Ad(Ad(e,_m(mf(p,[1,1,1,i.shape[0]]),c)),l),r.shape):mf(Ad(Ad(e,p),l),r.shape),mean:()=>{let e=Ad(Ad(p,_d(-1)),d);return 1===i.rank&&(e=wm(e,u)),mf(e,i.shape)},variance:()=>{let e=Ad(Ad(f,h),d);return 1===i.rank&&(e=wm(e,u)),mf(e,i.shape)},scale:()=>{const t=Ad(h,p);let n=Ad(e,t);return 1===i.rank&&(n=wm(n,u)),mf(n,i.shape)},offset:()=>{let t=e;return 1===i.rank&&(t=wm(t,u)),mf(t,i.shape)}}}},rA={kernelName:Eo,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[s,r]=t,{axis:i,batchDims:a}=n,o=Vi(i,s.shape)[0],l=(e,t,n)=>()=>{const s=e.shape,r=t.size,a=s.slice(0,o),l=a.length,u=s.slice(i,s.length).slice(1),c=u.length,h=iA(0,l),d=iA(l+1,l+1+c),p=aA([a,[r],u]),f=mf(n,p),m=mf(t,[r]),g=aA([[l],h,d]),y=Py(f,g);let b=Ry(y,m,e.shape[o]);const w=mm(g);return b=Py(b,w),b};if(1===a){const t=s.shape[0],n=s.split(t,0);return{x:()=>{const t=gy(n.map(((t,n)=>l(t,r.slice(n,1),e.slice(n,1))())));return t.reshape(s.shape)},indices:()=>r}}return{x:l(s,r,e),indices:()=>r}}};function iA(e,t){const n=[];for(let s=e;s{const[n,s]=t;return{a:()=>kd(n),b:()=>kd(s)}}},lA={kernelName:Oo,gradFunc:e=>({x:()=>md(e,"float32")})},uA={kernelName:Mo,gradFunc:e=>({x:()=>kd(e)})},cA={kernelName:Fo,gradFunc:e=>({x:()=>kd(e)})},hA={kernelName:Bo,gradFunc:e=>({x:()=>kd(e)})},dA={kernelName:zo,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{alpha:r}=n,i=Nm(s,0);return{x:()=>nm(i,e,Ad(e,r))}}},pA={kernelName:Go,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,bd(n,1))}}},fA={kernelName:Wo,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,md(n,"float32"))}}},mA={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;return{logits:()=>{const t=Cm(s);return zd(e,Ad(wm(e,r,!0),t))}}}};const gA=Jc({localResponseNormalizationBackprop_:function(e,t,n,s=5,r=1,i=1,a=.5){const o={x:e,y:t,dy:n},l={depthRadius:s,bias:r,alpha:i,beta:a};return Wc.runKernel($o,o,l)}}),yA={kernelName:Ho,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{depthRadius:i,bias:a,alpha:o,beta:l}=n;return{x:()=>gA(s,r,e,i,a,o,l)}}};function bA(e,t,n,s){return t.rankAd(e,md(tm(n,t),e.dtype))}}const wA={kernelName:Ko,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{reductionIndices:r}=s,i=t[0],a=bA(e,t[1],i,Vi(r,i.shape));return{x:()=>a.x()}}},vA={kernelName:Xo,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Ad(e,md(Om(n,s),"float32")),b:()=>Ad(e,md(zm(n,s),"float32"))}}};const AA=Jc({maxPool3dGrad_:function(e,t,n,s,r,i,a){const o=Zc(e,"dy","maxPool3dGrad"),l=Zc(t,"input","maxPool3dGrad"),u=Zc(n,"output","maxPool3dGrad");let c=o,h=l,d=u,p=!1;4===l.rank&&(p=!0,c=mf(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=mf(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=mf(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),Ni(5===c.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${c.rank}.`)),Ni(5===h.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`)),Ni(5===d.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`)),ff("maxPool3dGrad",i,a);const f={dy:c,input:h,output:d},m={filterSize:s,strides:r,pad:i,dimRoundingMode:a},g=Wc.runKernel(Jo,f,m);return p?mf(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),xA={kernelName:Qo,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=n;return{x:()=>AA(e,s,r,i,a,o,l)}}};const CA=Jc({maxPoolGrad_:function(e,t,n,s,r,i,a){const o=Zc(e,"dy","maxPoolGrad"),l=Zc(t,"input","maxPoolGrad"),u=Zc(n,"output","maxPoolGrad");Ni(l.rank===o.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`)),Ni(4===o.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`)),Ni(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),ff("maxPoolGrad",i,a);const c={dy:o,input:l,output:u},h={filterSize:s,strides:r,pad:i,dimRoundingMode:a};return Wc.runKernel(Yo,c,h)}}),kA={kernelName:Zo,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o}=n;return{x:()=>CA(e,s,r,i,a,o)}}},SA={kernelName:rl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Af(e,i,s.shape)}}},_A={kernelName:ml,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:s}=n;return Dy(e,s).map((e=>()=>e))}},EA={kernelName:gl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Af(e,i,s.shape)}}},IA={kernelName:yl,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,s,r]=t,i=n,a=s,o=Gd(i.shape,a.shape);return{a:()=>{const t=md(a,"float32");let n=Ad(e,Ad(t,Bd(i,zd(t,_d(1)))));const s=Wd(i.shape,o);return s.length>0&&(n=wm(n,s)),mf(n,i.shape)},b:()=>{const t=Nm(i,0),n=nm(t,Wm(i),kd(i));let s=Ad(e,Ad(r,n));const l=Wd(a.shape,o);return l.length>0&&(s=wm(s,l)),mf(s,a.shape)}}}};function TA(e,t,n){const s=e.shape.length,r=s-n.length,i=fm(n,s);let a=e;null!=i&&(a=Py(e,i));const o=a.shape.slice(),l=o.splice(s-n.length,n.length).reduce(((e,t)=>e*t),1);o.push(l);let u=function(e,t,n){const s=e.shape.slice();s[n]=1;const r=mf(t,s),i=Kf(e,n,!0,!1),a=Kf(e,n,!0,!0),o=Ad(i,a);return Ad(r,o)}(a.reshape(o),t,r);if(u=u.reshape(a.shape),null!=i){const e=mm(i);u=Py(u,e)}return u}const NA={kernelName:Vl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Nm(n,_d(0)),s=_d(Ew),r=_d(Iw),i=Ad(e,r),a=Ad(Ad(e,s),Cm(md(n,"float32")));return nm(t,i,a)}}}},OA={kernelName:Xl,gradFunc:(e,t,n)=>{const{blockShape:s,paddings:r}=n;return{x:()=>kf(e,s,r)}}},RA={kernelName:Zl,gradFunc:(e,t,n)=>{const{axis:s}=n;return{x:()=>bf(e,s)}}},DA={kernelName:pu,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{reps:r}=n;return{x:()=>{let t=kd(s);if(1===s.rank)for(let n=0;n{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=vd(e,md(s,"float32")),i=Wd(n.shape,r);return i.length>0?mf(wm(t,i),n.shape):t},b:()=>{let t=Ad(e,md(n,"float32"));const i=Wd(s.shape,r);i.length>0&&(t=mf(wm(t,i),s.shape));const a=Cd(s);return Um(vd(t,md(a,"float32")))}}}},Zv,Yv,Qv,Jv,eA,nA,tA,sA,rA,oA,lA,uA,cA,hA,dA,pA,fA,mA,yA,wA,wA,vA,xA,kA,{kernelName:tl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n,i=Vi(r,s.shape),a=Di(hm(s.shape,i)[1]);return{x:()=>{const t=s.shape.slice();i.forEach((e=>{t[e]=1}));const n=mf(e,t);return vd(Ad(n,ag(s.shape,"float32")),a)}}}},{kernelName:nl,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{axis:r}=s,[i,a]=t,o=bA(e,a,i,Vi(r,i.shape));return{x:()=>o.x()}}},{kernelName:sl,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Ad(e,md(Lm(n,s),"float32")),b:()=>Ad(e,md(Nm(n,s),"float32"))}}},SA,{kernelName:il,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=Wd(n.shape,r);return t.length>0?mf(wm(e,t),n.shape):e},b:()=>{const t=Ad(e,Um(Im(vd(n,s)))),i=Wd(s.shape,r);return i.length>0?mf(wm(t,i),s.shape):t}}}},{kernelName:ol,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=Ad(e,md(s,"float32")),i=Wd(n.shape,r);return i.length>0?mf(wm(t,i),n.shape):t},b:()=>{const t=Ad(e,md(n,"float32")),i=Wd(s.shape,r);return i.length>0?mf(wm(t,i),s.shape):t}}}},{kernelName:ll,gradFunc:e=>({x:()=>Um(e)})},{kernelName:fl,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>ig(n.shape,"float32")}}},{kernelName:pl,gradFunc:e=>({x:()=>kd(e)})},_A,EA,EA,IA,{kernelName:bl,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,s]=t,r=Nm(n,0);return{x:()=>nm(r,e,Ad(e,s)),alpha:()=>{let t=nm(r,kd(e),Ad(e,n));const i=Wd(s.shape,e.shape);return i.length>0&&(t=wm(t,i)),mf(t,s.shape)}}}},{kernelName:wl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;let i=[];return i=null==r?s.shape.map(((e,t)=>t)):"number"==typeof r?[r]:r,{x:()=>TA(s,e,i)}}},{kernelName:Sl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,Um(Cd(n)))}}},{kernelName:Rl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Ad(Lm(n,6),yy(n));return{x:()=>Ad(e,md(s,"float32"))}}},{kernelName:_l,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,md(yy(n),"float32"))}}},{kernelName:El,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>mf(e,n.shape)}}},{kernelName:Nl,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>Wc.runKernel(Ol,r,n)}}},{kernelName:Il,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>Wc.runKernel(Tl,r,n)}}},{kernelName:Dl,gradFunc:(e,t,n)=>{const{dims:s}=n,r=Vi(s,e.shape);return{x:()=>jg(e,r)}}},{kernelName:Ml,gradFunc:e=>({x:()=>kd(e)})},{kernelName:Fl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Um(vd(e,Ad(Bd(n,1.5),2)))}}},{kernelName:Pl,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>md(kd(n),"float32"),t:()=>Ad(e,md(n,e.dtype)),e:()=>Ad(e,md(Xm(n),e.dtype))}}},NA,{kernelName:jl,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,Ad(n,zd(_d(1),n)))}}},{kernelName:ql,gradFunc:e=>({x:()=>kd(e)})},{kernelName:Gl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(Hf(md(n,"float32")),e)}}},{kernelName:Ul,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad($f(md(n,"float32")),e)}}},{kernelName:Wl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{begin:r,size:i}=n,a=s.shape,[o,l]=Lp(s,r,i),u=[];for(let t=0;tbg(e,u)}}},{kernelName:Yl,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{dim:r}=n,i=Ad(e,s);return{logits:()=>zd(i,Ad(wm(i,[r],true),s))}}},{kernelName:Hl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,vf(n))}}},OA,OA,RA,RA,{kernelName:$l,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,Ad(xd(md(n,"float32")),2))}}},{kernelName:su,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=_d(2);return{a:()=>Ad(e,Ad(r,zd(n,s))),b:()=>Ad(e,Ad(r,zd(s,n)))}}},{kernelName:ru,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,Ad(md(n,"float32"),2))}}},{kernelName:Au,gradFunc:e=>({x:()=>kd(e)})},{kernelName:cu,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{let t=e;const s=Wd(n.shape,r);return s.length>0&&(t=wm(t,s)),mf(t,n.shape)},b:()=>{let t=e;const n=Wd(s.shape,r);return n.length>0&&(t=wm(t,n)),mf(Um(t),s.shape)}}}},{kernelName:Kl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,r=s.shape.slice(),{axis:i}=n;Vi(i,s.shape).forEach((e=>{r[e]=1}));const a=mf(e,r),o=Ad(a,ag(s.shape,"float32"));return{x:()=>o}}},{kernelName:hu,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,Cd(Hf(n)))}}},{kernelName:du,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(zd(_d(1),Cd(n)),e)}}},DA,{kernelName:gu,gradFunc:(e,t,n)=>{const s=n,{perm:r}=s,i=mm(r);return{x:()=>Py(e,i)}}},{kernelName:bu,gradFunc:(e,t,n)=>{const s=n,{axis:r}=s;return{value:()=>gy(e,r)}}},{kernelName:wu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=Ud(t,kd(t)),s=Tm(e,n);let r=Om(t,_d(0,"int32"));const i=s.rank-r.rank;for(let e=0;e({x:()=>kd(e)})}];for(const e of MA)Fu(e);Ac().prototype.abs=function(){return this.throwIfDisposed(),Pd(this)},Ac().prototype.acos=function(){return this.throwIfDisposed(),Wp(this)},Ac().prototype.acosh=function(){return this.throwIfDisposed(),Gp(this)},Ac().prototype.add=function(e){return this.throwIfDisposed(),bd(this,e)},Ac().prototype.all=function(e,t){return this.throwIfDisposed(),qp(this,e,t)},Ac().prototype.any=function(e,t){return this.throwIfDisposed(),jp(this,e,t)},Ac().prototype.argMax=function(e){return this.throwIfDisposed(),Hp(this,e)},Ac().prototype.argMin=function(e){return this.throwIfDisposed(),$p(this,e)},Ac().prototype.asScalar=function(){return this.throwIfDisposed(),Ni(1===this.size,(()=>"The array must have only 1 element.")),mf(this,[])},Ac().prototype.asType=function(e){return this.throwIfDisposed(),md(this,e)},Ac().prototype.as1D=function(){return this.throwIfDisposed(),mf(this,[this.size])},Ac().prototype.as2D=function(e,t){return this.throwIfDisposed(),mf(this,[e,t])},Ac().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),mf(this,[e,t,n])},Ac().prototype.as4D=function(e,t,n,s){return this.throwIfDisposed(),mf(this,[e,t,n,s])},Ac().prototype.as5D=function(e,t,n,s,r){return this.throwIfDisposed(),mf(this,[e,t,n,s,r])},Ac().prototype.asin=function(){return this.throwIfDisposed(),Kp(this)},Ac().prototype.asinh=function(){return this.throwIfDisposed(),Xp(this)},Ac().prototype.atan=function(){return this.throwIfDisposed(),Zp(this)},Ac().prototype.atan2=function(e){return this.throwIfDisposed(),Yp(this,e)},Ac().prototype.atanh=function(){return this.throwIfDisposed(),Qp(this)},Ac().prototype.avgPool=function(e,t,n,s){return this.throwIfDisposed(),gf(this,e,t,n,s)},Ac().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),kf(this,e,t)},Ac().prototype.batchNorm=function(e,t,n,s,r){return this.throwIfDisposed(),Sf(this,e,t,n,s,r)},Ac().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Rf(this,e)},Ac().prototype.cast=function(e){return this.throwIfDisposed(),md(this,e)},Ac().prototype.ceil=function(){return this.throwIfDisposed(),Df(this)},Ac().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Mf(this,e,t)},Ac().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof vc&&(e=[e]),bf([this,...e],t)},Ac().prototype.conv1d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Vf(this,e,t,n,s,r,i)},Ac().prototype.conv2dTranspose=function(e,t,n,s,r){return this.throwIfDisposed(),Gf(this,e,t,n,s,r)},Ac().prototype.conv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Pf(this,e,t,n,s,r,i)},Ac().prototype.cos=function(){return this.throwIfDisposed(),Hf(this)},Ac().prototype.cosh=function(){return this.throwIfDisposed(),$f(this)},Ac().prototype.cumprod=function(e,t,n){return this.throwIfDisposed(),Kf(this,e,t,n)},Ac().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),Xf(this,e,t,n)},Ac().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),Yf(this,e,t)},Ac().prototype.depthwiseConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Qf(this,e,t,n,s,r,i)},Ac().prototype.dilation2d=function(e,t,n,s,r){return this.throwIfDisposed(),em(this,e,t,n,s,r)},Ac().prototype.divNoNan=function(e){return this.throwIfDisposed(),sm(this,e)},Ac().prototype.div=function(e){return this.throwIfDisposed(),vd(this,e)},Ac().prototype.dot=function(e){return this.throwIfDisposed(),rm(this,e)},Ac().prototype.elu=function(){return this.throwIfDisposed(),am(this)},Ac().prototype.equal=function(e){return this.throwIfDisposed(),tm(this,e)},Ac().prototype.erf=function(){return this.throwIfDisposed(),lm(this)},Ac().prototype.euclideanNorm=function(e,t){return this.throwIfDisposed(),xm(this,e,t)},Ac().prototype.exp=function(){return this.throwIfDisposed(),Cm(this)},Ac().prototype.expandDims=function(e){return this.throwIfDisposed(),km(this,e)},Ac().prototype.expm1=function(){return this.throwIfDisposed(),Sm(this)},Ac().prototype.fft=function(){return this.throwIfDisposed(),uy(this)},Ac().prototype.flatten=function(){return this.throwIfDisposed(),mf(this,[this.size])},Ac().prototype.floor=function(){return this.throwIfDisposed(),Im(this)},Ac().prototype.floorDiv=function(e){return this.throwIfDisposed(),wd(this,e)},Ac().prototype.gather=function(e,t,n){return this.throwIfDisposed(),Tm(this,e,t,n)},Ac().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Om(this,e)},Ac().prototype.greater=function(e){return this.throwIfDisposed(),Nm(this,e)},Ac().prototype.ifft=function(){return this.throwIfDisposed(),cy(this)},Ac().prototype.irfft=function(){return this.throwIfDisposed(),hy(this)},Ac().prototype.isFinite=function(){return this.throwIfDisposed(),Dm(this)},Ac().prototype.isInf=function(){return this.throwIfDisposed(),Mm(this)},Ac().prototype.isNaN=function(){return this.throwIfDisposed(),Fm(this)},Ac().prototype.leakyRelu=function(e){return this.throwIfDisposed(),Bm(this,e)},Ac().prototype.lessEqual=function(e){return this.throwIfDisposed(),Lm(this,e)},Ac().prototype.less=function(e){return this.throwIfDisposed(),zm(this,e)},Ac().prototype.localResponseNormalization=function(e,t,n,s){return this.throwIfDisposed(),Vm(this,e,t,n,s)},Ac().prototype.logSigmoid=function(){return this.throwIfDisposed(),jm(this)},Ac().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Hm(this,e)},Ac().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),$m(this,e,t)},Ac().prototype.log=function(){return this.throwIfDisposed(),Wm(this)},Ac().prototype.log1p=function(){return this.throwIfDisposed(),Gm(this)},Ac().prototype.logicalAnd=function(e){return this.throwIfDisposed(),Km(this,e)},Ac().prototype.logicalNot=function(){return this.throwIfDisposed(),Xm(this)},Ac().prototype.logicalOr=function(e){return this.throwIfDisposed(),Zm(this,e)},Ac().prototype.logicalXor=function(e){return this.throwIfDisposed(),Ym(this,e)},Ac().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),wf(this,e,t,n)},Ac().prototype.maxPool=function(e,t,n,s){return this.throwIfDisposed(),tg(this,e,t,n,s)},Ac().prototype.max=function(e,t){return this.throwIfDisposed(),ym(this,e,t)},Ac().prototype.maximum=function(e){return this.throwIfDisposed(),Ud(this,e)},Ac().prototype.mean=function(e,t){return this.throwIfDisposed(),rg(this,e,t)},Ac().prototype.min=function(e,t){return this.throwIfDisposed(),bm(this,e,t)},Ac().prototype.minimum=function(e){return this.throwIfDisposed(),lg(this,e)},Ac().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),ug(this,e,t)},Ac().prototype.mod=function(e){return this.throwIfDisposed(),cg(this,e)},Ac().prototype.mul=function(e){return this.throwIfDisposed(),Ad(this,e)},Ac().prototype.neg=function(){return this.throwIfDisposed(),Um(this)},Ac().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Am(this,e,t,n)},Ac().prototype.notEqual=function(e){return this.throwIfDisposed(),fg(this,e)},Ac().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),mg(this,e,t,n)},Ac().prototype.onesLike=function(){return this.throwIfDisposed(),gg(this)},Ac().prototype.pad=function(e,t){return this.throwIfDisposed(),bg(this,e,t)},Ac().prototype.pool=function(e,t,n,s,r,i){return this.throwIfDisposed(),kg(this,e,t,n,s,r,i)},Ac().prototype.pow=function(e){return this.throwIfDisposed(),Bd(this,e)},Ac().prototype.prelu=function(e){return this.throwIfDisposed(),Sg(this,e)},Ac().prototype.prod=function(e,t){return this.throwIfDisposed(),_g(this,e,t)},Ac().prototype.reciprocal=function(){return this.throwIfDisposed(),Gg(this)},Ac().prototype.relu=function(){return this.throwIfDisposed(),Ug(this)},Ac().prototype.relu6=function(){return this.throwIfDisposed(),qg(this)},Ac().prototype.reshapeAs=function(e){return this.throwIfDisposed(),mf(this,e.shape)},Ac().prototype.reshape=function(e){return this.throwIfDisposed(),mf(this,e)},Ac().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),Tb(this,e,t,n)},Ac().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),Nb(this,e,t,n)},Ac().prototype.reverse=function(e){return this.throwIfDisposed(),jg(this,e)},Ac().prototype.rfft=function(){return this.throwIfDisposed(),py(this)},Ac().prototype.round=function(){return this.throwIfDisposed(),Zg(this)},Ac().prototype.rsqrt=function(){return this.throwIfDisposed(),Yg(this)},Ac().prototype.selu=function(){return this.throwIfDisposed(),Qg(this)},Ac().prototype.separableConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Jg(this,e,t,n,s,r,i)},Ac().prototype.sigmoid=function(){return this.throwIfDisposed(),vf(this)},Ac().prototype.sign=function(){return this.throwIfDisposed(),ty(this)},Ac().prototype.sin=function(){return this.throwIfDisposed(),ny(this)},Ac().prototype.sinh=function(){return this.throwIfDisposed(),sy(this)},Ac().prototype.slice=function(e,t){return this.throwIfDisposed(),Af(this,e,t)},Ac().prototype.softmax=function(e){return this.throwIfDisposed(),ly(this,e)},Ac().prototype.softplus=function(){return this.throwIfDisposed(),qm(this)},Ac().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Cg(this,e,t)},Ac().prototype.split=function(e,t){return this.throwIfDisposed(),dy(this,e,t)},Ac().prototype.sqrt=function(){return this.throwIfDisposed(),xd(this)},Ac().prototype.square=function(){return this.throwIfDisposed(),Cd(this)},Ac().prototype.squaredDifference=function(e){return this.throwIfDisposed(),fy(this,e)},Ac().prototype.squeeze=function(e){return this.throwIfDisposed(),my(this,e)},Ac().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof vc?[this,e]:[this,...e];return gy(n,t)},Ac().prototype.step=function(e){return this.throwIfDisposed(),yy(this,e)},Ac().prototype.stridedSlice=function(e,t,n,s,r,i,a,o){return this.throwIfDisposed(),by(this,e,t,n,s,r,i,a,o)},Ac().prototype.sub=function(e){return this.throwIfDisposed(),zd(this,e)},Ac().prototype.sum=function(e,t){return this.throwIfDisposed(),wm(this,e,t)},Ac().prototype.tan=function(){return this.throwIfDisposed(),wy(this)},Ac().prototype.tanh=function(){return this.throwIfDisposed(),xf(this)},Ac().prototype.tile=function(e){return this.throwIfDisposed(),_m(this,e)},Ac().prototype.toBool=function(){return this.throwIfDisposed(),md(this,"bool")},Ac().prototype.toFloat=function(){return this.throwIfDisposed(),md(this,"float32")},Ac().prototype.toInt=function(){return this.throwIfDisposed(),md(this,"int32")},Ac().prototype.topk=function(e,t){return this.throwIfDisposed(),Ty(this,e,t)},Ac().prototype.transpose=function(e){return this.throwIfDisposed(),Py(this,e)},Ac().prototype.unique=function(e){return this.throwIfDisposed(),Oy(this,e)},Ac().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Ry(this,e,t)},Ac().prototype.unstack=function(e){return this.throwIfDisposed(),Dy(this,e)},Ac().prototype.where=function(e,t){return this.throwIfDisposed(),nm(e,this,t)},Ac().prototype.zerosLike=function(){return this.throwIfDisposed(),kd(this)};class FA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,FA.prototype)}}class BA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,BA.prototype)}}class zA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,zA.prototype)}}class LA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,LA.prototype)}}class PA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,PA.prototype)}}Error;class VA{constructor(e){this.maxEntries=e||100,this.cache=new Map}get(e){let t;return this.cache.has(e)&&(t=this.cache.get(e),this.cache.delete(e),this.cache.set(e,t)),t}put(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxEntries){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,t)}getMaxEntries(){return this.maxEntries}setMaxEntries(e){if(e<0)throw new Error(`The maxEntries of LRU caches must be at least 0, but got ${e}.`);if(this.maxEntries>e)for(let t=0;tt.toUpperCase()))}let KA={};function XA(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function ZA(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e=>ZA(e)));else{const t=Object.keys(e);for(const n of t){const t=e[n];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?ZA(t):e[n]=t.value)}}}function YA(e,t={},n={},s="object",r=!1){if("string"==typeof e){const r=e;let i;if(r in n)i=n[r];else if(r in KA)i=KA[r];else if(i=t[r],null==i)throw new zA(`Unknown ${s}: ${e}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}{const i=e;if(null==i.className||null==i.config)throw new zA(`${s}: Improper config format: ${JSON.stringify(i)}.\n'className' and 'config' must set.`);const a=i.className;let o,l;if(a in n?[o,l]=n[a]:a in KA?[o,l]=KA.className:a in t&&([o,l]=t[a]),null==o)throw new zA(`Unknown ${s}: ${a}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(KA))e[t]=KA[t];for(const t of Object.keys(n))e[t]=n[t];i.config.customObjects=e;const t=Object.assign({},KA);for(const e of Object.keys(n))KA[e]=n[e];ZA(i.config);const s=l(o,i.config,n,r);return KA=Object.assign({},t),s}{const e=Object.assign({},KA);for(const e of Object.keys(n))KA[e]=n[e];const t=new o(i.config);return KA=Object.assign({},e),t}}}function QA(e,t){return-1*function(e,t){return et?1:0}(e,t)}function JA(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function ex(e){if(null==e)throw new zA(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function tx(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new zA(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function nx(e,t,n=0,s=1/0){return GA(n>=0),GA(s>=n),Array.isArray(e)&&e.length>=n&&e.length<=s&&e.every((e=>typeof e===t))}function sx(e,t){Array.isArray(e)?(Ni(e.length>0,(()=>`${t} is unexpectedly an empty array.`)),e.forEach(((e,n)=>sx(e,`element ${n+1} of ${t}`)))):Ni(Number.isInteger(e)&&e>0,(()=>`Expected ${t} to be a positive integer, but got ${rx(e)}.`))}function rx(e){return null===e?"null":Array.isArray(e)?"["+e.map((e=>rx(e))).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function ix(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}let ax=0;function ox(){return ax++}const lx={};function ux(e=""){return e in lx||(lx[e]=0),lx[e]+=1,e+lx[e].toString()}const cx=["channelsFirst","channelsLast"],hx=["nearest","bilinear"],dx=["valid","same","causal"],px=["max","avg"],fx=["sum","mul","concat","ave"],mx=new Map;function gx(e){tx(cx,"DataFormat",e)}function yx(e){tx(dx,"PaddingMode",e)}function bx(e){tx(px,"PoolMode",e)}const wx=[],vx="/";function Ax(e,t){wx.push(e);try{const e=t();return wx.pop(),e}catch(e){throw wx.pop(),e}}function xx(e){if(!Sx(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===wx.length?"":wx.join(vx)+vx)+e}function Cx(e){if(!Sx(e))throw new Error("Not a valid tensor name: '"+e+"'");mx.has(e)||mx.set(e,0);const t=mx.get(e);if(mx.set(e,mx.get(e)+1),t>0){const n=`${e}_${t}`;return mx.set(n,1),n}return e}const kx=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Sx(e){return!!e.match(kx)}function _x(e,t,n){null==t&&(t=0),null==n&&(n=e.length);let s=1;for(let r=t;rt&&(t=s)}return t}function Tx(e,t){if(t{switch(e.rank){case 1:return ry(e,t,n);case 2:return iy(e,[t,0],[n,e.shape[1]]);case 3:return ay(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return oy(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Af(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Af(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new zA(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Fx(e,t,n){return oh((()=>{switch(e.rank){case 1:return ry(e,t,n);case 2:return iy(e,[0,t],[e.shape[0],n]);case 3:return ay(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return oy(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new zA(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Bx(e,t,n,s){return oh((()=>{switch(e.rank){case 1:return ry(e,t,n);case 2:switch(s){case 1:return Mx(e,t,n);case 2:return Fx(e,t,n);default:throw new zA(`The axis is not within the rank of the tensor ${s}`)}case 3:switch(s){case 1:return Mx(e,t,n);case 2:return ay(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return Fx(e,t,n);default:throw new zA(`The axis is not within the rank of the tensor ${s}`)}case 4:switch(s){case 1:return Mx(e,t,n);case 2:return oy(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return oy(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return Fx(e,t,n);default:throw new zA(`The axis is not within the rank of the tensor ${s}`)}default:throw new zA(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function zx(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),bf(e,t)}function Lx(e,t){switch(e.rank){case 1:return Ff([e,t]);case 2:return Bf([e,t],0);case 3:return zf([e,t],0);case 4:return Lf([e,t],0);default:throw new zA(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function Px(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new zA(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return _m(e,t)}function Vx(e,t=0,n=1,s,r){return Bg(e,t,n,s,r)}function Wx(e,t,n,s){if(e.rank<2||t.rank<2)throw new LA(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){if(e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new LA(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(2===e.rank&&2===t.rank){return sb({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?qx(e.rank,s,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),i=r.pop();e=mf(e,[-1,i]);const a=t.shape.slice(),o=a.pop(),l=a.pop(),u=[...a,o],c=Array.from({length:t.rank},((e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n));t=mf(Py(t,c),[l,-1]);const h=[...r,...u];return mf(sb({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?qx(e.rank,s,"channelsLast"):null,activation:n}),h)}}function Gx(e,t,n){return oh((()=>(t=Array.isArray(t)?vy(t,"int32"):md(t,"int32"),Tm(e,t,n))))}function Ux(e){return Ad(e,e)}function qx(e,t,n){const s=t.shape;if(1!==t.rank&&t.rank!==e)throw new zA(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===s.length?mf(t,[1,s[0],1,1,1]):mf(t,[1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?mf(t,[1,1,1,1,s[0]]):mf(t,[1].concat(s))}else if(4===e){if("channelsFirst"===n)return 1===s.length?mf(t,[1,s[0],1,1]):mf(t,[1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?mf(t,[1,1,1,s[0]]):mf(t,[1].concat(s))}else if(3===e){if("channelsFirst"===n)return 1===s.length?mf(t,[1,s[0],1]):mf(t,[1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?mf(t,[1,1,s[0]]):mf(t,[1].concat(s))}else if(e<3)return t;throw new zA(`Unsupported input rank by biasAdd: ${t.rank}`)}function jx(e,t,n){return oh((()=>(null==n&&(n="channelsLast"),gx(n),bd(e,qx(e.rank,t,n)))))}function Hx(e,t,n,s){return oh((()=>qy(e,t,n,s)))}function $x(e,t,n=!1){return n?e():t()}const Kx=["fanIn","fanOut","fanAvg"],Xx=["normal","uniform","truncatedNormal"];class Zx extends Td{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class Yx extends Zx{apply(e,t){return ig(e,t)}}Yx.className="Zeros",Od(Yx);class Qx extends Zx{apply(e,t){return ag(e,t)}}Qx.className="Ones",Od(Qx);class Jx extends Zx{constructor(e){if(super(),"object"!=typeof e)throw new zA(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new zA(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return oh((()=>Ad(_d(this.value),ag(e,t))))}getConfig(){return{value:this.value}}}Jx.className="Constant",Od(Jx);class eC extends Zx{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return Lg(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}eC.className="RandomUniform",Od(eC);class tC extends Zx{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new LA(`randomNormal does not support dType ${t}.`);return Vx(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}tC.className="RandomNormal",Od(tC);class nC extends Zx{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new LA(`truncatedNormal does not support dType ${t}.`);return Ny(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}nC.className="TruncatedNormal",Od(nC);class sC extends Zx{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return oh((()=>{if(2!==e.length||e[0]!==e[1])throw new zA("Identity matrix initializer can only be used for 2D square matrices.");return Ad(this.gain,Em(e[0]))}))}getConfig(){return{gain:this.gain}}}sC.className="Identity",Od(sC);class rC extends Zx{constructor(e){if(super(),e.scale<0)throw new zA(`scale must be a positive float. Got: ${e.scale}`);var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,tx(Kx,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){tx(Xx,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,s;if(gx(t),2===e.length)n=e[0],s=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=_x(e,2);n=e[1]*t,s=e[0]*t}else if("channelsLast"===t){const t=_x(e,0,e.length-2);n=e[e.length-2]*t,s=e[e.length-1]*t}}else{const t=_x(e);n=Math.sqrt(t),s=Math.sqrt(t)}return[n,s]}(e),s=n[0],r=n[1];let i=this.scale;if("fanIn"===this.mode?i/=Math.max(1,s):"fanOut"===this.mode?i/=Math.max(1,r):i/=Math.max(1,(s+r)/2),"normal"===this.distribution){const n=Math.sqrt(i);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new LA(`${this.getClassName()} does not support dType ${t}.`);return Ny(e,0,n,t,this.seed)}{const n=Math.sqrt(3*i);return Lg(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}rC.className="VarianceScaling",Od(rC);class iC extends rC{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return rC.className}}iC.className="GlorotUniform",Od(iC);class aC extends rC{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return rC.className}}aC.className="GlorotNormal",Od(aC);class oC extends rC{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return rC.className}}oC.className="HeNormal",Od(oC);class lC extends rC{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return rC.className}}lC.className="HeUniform",Od(lC);class uC extends rC{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return rC.className}}uC.className="LeCunNormal",Od(uC);class cC extends rC{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return rC.className}}cC.className="LeCunUniform",Od(cC);class hC extends Zx{constructor(e){super(),this.DEFAULT_GAIN=1,this.ELEMENTS_WARN_SLOW=2e3,this.gain=null==e.gain?this.DEFAULT_GAIN:e.gain,this.seed=e.seed}apply(e,t){return oh((()=>{if(e.length<2)throw new LA("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=Di(e.slice(0,-1)),s=e[e.length-1];this.ELEMENTS_WARN_SLOW;const r=Vx([Math.max(s,n),Math.min(s,n)],0,1,t,this.seed),i=rw.qr(r,!1);let a=i[0];const o=i[1].flatten().stridedSlice([0],[Math.min(s,n)*Math.min(s,n)],[Math.min(s,n)+1]);return a=Ad(a,o.sign()),ne*t));return t}const AC="Variable";class xC{constructor(e,t="float32",n=AC,s=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=ox(),n=null==n?AC:n,this.originalName=xx(n),this.name=Cx(this.originalName),this.trainable_=s,this.constraint=r,this.val=Fy(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function CC(e){return e.map((e=>e.read()))}function kC(e){e.forEach((e=>{e[0].write(e[1])}))}class SC{constructor(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class _C{constructor(e,t,n,s,r,i,a){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=s,this.callArgs=r,this.outputTensorIndex=a,this.id=ox(),null!=i&&(this.originalName=xx(i),this.name=Cx(this.originalName)),this.rank=t.length}}let EC=0;class IC{constructor(e,t){this.callArgs=t,this.id=EC++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(const t of e.inboundLayers)null!=t&&t.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const t of this.inboundLayers)null!=t?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let TC=0;class NC extends Td{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=TC++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){const e=this.getClassName();t=HA(e)+"_"+ux(e)}if(this.name=t,this.trainable_=null==e.trainable||e.trainable,null!=e.inputShape||null!=e.batchInputShape){let t;if(null!=e.batchInputShape)t=e.batchInputShape;else if(null!=e.inputShape){let n=null;null!=e.batchSize&&(n=e.batchSize),t=[n].concat(e.inputShape)}this.batchInputShape=t;let n=e.dtype;null==n&&(n=e.inputDType),null==n&&(n="float32"),this.dtype=n}null!=e.weights?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(0===this.inboundNodes.length)throw new BA(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new zA(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return qA(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return qA(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new FA(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new FA(`Layer ${this.name} is not connected, no input to return.`);return qA(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new FA(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new FA(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return qA(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map((e=>e()))}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach((t=>t.trainable=e)),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter((e=>e.trainable)):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter((e=>!e.trainable)).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){const t=jA(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=jA(this.inputSpec);if(t.length!==n.length)throw new zA(`Layer ${this.name} expects ${n.length} inputs, but it received ${t.length} input tensors. Input received: ${e}`);for(let e=0;er.maxNDim)throw new zA(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${i}`);if(null!=r.minNDim&&i=0?t[s]:t[t.length+s];if(null!=i&&-1===[i,null].indexOf(a))throw new zA(`Input ${e} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${i} but got shape ${t}.`)}}if(null!=r.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of jA(e))t.push(n.shape);this.build(qA(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t);this.supportsMasking&&this.setMaskMetadata(e,s);const r=jA(s),i=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),i.push(e);if(s=qA(i),null!=this.activityRegularizer)throw new LA("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(e){e=jA(e);const t=[];for(const n of e)t.push(n.shape);return qA(t)}(e),s=this.computeOutputShape(n);let r;const i="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),r=null!=s&&s.length>0&&Array.isArray(s[0])?s.map(((n,s)=>new _C(i,n,this,jA(e),t,this.name,s))):new _C(i,s,this,jA(e),t,this.name),this.addInboundNode(e,r,null,null,n,s,t),this._refCount++,null!=this.activityRegularizer)throw new LA("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return r}}))}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length);else{let t=!1;this.batchInputShape.forEach(((n,s)=>{null!=n&&null!=e[s]&&e[s]!==n&&(t=!0)}))}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new FA(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const n=JSON.stringify(t.outputShapes);-1===e.indexOf(n)&&e.push(n)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new FA(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new BA(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return vC(this.weights)}build(e){this.built=!0}getWeights(e=!1){return CC(e?this.trainableWeights:this.weights)}setWeights(e){oh((()=>{const t=this.weights;if(t.length!==e.length)throw new zA(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(0===t.length)return;const n=[],s=CC(t);for(let r=0;rr.apply(u.read()))),null==i&&(i=!0),i?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=jA(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach((e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)}))}return null}return t}setMaskMetadata(e,t,n){if(!this.supportsMasking)return;const s=this.computeMask(e,n),r=jA(t),i=jA(s);if(r.length!==i.length)throw new Error(`${this.name} outputs ${r.length} tensors but ${r.length} masks for those tensors`);for(let e=0;ee.dispose())),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0==--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function OC(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[n];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let n=0;ne.name)),l=[],u=t.names();for(const e of o)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=s&&(s.maxNumTensors=-1/0,s.minNumTensors=1/0);const c=o.join(",")+"|"+t.names().sort().join(",");let h,d=MC.get(c);if(null==d){const e=function(e,t){Ni(null!=e&&e.length>0,(()=>"Expected at least one fetch, got none"));let n=[],s={};if(1===e.length){const r=LC(e[0],t);n=r.sorted,s=r.recipientMap}else{const r=new Set;for(const i of e){const{sorted:e,recipientMap:a}=LC(i,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in a)null==s[e]&&(s[e]=new Set),a[e].forEach((t=>s[e].add(t)))}}return{sorted:n,recipientCounts:zC(s)}}(a,t);d=e.sorted,h=e.recipientCounts,MC.put(c,d),FC.put(c,h)}h={},r||Object.assign(h,FC.get(c));const p=new DC(t);for(let e=0;es.maxNumTensors&&(s.maxNumTensors=e),e0;){const e=i[i.length-1];if(n.has(e.name)){i.pop();continue}const t=a[a.length-1]===i.length-1;if(0===e.inputs.length||t)i.pop(),s.push(e),n.add(e.name),t&&a.pop();else{a.push(i.length-1);for(const t of e.inputs)null==r[t.name]&&(r[t.name]=new Set),r[t.name].add(e.name),n.has(t.name)||i.push(t)}}return{sorted:s,recipientMap:r}}function PC(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;txd(wm(Ad(e,e),t,!0))))}ca().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",(()=>100),(function(e){null!=MC&&MC.setMaxEntries(e),null!=FC&&FC.setMaxEntries(e)}));class WC extends Td{getConfig(){return{}}}class GC extends WC{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return oh((()=>{const t=VC(e,this.axis),n=Mf(t,0,this.maxValue);return Ad(e,vd(n,bd(Ox(),t)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}GC.className="MaxNorm",Od(GC);class UC extends WC{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return oh((()=>vd(e,bd(Ox(),VC(e,this.axis)))))}getConfig(){return{axis:this.axis}}}UC.className="UnitNorm",Od(UC);class qC extends WC{apply(e){return Ug(e)}}qC.className="NonNeg",Od(qC);class jC extends WC{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return oh((()=>{const t=VC(e,this.axis),n=bd(Ad(this.rate,Mf(t,this.minValue,this.maxValue)),Ad(1-this.rate,t));return Ad(e,vd(n,bd(Ox(),t)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}jC.className="MinMaxNorm",Od(jC);const HC={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function $C(e){return XA(e)}function KC(e,t={}){return YA(e,Nd.getMap().classNameMap,t,"constraint")}function XC(e){if(null==e)return null;if("string"==typeof e){return KC({className:e in HC?HC[e]:e,config:{}})}return e instanceof WC?e:KC(e)}async function ZC(e){if(null==e)return;const t=[],n=[],s=[];for(const r in e){const i=e[r];if("number"!=typeof i){const e=i;t.push(e.data()),n.push(r),s.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;tbd(this.totals[e],Ad(s,n))));this.totals[e]=r,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:oh((()=>{const n=Ad(vd(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),uh(t[e])})))}}class nk extends JC{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],n=[];for(const s in this.history){const r=this.history[s];for(let i=0;i{const a=null!=n?n():ec();return a-rnew sk(e,t)))}class ik{constructor(){}static registerCallbackConstructor(e,t){Ni(e>=0&&Number.isInteger(e),(()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`)),ik.checkForDuplicate(t),null==ik.constructors[e]&&(ik.constructors[e]=[]),ik.constructors[e].push(t)}static checkForDuplicate(e){for(const t in ik.constructors){ik.constructors[+t].forEach((t=>{if(t===e)throw new zA("Duplicate callback constructor.")}))}}static clear(){ik.constructors={}}static createCallbacks(e){const t=[];for(const n in ik.constructors){const s=+n;e>=s&&t.push(...ik.constructors[s])}return t.map((e=>new e))}}function ak(e,t,n,s,r,i,a,o,l){const u=new nk,c=[new tk,...ik.createCallbacks(t)];null!=e&&c.push(...e),c.push(u);const h=new ek(c);return h.setParams({epochs:n,initialEpoch:s,samples:r,steps:i,batchSize:a,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:u}}function ok(e,t={},n=!1){return YA(e,Nd.getMap().classNameMap,t,"layer",n)}function lk(e,t){return oh((()=>{"float32"!==e.dtype&&(e=md(e,"float32"));const n=wm(Ux(e),t,!0),s=Md(n.shape,Ox()),r=xd(Ud(n,s));return vd(e,r)}))}function uk(e,t){return oh((()=>rg(Ux(zd(t,e)),-1)))}function ck(e,t){return oh((()=>rg(Pd(zd(t,e)),-1)))}function hk(e,t){return oh((()=>{const n=zd(e,t),s=Mf(Pd(e),Ox(),Number.MAX_VALUE),r=Pd(vd(n,s));return Ad(100,rg(r,-1))}))}function dk(e,t){return oh((()=>{const n=Mf(t,Ox(),Number.MAX_VALUE),s=Wm(bd(1,n)),r=Mf(e,Ox(),Number.MAX_VALUE),i=Wm(bd(1,r));return rg(Ux(zd(s,i)),-1)}))}function pk(e,t,n=!1){return oh((()=>{if(n)t=ly(t);else{const e=wm(t,t.shape.length-1,!0);t=vd(t,e)}return t=Mf(t,Ox(),1-Ox()),Um(wm(Ad(md(e,"float32"),Wm(t)),t.shape.length-1))}))}function fk(e,t,n=!1){return oh((()=>{const s=md(Im(function(e){const t=[_x(e.shape)];return mf(e,t)}(e)),"int32"),r=(t=Mf(t,Ox(),1-Ox())).shape;return pk(mf(mg(s,r[r.length-1]),r),t,n)}))}function mk(e,t){return oh((()=>{let n;return n=Mf(t,Ox(),1-Ox()),n=Wm(vd(n,zd(1,n))),rg(function(e,t){if(!Mi(e.shape,t.shape))throw new zA(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return oh((()=>{const n=Ug(t),s=Um(Pd(t));return bd(zd(n,Ad(t,e)),Gm(Cm(s)))}))}(e,n),-1)}))}function gk(e,t){return oh((()=>{const n=Mf(e,Ox(),1),s=Mf(t,Ox(),1);return wm(Ad(e,Wm(vd(n,s))),-1)}))}function yk(e,t){return oh((()=>{const n=lk(e,-1),s=lk(t,-1),r=Ad(n,s);return Um(wm(r,-1))}))}ik.constructors={};const bk={meanSquaredError:uk,meanAbsoluteError:ck,meanAbsolutePercentageError:hk,meanSquaredLogarithmicError:dk,squaredHinge:function(e,t){return oh((()=>{const n=Ud(0,zd(1,Ad(e,t)));return rg(Ux(n),-1)}))},hinge:function(e,t){return oh((()=>{const n=Ud(0,zd(1,Ad(e,t)));return rg(n,-1)}))},categoricalHinge:function(e,t){return oh((()=>{const n=wm(Ad(e,t),-1),s=ym(Ad(zd(1,e),t),-1);return Ud(0,bd(1,zd(s,n)))}))},logcosh:function(e,t){return oh((()=>{const n=Math.log(2),s=zd(t,e),r=zd(bd(s,qm(Ad(-2,s))),n);return rg(r,-1)}))},categoricalCrossentropy:pk,sparseCategoricalCrossentropy:fk,binaryCrossentropy:mk,kullbackLeiblerDivergence:gk,poisson:function(e,t){return oh((()=>{const n=Wm(bd(Ox(),t));return rg(zd(t,Ad(e,n)),-1)}))},cosineProximity:yk};function wk(e){if("string"==typeof e){if(e in bk)return bk[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new zA(t)}return e}function vk(e,t){return oh((()=>{const n=Ad(.5,gg(t)),s=Rx(Nm(t,n),e.dtype);return rg(tm(e,s),-1)}))}function Ak(e,t){return oh((()=>Rx(tm(Hp(e,-1),Hp(t,-1)),"float32")))}function xk(e,t){return oh((()=>md(wm(Km(tm(e,1),tm(t,1))),"float32")))}function Ck(e,t){return mk(e,t)}function kk(e,t){return e.rank===t.rank&&(e=my(e,[e.rank-1])),(t=Hp(t,-1)).dtype!==e.dtype&&(t=md(t,e.dtype)),md(tm(e,t),"float32")}const Sk=pk,_k=fk,Ek={binaryAccuracy:vk,categoricalAccuracy:Ak,precision:function(e,t){return oh((()=>{const n=xk(e,t),s=function(e,t){return oh((()=>md(wm(Km(tm(e,0),tm(t,1))),"float32")))}(e,t),r=bd(n,s);return md(nm(Nm(r,0),vd(n,r),0),"float32")}))},categoricalCrossentropy:Sk,sparseCategoricalCrossentropy:_k,mse:uk,MSE:uk,mae:ck,MAE:ck,mape:hk,MAPE:hk,cosine:yk};function Ik(e){if("string"==typeof e&&e in Ek)return Ek[e];if("string"!=typeof e&&null!=e)return e;throw new zA(`Unknown metric ${e}`)}function Tk(e){if(GA(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(bk))if(bk[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(Ek))if(Ek[n]===e){t=n;break}return void 0!==t?t:e.name}}function Nk(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Ok(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){JSON.stringify(e).length}}function Ok(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const n of t){if("string"!=typeof n)return!1;if(!Ok(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Ok(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function Rk(e,t,n,s=console.log){const r=function(e){let t=!0;const n=[],s=[];for(const t in e.nodesByDepth)n.push(e.nodesByDepth[t]);for(const e of n){if(e.length>1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}s.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const r of n.inboundNodes)if(-1!==s.indexOf(r)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),i=["Layer (type)","Input Shape","Output shape","Param #"];let a;if(r?(t=t||90,n=n||[.32,.61,.89,1]):(t=t||115,n=n||[.24,.48,.7,.8,1]),n[n.length-1]<=1&&(n=n.map((e=>Math.floor(t*e)))),!r){i.push("Receives inputs"),a=[];for(const t in e.nodesByDepth)a.push(...e.nodesByDepth[t])}s("_".repeat(t)),Dk(i,n,s),s("=".repeat(t));const o=e.layers;for(let e=0;e0&&(s=s.slice(0,s.length-1)+" "),s+=e[n],s=s.slice(0,t[n]),s+=" ".repeat(t[n]-s.length);n(s)}function Mk(e,t,n){let s,r;try{r=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){r="multiple"}try{s=JSON.stringify(e.outputShape)}catch(e){s="multiple"}Dk([`${e.name} (${e.getClassName()})`,r,s,e.countParams().toString()],t,n)}function Fk(e,t,n,s){let r,i;try{i=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){i="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const a=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;ee.name))}`);JA(this.outputs).length,this.outputs.length,this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(s)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;GA(0===n,"input layer has >1 nodes"),GA(0===s,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(s)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;te.shape)),this.internalOutputShapes=this.outputs.map((e=>e.shape));const t={},n={},s={},r={},i={},a=[],o=(e,t,n,s,r,l)=>{null!=s&&null!=r&&null!=l||(s=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const u=s.inboundNodes[r];if(-1!==n.indexOf(u))throw new BA(`The tensor ${e.name} at layer "${s.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(Vk.nodeKey(s,r)),s.id in i||(i[s.id]=Object.keys(i).length),-1===n.indexOf(u)&&n.push(u);const c=u.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(u),1);a.push(u)},l=[],u=[];for(const e of this.outputs)o(e,l,u);const c=a.slice().reverse();for(const e of c){n[e.id]=e,e.id in t||(t[e.id]=0);let i=t[e.id];const a=null==s[e.outboundLayer.id]?0:s[e.outboundLayer.id];i=Math.max(i,a),s[e.outboundLayer.id]=i,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=i;for(let s=0;sparseInt(e,10))).sort(QA);this.layers=[];for(const e of p){const t=d[e];t.sort(((e,t)=>{const n=i[e.id],s=i[t.id];return ns?1:0}));for(const e of t)e instanceof Vk&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=d,p=Object.keys(h).map((e=>parseInt(e,10))).sort(QA);const f=this.inputs.slice(),m=[];for(const e of p)for(const t of h[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new BA(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${e.name}". The following previous layers were accessed without issue: ${m}`);for(const e of t.outputTensors)f.push(e);m.push(e.name)}}this.nodesByDepth=h;const g=this.layers.map((e=>e.name));for(const e of g){const t=g.filter((t=>t===e)).length;if(1!==t)throw new BA(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new IC({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map((e=>null)),outputMasks:this.outputs.map((e=>null)),inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs.map((e=>e.shape))}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach((t=>{t._trainableWeights.forEach((t=>t.trainable=e))})),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new zA("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const n={};let s=0;const r=(e=>{const t=Object.keys(e);if(0===t.length)return!1;const n=t[0].split("/");return!isNaN(parseInt(n[n.length-1],10))})(e);r&&this.parseWeights(e);for(const e of this.layers)for(const[t,i]of e.weights.entries()){const e=r?`${i.name.split("/").slice(0,-1).join("/")+"/"}${t}`:i.originalName;if(null!=n[e])throw new zA(`Duplicate weight name: ${e}`);n[e]=i,s++}const i=[];for(const s in e){let r=s;if(null==n[s]){const e=s.split("/");r=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[r])i.push([n[r],e[s]]);else if(t)throw new zA(`Provided weight data has no target variable: ${s}`);delete n[r]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new zA(`${e.length} of ${s} weights are not set: ${e}`)}kC(i)}parseWeights(e){for(const t in Object.keys(e)){const n=t.split("/"),s=["vars","layer_checkpoint_dependencies"],r=n.map((e=>e.startsWith("_")?e.slice(1):e)).filter((e=>!s.includes(e))).join("/");r!==t&&(e[r]=e[t],delete e[t])}}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${Pk}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=Lk(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return oh((()=>{e=jA(e);const n=new DC;for(let t=0;t{let n;return e=jA(e),n=null==t?WA(null,e.length):jA(t),this.runInternalGraph(e,n)[1]}))}computeOutputShape(e){const t=yC(e);if(t.length!==this.inputLayers.length)throw new zA(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10))).sort(QA);if(s.length>1)for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map((e=>e.id)).indexOf(t.id))continue;const s=[];for(let t=0;tparseInt(e,10))).sort(QA);for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,s=e.inputTensors,r=e.outputTensors,i=new Array;for(const e of s)e.id in n&&i.push(n[e.id]);if(i.length===s.length){let s,a,o,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===i.length){const[e,n]=i[0];null==u.mask&&(u.mask=n),o=jA(t.call(e,u)),l=jA(t.computeMask(e,n)),s=[e],a=[n]}else s=i.map((e=>e[0])),a=i.map((e=>e[1])),null==u.mask&&(u.mask=a),o=jA(t.call(s,u)),l=jA(t.computeMask(s,a));if(t.activityRegularizer)throw new LA("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e{const e=[];for(const t of this.layers)for(let n=0;n0){const e=[];for(let n=0;n0&&e.apply(qA(n),s)}function l(e){const n=e.name,i=ok(e,null!=t.customObjects?t.customObjects:{});i.setFastWeightInitDuringBuild(s),r[n]=i;e.inboundNodes.forEach((e=>{if(!(e instanceof Array))throw new zA(`Corrupted configuration, expected array for nodeData: ${e}`);a(i,e)}))}const u=t.name,c=t.layers;for(const e of c)l(e);for(;!ex(i);)for(const e of c){const t=r[e.name];if(t.name in i){const e=i[t.name];delete i[t.name];for(const n of e)o(t,n)}}const h=[],d=[],p=t.inputLayers;for(const e of p){const t=e[0],n=e[1],s=e[2];GA(t in r);const i=r[t].inboundNodes[n].outputTensors;h.push(i[s])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],s=e[2];GA(t in r);const i=r[t].inboundNodes[n].outputTensors;d.push(i[s])}return new e({inputs:h,outputs:d,name:u})}get stateful(){if(this._stateful)throw new zA("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){oh((()=>{this.layers.forEach((e=>{e.stateful&&e.resetStates()}))}))}}function Wk(e,t,n){const s=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>null));if(1===s)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==s)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${s} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const n=[];return t.forEach((t=>{t in e?n.push(e[t]):n.push(null)})),n}throw new Error(`The model has multiple (${s}) outputs, so ${n} must be either an array with ${s} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function Gk(e,t){return Wk(e,t,"classWeight")}async function Uk(e,t,n,s){if(null!=t||null!=s)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=oh((()=>{if(1===e.shape.length)return gd(e);if(2===e.shape.length){if(e.shape[1]>1){return Hp(e,1)}if(1===e.shape[1])return mf(e,[e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)})),s=Array.from(await t.data());lh(t);const r=[];return s.forEach((e=>{if(null==n[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);r.push(n[e])})),vy(r,"float32")}return null}function qk(e,t){return Ad(e,t)}function jk(e,t){let n,s;const r=t;n=r.xs,s=r.ys,Ni(null!=n&&null!=s,(()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`));const i=Hk("input",e.inputNames,n),a=Hk("output",e.outputNames,s),o=i[0].shape[0];Ni(i.length===e.inputs.length,(()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${i.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`)),Ni(a.length===e.outputs.length,(()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${a.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`));for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${i[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${a[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));return{xs:i,ys:a}}function Hk(e,t,n){if(n instanceof vc)return[n];if(Array.isArray(n))return Ni(n.length===t.length,(()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`)),n;{const s=[];for(const r of t){if(null==n[r])throw new zA(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);s.push(n[r])}return s}}async function $k(e,t,n){const s=null!=n.batchesPerEpoch;if(Ni(null!=e.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),Ni(null!=n,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),Ni(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),(()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`)),Ni(!s||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),(()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`)),Ni(null==n.validationSplit,(()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead.")),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{const r=null!=n.validationData;let i,a;if(r)if(Kk(n.validationData))Ni(null==n.validationBatches||n.validationBatches>0&&Number.isInteger(n.validationBatches),(()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`));else{const e=function(e){if(3===e.length)throw new LA("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);i=e.xs,a=e.ys}const o=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=r?l.slice().concat(l.map((e=>"val_"+e))):l.slice();const c=rk(n.callbacks,n.yieldEvery),h=null==n.verbose?1:n.verbose,{callbackList:d,history:p}=ak(c,h,n.epochs,null,null,function(e,t){let n=null;null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size);return n}(t,n),null,r,u);d.setModel(e),e.history=p,await d.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,m=await t.iterator();for(;f=n.batchesPerEpoch:t.done){if(r){let t;t=Kk(n.validationData)?jA(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):jA(e.evaluate(i,a,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;n0&&Number.isInteger(e),(()=>`batchSize is required to be a positive integer, but got ${e}`))}function Zk(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((e=>Mx(e,t,n-t))):Mx(e,t,n-t)}function Yk(e,t){return oh((()=>null==e?null:Array.isArray(e)?e.map((e=>Yk(e,t))):Gx(e,"int32"===t.dtype?t:md(t,"int32"))))}function Qk(e,t){const n=[];let s=0,r=null;for(;s=e&&(r=e),n.push([s,r]),s=r;return n}function Jk(e){const t=[];e instanceof vc&&(e=[e]);for(let n=0;nn.push(e.id)));else if(null!=t)for(const e in t){const s=t[e];n.push(s.id)}const s=[];if(e instanceof vc)-1===n.indexOf(e.id)&&s.push(e);else if(Array.isArray(e))e.forEach((e=>{-1===n.indexOf(e.id)&&s.push(e)}));else if(null!=e)for(const t in e){const r=e[t];-1===n.indexOf(r.id)&&s.push(r)}s.forEach((e=>{e.isDisposed||e.dispose()}))}function tS(e){return Array.isArray(e)}function nS(e){return!function(e){return e instanceof vc}(e)&&!tS(e)}function sS(e,t,n,s=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(tS(e)&&e.length>0)t=!0;else if(nS(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new zA(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map((e=>null));let i;if(nS(e)){i=[];for(const n of t){if(null==e[n])throw new zA(`No data provided for "${n}". Need data for each key in: ${t}`);i.push(e[n])}}else if(tS(e)){if(e.length!==t.length)throw new zA(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);i=e}else{if(t.length>1)throw new zA(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);i=[e]}if(i=Jk(i),null!=n)for(let e=0;e=0&&i!==o)throw new zA(`${r} expected a batch of elements where each example has shape [${n[e].slice(1,n[e].length)}] (i.e.,tensor shape [*,${n[e].slice(1,n[e].length)}]) but the ${r} received an input with ${a.shape[0]} examples, each with shape [${a.shape.slice(1,a.shape.length)}] (tensor shape [${a.shape}])`)}}return i}function rS(e,t,n,s=!0,r=""){let i;if(Array.isArray(e)){if(e.length!==t.length)throw new zA(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);i=e}else{if(t.length>1)throw new zA(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);i=[e]}if(null!=n)for(let e=0;elw.adagrad(.01),Adadelta:()=>lw.adadelta(1,.95,Ox()),Adam:()=>lw.adam(.001,.9,.999,Ox()),Adamax:()=>lw.adamax(.002,.9,.999,Ox(),0),RMSProp:()=>lw.rmsprop(.001,.9,0,Ox()),SGD:()=>lw.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new zA(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof Rd))throw new zA("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new zA(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);const n=e.loss;t=n.map((e=>wk(e)))}else{const n=wk(e.loss);this.outputs.forEach((e=>{t.push(n)}))}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new zA(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)e.loss[n],t.push(wk(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e{for(let e=0;e1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}}));const s=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>[]));let n;if("string"==typeof e||"function"==typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);n=e}if(Array.isArray(n))return t.map((e=>n));{const e=[];for(const s of t){let t=n.hasOwnProperty(s)?n[s]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),r=(e,t,n)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([n,e])};Ax("metric",(()=>{for(let e=0;e{let n,s,i;for(const a of t){if("string"==typeof a&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(a)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===mk?-1!==["accuracy","acc"].indexOf(a)?s=vk:-1!==["crossentropy","ce"].indexOf(a)&&(s=Ck):this.lossFunctions[e]===fk?-1!==["accuracy","acc"].indexOf(a)?s=kk:-1!==["crossentropy","ce"].indexOf(a)&&(s=_k):-1!==["accuracy","acc"].indexOf(a)?s=Ak:-1!==["crossentropy","ce"].indexOf(a)&&(s=Sk),-1!==["accuracy","acc"].indexOf(a)?r="acc":-1!==["crossentropy","ce"].indexOf(a)&&(r="ce"),i=s,n=""+r}else{const e=Ik(a);i=e,n=""+Tk(a)}let t;Ax(n,(()=>{t=i})),r(e,n,t)}})(s[e])}})),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&(this.trainableWeights.length,this.collectedTrainableWeights.length)}evaluate(e,t,n={}){const s=null==n.batchSize?32:n.batchSize;Xk(s);const r=this.standardizeUserDataXY(e,t,!0,s);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return qA(this.testLoop(t,e,s,n.verbose,n.steps))}finally{eS(r[0],e),eS(r[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const s=null!=(n=n||{}).batches,r=e.testFunction;let i=[];if(n.verbose>0)throw new LA("Verbose mode is not implemented yet.");Ni(!s||n.batches>0&&Number.isInteger(n.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`));const a="function"==typeof t.next?t:await t.iterator();let o=0,l=0;for(;!s||l{if(t.value){const{xs:n,ys:s}=jk(e,t.value),a=n.concat(s),u=oh((()=>r(a)));if(lh(a),0===l)for(let e=0;ebd(i[e],Ad(c,t)))),l>0&&lh(n)}lh(u),o+=c,++l}return i})),t.done)break}for(let e=0;ee.name));for(let s=0;s0){const n=[];throw t.forEach(((t,s)=>{null==t&&n.push(e[s])})),new zA(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return oh((()=>{const s=this.checkNumSamples(e);if(n)throw new LA("Verbose predictLoop() is not implemented yet.");const r=Qk(s,t),i=this.outputs.map((e=>[]));for(let t=0;t{const n=r[t][0],s=r[t][1],i=Zk(e,n,s),a=[];if(Array.isArray(i))for(let e=0;ei[t].push(e)))}return qA(i.map((e=>bf(e,0))))}))}predict(e,t={}){const n=Jk(e);rS(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return Xk(e),this.predictLoop(n,e)}finally{eS(n,e)}}predictOnBatch(e){rS(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,s){if(null==this.optimizer_)throw new BA("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let e=0;ee.shape[0])));s.sort();const r=JA(t.map((e=>e.shape[0])));if(r.sort(),s.length>1)throw new zA(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map((e=>e.shape)))}`);if(r.length>1)throw new zA(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map((e=>e.shape)))}`);if(s.length>0&&r.length>0&&!Mi(s,r))throw new zA(`Input Tensors should have the same number of samples as target Tensors. Found ${s[0]} input sample(s) and ${r[0]} target sample(s).`)}(e=sS(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=sS(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const s=[uk,mk,pk];for(let r=0;r0&&e[0].shape[0]%s!=0)throw new zA(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${s}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,s,r=!0,i){const[a,o]=this.standardizeUserDataXY(e,t,r,i);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const e=Gk(s,this.outputNames);l=[];for(let t=0;t{const i=this.checkNumSamples(t,n,r,"steps"),a=[];if(s>0)throw new LA("Verbose mode is not implemented yet.");if(null!=r)throw new LA("steps mode in testLoop() is not implemented yet");{const s=Qk(i,n),r=vy(Tx(0,i));for(let n=0;n1){r+=`_${UA(e.slice(0,n),s)}`}t.push(r)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),s=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),i=[],a=this.collectedTrainableWeights.map((e=>e.read()));return[this.optimizer_.minimize((()=>{const e=[];for(let t=0;t1&&e{l=bd(l,e)})),l}),!0,a)].concat(i)}}makeTestFunction(){this.testFunction=e=>oh((()=>{const t=[];let n;const s=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),i=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new LA("validationData including sample weights is not supported yet."):new zA(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);o=n.validationData[0],l=n.validationData[1];const e=!0,t=await this.standardizeUserData(o,l,null,null,e,d);u=t[0],c=t[1],m=u.concat(c)}else if(null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1){g=!0;const e=Math.floor(s[0].shape[0]*(1-n.validationSplit)),t=s[0].shape[0];u=Zk(s,e,t),i=s,s=Zk(s,0,e),c=Zk(r,e,t),a=r,r=Zk(r,0,e),m=u.concat(c)}else null!=n.validationSteps&&(g=!0);const y=s.concat(r).concat(h);this.checkTrainableWeightsConsistency();const b=this.makeTrainFunction(),w=this.getDedupedMetricsNames();let v,A;g?(this.makeTestFunction(),v=this.testFunction,A=w.slice().concat(w.map((e=>"val_"+e)))):(v=null,m=[],A=w.slice());const x=rk(n.callbacks,n.yieldEvery);return await this.fitLoop(b,y,w,d,n.epochs,n.verbose,x,v,m,n.shuffle,A,n.initialEpoch,null,null)}finally{this.isTraining=!1,eS(s,e),eS(r,t),eS(i,e),eS(a,t),eS(u,o),eS(c,l),null!=h&&lh(h)}}async fitLoop(e,t,n,s,r,i,a,o,l,u,c,h,d,p){null==s&&(s=32),null==r&&(r=1),null==u&&(u=!0),null==h&&(h=0);let f=!1;if(null!=o&&null!=l&&(f=!0),null!=p&&(f=!0,null==d))throw new zA("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const m=this.checkNumSamples(t,s,d,"steps_per_epoch");let g;null!=m&&(g=Tx(0,m)),null==i&&(i=1);const{callbackList:y,history:b}=ak(a,i,r,h,m,d,s,f,c);y.setModel(this),this.history=b,await y.onTrainBegin(),this.stopTraining_=!1;for(let i=h;i{const h=a[u][0],d=a[u][1],p=Mx(i,h,d-h);c.batch=u,c.size=d-h;const m=Yk(t,p),g=e(m);for(let e=0;eHA(e)))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const s of t){if("string"!=typeof n[s])throw new Error("Serialization of non-string loss is not supported.");e[s]=HA(n[s])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[HA(Tk(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((e=>HA(Tk(e))));{const e={};for(const t in this.metrics)e[t]=HA(Tk(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=ok(zk(e.optimizer_config));let n,s;if("string"==typeof e.loss)n=$A(e.loss);else if(Array.isArray(e.loss))n=e.loss.map((e=>$A(e)));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=$A(e.loss[t])}if(Array.isArray(e.metrics))s=e.metrics.map((e=>$A(e)));else if(null!=e.metrics){s={};for(const t in e.metrics)s[t]=$A(e.metrics[t])}this.compile({loss:n,metrics:s,optimizer:t})}async save(e,t){if("string"==typeof e){const t=Dh(e);if(0===t.length)throw new zA(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new zA(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new zA("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await ph(this.getNamedWeights(t)),s={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${Pk}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){s.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await ph(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=Ch([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;Nk(this.userDefinedMetadata,this.name,e),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){Nk(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}iS.className="Model",Od(iS);class aS extends iS{}aS.className="Functional",Od(aS);class oS extends iS{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:ux("sequential_"),null!=e.layers)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some((e=>e<0)))throw new zA(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof oS||e instanceof iS;let n;if(t){if(n=e,1!==n.outputs.length)throw new zA("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new zA("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new zA("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=function(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if(null!=e.batchShape&&null!=e.shape)throw new zA("Please provide either a `shape` or `batchShape` argument to Input, but not both.");let t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));let n=e.dtype;return null==n&&(n="float32"),new RC({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new zA(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(1!==e.inboundNodes[0].outputTensors.length)throw new zA("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=OC(this.outputs[0])}this.inboundNodes=[],new IC({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:WA(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return null==this.model&&this.build(),this.model.call(e,t)}build(e){if(wC(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new iS({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},s=!1){let r,i={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new zA("Legacy serialization format not supported yet.");r=t}else Ni(null!=t.layers,(()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.")),r=t.layers,delete t.layers,i=t;const a=new e(i);if(!(a instanceof oS))throw new LA(`Sequential.fromConfig called on non-Sequential input: ${a}`);for(const e of r){const t=ok(e,void 0,s);s&&t.setFastWeightInitDuringBuild(!0),a.add(t)}return a}set stopTraining(e){if(null==this.model)throw new zA("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new zA("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}}oS.className="Sequential",Od(oS);class lS extends Td{getConfig(){return{}}}class uS extends lS{apply(e,t=1){return function(e,t=1){if(1!==t)throw new LA(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return am(e)}(e,t)}}uS.className="elu",Od(uS);class cS extends lS{apply(e){return Qg(e)}}cS.className="selu",Od(cS);class hS extends lS{apply(e){return Ug(e)}}hS.className="relu",Od(hS);class dS extends lS{apply(e){return oh((()=>lg(6,Ug(e))))}}dS.className="relu6",Od(dS);class pS extends lS{apply(e){return e}}pS.className="linear",Od(pS);class fS extends lS{apply(e){return vf(e)}}fS.className="sigmoid",Od(fS);class mS extends lS{apply(e){return function(e){return oh((()=>{const t=bd(.5,Ad(.2,e));return Mf(t,0,1)}))}(e)}}mS.className="hardSigmoid",Od(mS);class gS extends lS{apply(e){return qm(e)}}gS.className="softplus",Od(gS);class yS extends lS{apply(e){return function(e){return oh((()=>vd(e,bd(Pd(e),1))))}(e)}}yS.className="softsign",Od(yS);class bS extends lS{apply(e){return xf(e)}}bS.className="tanh",Od(bS);class wS extends lS{apply(e,t=-1){return ly(e,t)}}wS.className="softmax",Od(wS);class vS extends lS{apply(e,t=-1){return Hm(e,t)}}vS.className="logSoftmax",Od(vS);class AS extends lS{apply(e){return oh((()=>oh((()=>{const t=Math.sqrt(2),n=Ad(.5,bd(1,lm(vd(e,t))));return Ad(e,n)}))))}}AS.className="gelu",Od(AS);class xS extends lS{apply(e){return oh((()=>Ad(.5,Ad(e,bd(1,xf(Ad(xd(vd(2,Math.PI)),bd(e,Ad(.044715,Bd(e,3))))))))))}}xS.className="gelu_new",Od(xS);class CS extends lS{apply(e){return oh((()=>Ad(e,xf(qm(e)))))}}CS.className="mish",Od(CS);class kS extends lS{apply(e,t=1){return oh((()=>Ad(vf(Ad(e,t)),e)))}}function SS(e){return e.getClassName()}function _S(e,t={}){return YA(e,Nd.getMap().classNameMap,t,"activation")}function ES(e){if(null==e){const e={className:"linear",config:{}};return _S(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},_S(t)}return e instanceof lS?e:_S(e)}function IS(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}kS.className="swish",Od(kS);class TS extends Td{}class NS extends TS{constructor(e){super(),IS(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return oh((()=>{let t=ig([1]);return this.hasL1&&(t=bd(t,wm(Ad(this.l1,Pd(e))))),this.hasL2&&(t=bd(t,wm(Ad(this.l2,Ux(e))))),mf(t,[])}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}NS.className="L1L2",Od(NS);const OS={l1l2:"L1L2"};function RS(e){return XA(e)}function DS(e,t={}){return YA(e,Nd.getMap().classNameMap,t,"regularizer")}function MS(e){if(null==e)return null;if("string"==typeof e){return DS({className:e in OS?OS[e]:e,config:{}})}return e instanceof TS?e:DS(e)}class FS extends NC{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=bC(e);let n=Ug(e);return null!=this.maxValue&&(n=Mf(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}FS.className="ReLU",Od(FS);class BS extends NC{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=bC(e);return Bm(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}BS.className="LeakyReLU",Od(BS);class zS extends NC{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=mC(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=MS(e.alphaRegularizer),this.alphaConstraint=XC(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new zA(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=wC(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let t=1;t{let n=bC(e);const s=t.mask;if(null!=s){const e=Ad(zd(ag(n.shape),md(s,n.dtype)),_d(-1e9));n=bd(n,e)}return this.axis instanceof Array?this.axis.length>1?Cm(zd(n,$m(n,this.axis,!0))):this.softmax(n,this.axis[0]):this.softmax(n,this.axis)}))}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function WS(e,t,n){if("number"==typeof e)return WA(e,t);if(e.length!==t)throw new zA(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let r=0;r(gx(t),"channelsFirst"===t?Py(e,[0,2,3,1]):e)))}function jS(e,t){return oh((()=>(gx(t),"channelsFirst"===t?Py(e,[0,2,3,4,1]):e)))}function HS(e,t,n,s=1,r="valid",i,a=1){return oh((()=>{if(null==i&&(i="channelsLast"),gx(i),3!==e.shape.length)throw new zA(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new zA(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new zA(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===i&&(e=Py(e,[0,2,1])),"causal"===r)throw new LA("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=Vf(e,t,s,"same"===r?"same":"valid","NWC",a);return null!=n&&(o=jx(o,n)),o}))}function $S(e,t,n,s=[1,1],r="valid",i,a,o=null){return oh((()=>{if(null==i&&(i="channelsLast"),gx(i),3!==e.rank&&4!==e.rank)throw new zA(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new zA(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=qS(e,i);if("causal"===r)throw new LA("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=Jy({x:l,filter:t,strides:s,pad:"same"===r?"same":"valid",dilations:a,dataFormat:"NHWC",bias:n,activation:o}),"channelsFirst"===i&&(l=Py(l,[0,3,1,2])),l}))}function KS(e,t,n,s=[1,1,1],r="valid",i,a){return oh((()=>{if(null==i&&(i="channelsLast"),gx(i),4!==e.rank&&5!==e.rank)throw new zA(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new zA(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=jS(e,i);if("causal"===r)throw new LA("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=Uf(o,t,s,"same"===r?"same":"valid","NDHWC",a),null!=n&&(o=jx(o,n)),"channelsFirst"===i&&(o=Py(o,[0,4,1,2,3])),o}))}VS.className="Softmax",Od(VS);class XS extends NC{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",XS.verifyArgs(t),this.rank=e,sx(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new LA(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=WS(t.kernelSize,e,"kernelSize"),this.strides=WS(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,yx(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,gx(this.dataFormat),this.activation=ES(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=mC(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=XC(t.biasConstraint),this.biasRegularizer=MS(t.biasRegularizer),this.activityRegularizer=MS(t.activityRegularizer),this.dilationRate=WS(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new zA(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new zA(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new zA(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(GA("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!nx(e.kernelSize,"number",1,3))throw new zA(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:SS(this.activation),useBias:this.useBias,biasInitializer:fC(this.biasInitializer),biasRegularizer:RS(this.biasRegularizer),activityRegularizer:RS(this.activityRegularizer),biasConstraint:$C(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class ZS extends XS{constructor(e,t){super(e,t),this.kernel=null,ZS.verifyArgs(t),this.filters=t.filters,sx(this.filters,"filters"),this.kernelInitializer=mC(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=XC(t.kernelConstraint),this.kernelRegularizer=MS(t.kernelRegularizer)}build(e){e=wC(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new zA(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],s=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return oh((()=>{let t;e=bC(e);const n=null==this.bias?null:this.bias.read(),s=ix(this.activation.getClassName());if(null!=s&&2===this.rank)t=$S(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,s);else{if(1===this.rank)t=HS(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=$S(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new LA("convolutions greater than 3D are not implemented yet.");t=KS(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t}))}computeOutputShape(e){e=wC(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e 0 but got ${JSON.stringify(e.filters)}`)}}class YS extends ZS{constructor(e){super(2,e),YS.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!nx(e.kernelSize,"number",1,2))throw new zA(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}YS.className="Conv2D",Od(YS);class QS extends ZS{constructor(e){super(3,e),QS.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new zA(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}QS.className="Conv3D",Od(QS);class JS extends YS{constructor(e){if(super(e),this.inputSpec=[new SC({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new zA(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=wC(e)).length)throw new zA("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new zA("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new SC({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return oh((()=>{let t=bC(e);if(4!==t.shape.length)throw new zA(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,i;"channelsFirst"===this.dataFormat?(r=2,i=3):(r=1,i=2);const a=n[r],o=n[i],l=this.kernelSize[0],u=this.kernelSize[1],c=this.strides[0],h=this.strides[1],d=[s,US(a,c,l,this.padding),US(o,h,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Py(t,[0,2,3,1]));let p=Gf(t,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=Py(p,[0,3,1,2])),null!=this.bias&&(p=jx(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p}))}computeOutputShape(e){const t=(e=wC(e)).slice();let n,s,r;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3):(n=3,s=1,r=2);const i=this.kernelSize[0],a=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[s]=US(t[s],o,i,this.padding),t[r]=US(t[r],l,a,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}JS.className="Conv2DTranspose",Od(JS);class e_ extends QS{constructor(e){if(super(e),this.inputSpec=[new SC({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new zA(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=wC(e)).length)throw new zA("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new zA("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new SC({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return oh((()=>{let t=bC(e);if(5!==t.shape.length)throw new zA(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,i,a;"channelsFirst"===this.dataFormat?(a=2,r=3,i=4):(a=1,r=2,i=3);const o=n[a],l=n[r],u=n[i],c=this.kernelSize[0],h=this.kernelSize[1],d=this.kernelSize[2],p=this.strides[0],f=this.strides[1],m=this.strides[2],g=[s,US(o,p,c,this.padding),US(l,f,h,this.padding),US(u,m,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Py(t,[0,2,3,4,1]));let y=jf(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=Py(y,[0,4,1,2,3])),null!==this.bias&&(y=jx(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(e){const t=(e=wC(e)).slice();let n,s,r,i;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3,i=4):(n=4,s=1,r=2,i=3);const a=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],c=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[s]=US(t[s],u,a,this.padding),t[r]=US(t[r],c,o,this.padding),t[i]=US(t[i],h,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}e_.className="Conv3DTranspose",Od(e_);class t_ extends ZS{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new zA("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new zA("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new zA(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=mC(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=MS(t.depthwiseRegularizer),this.depthwiseConstraint=XC(t.depthwiseConstraint),this.pointwiseInitializer=mC(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=MS(t.pointwiseRegularizer),this.pointwiseConstraint=XC(t.pointwiseConstraint)}build(e){if((e=wC(e)).length{let t;if(e=bC(e),1===this.rank)throw new LA("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=Py(e,[0,2,3,1])),t=Jg(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=jx(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=Py(t,[0,3,1,2])),t}))}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=fC(this.depthwiseInitializer),e.pointwiseInitializer=fC(this.pointwiseInitializer),e.depthwiseRegularizer=RS(this.depthwiseRegularizer),e.pointwiseRegularizer=RS(this.pointwiseRegularizer),e.depthwiseConstraint=$C(this.depthwiseConstraint),e.pointwiseConstraint=$C(this.pointwiseConstraint),e}}t_.className="SeparableConv";class n_ extends t_{constructor(e){super(2,e)}}n_.className="SeparableConv2D",Od(n_);class s_ extends ZS{constructor(e){super(1,e),s_.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!nx(e.kernelSize,"number",1,1))throw new zA(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}s_.className="Conv1D",Od(s_);class r_ extends NC{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return oh((()=>{if(e=bC(e),"channelsLast"===this.dataFormat){const t=Bx(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Bx(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=Bx(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Bx(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}}))}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}r_.className="Cropping2D",Od(r_);class i_ extends NC{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,tx(hx,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}{const t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return oh((()=>{let t=bC(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=Py(t,[0,2,3,1]);const e=this.size[0]*n[2],s=this.size[1]*n[3],r="nearest"===this.interpolation?sw.resizeNearestNeighbor(t,[e,s]):sw.resizeBilinear(t,[e,s]);return Py(r,[0,3,1,2])}{const e=this.size[0]*n[1],s=this.size[1]*n[2];return"nearest"===this.interpolation?sw.resizeNearestNeighbor(t,[e,s]):sw.resizeBilinear(t,[e,s])}}))}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}}i_.className="UpSampling2D",Od(i_);class a_ extends XS{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=mC(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=XC(e.depthwiseConstraint),this.depthwiseRegularizer=MS(e.depthwiseRegularizer)}build(e){if((e=wC(e)).length<4)throw new zA(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new zA(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],s=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",s,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return oh((()=>{let t=function(e,t,n=[1,1],s="valid",r,i){return oh((()=>{null==r&&(r="channelsLast"),gx(r);let a=qS(e,r);if(4!==e.rank)throw new zA(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new zA(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return a=Qf(a,t,n,"same"===s?"same":"valid","NHWC",i),"channelsFirst"===r&&(a=Py(a,[0,3,1,2])),a}))}(e=bC(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=jx(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t}))}computeOutputShape(e){e=wC(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=GS(t,this.kernelSize[0],this.padding,this.strides[0]),i=GS(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],s,r,i]:[e[0],r,i,s]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=fC(this.depthwiseInitializer),e.depthwiseRegularizer=RS(this.depthwiseRegularizer),e.depthwiseConstraint=$C(this.depthwiseRegularizer),e}}function o_(e,t,n,s){if(Array.isArray(e)){if(null!=t||null!=n)throw new zA("When inputs is an array, neither initialState or constants should be provided");null!=s&&(n=e.slice(e.length-s,e.length),e=e.slice(0,e.length-s)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=r(t),constants:n=r(n)}}function l_(e,t,n,s=!1,r,i,a=!1,o=!1){return oh((()=>{const a=t.shape.length;if(a<3)throw new zA(`Input should be at least 3D, but is ${a}D.`);const l=[1,0].concat(Tx(2,a));if(t=Py(t,l),null!=i)throw new LA("The rnn() functoin of the deeplearn.js backend does not support constants yet.");null!=r&&((r=md(md(r,"bool"),"float32")).rank===a-1&&(r=km(r,-1)),r=Py(r,l)),s&&(t=jg(t,0),null!=r&&(r=jg(r,0)));const u=[];let c,h=n;const d=t.shape[0],p=Dy(t);let f,m;null!=r&&(f=Dy(r));for(let t=0;te(n,h)));if(null==r)c=s[0],h=s[1];else{const e=oh((()=>{const e=f[t],n=zd(gg(e),e);return{output:bd(Ad(s[0],e),Ad(h[0],n)),newStates:h.map(((t,r)=>bd(Ad(s[1][r],e),Ad(t,n))))}}));c=e.output,h=e.newStates}o&&u.push(c)}if(o){m=gy(u,1)}return[c,m,h]}))}a_.className="DepthwiseConv2D",Od(a_);class u_ extends NC{constructor(e){let t;if(super(e),null==e.cell)throw new zA("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new y_({cells:e.cell}):e.cell,null==t.stateSize)throw new zA("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new SC({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return Tx(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((e=>null))}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){gC(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let s;if(s=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const s of t)n.push([e[0],s]);return[s].concat(n)}return s}computeMask(e,t){return oh((()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map((e=>null));return[e].concat(t)}return e}))}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ne.shape[e.shape.length-1])),r))throw new zA(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map((e=>new SC({shape:[null,e]})));this.stateful&&this.resetStates()}resetStates(e,t=!1){oh((()=>{if(!this.stateful)throw new FA("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new zA("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>ig([n,e]))):this.states_=[ig([n,this.cell.stateSize])];else if(null==e)lh(this.states_),null!=this.keptStates&&(lh(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>ig([n,e]))):this.states_[0]=ig([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new zA(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):lh(this.states_);for(let t=0;tuh(e.clone())))}))}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=o_(e,n,s,this.numConstants);e=r.inputs,n=r.initialState,s=r.constants;let i=[],a=[];if(null!=n){t.initialState=n,i=i.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new SC({shape:e.shape}));a=a.concat(this.stateSpec)}null!=s&&(t.constants=s,i=i.concat(s),this.numConstants=s.length);if(i[0]instanceof _C){const n=[e].concat(i),s=this.inputSpec.concat(a),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return oh((()=>{const n=null==t?null:t.mask,s=null==t?null:t.training;let r=null==t?null:t.initialState;e=bC(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const i=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==i)throw new zA(`RNN Layer has ${i} state(s) but was passed ${r.length} initial state(s).`);this.unroll;const a={training:s},o=l_(((e,t)=>{const n=this.cell.call([e].concat(t),a);return[n[0],n.slice(1)]}),e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],u=o[1],c=o[2];this.stateful&&this.resetStates(c,s);const h=this.returnSequences?u:l;return this.returnState?[h].concat(c):h}))}getInitialState(e){return oh((()=>{let t=ig(e.shape);return t=wm(t,[1,2]),t=Dx(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((e=>e>1?Px(t,[1,e]):t)):this.cell.stateSize>1?[Px(t,[1,this.cell.stateSize])]:[t]}))}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===u_.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign(Object.assign(Object.assign({},n),e),t)}static fromConfig(e,t,n={}){const s=ok(t.cell,n);return new e(Object.assign(t,{cell:s}))}}u_.className="RNN",Od(u_);class c_ extends NC{}class h_ extends c_{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,sx(this.units,"units"),this.activation=ES(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=mC(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=MS(e.kernelRegularizer),this.recurrentRegularizer=MS(e.recurrentRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.kernelConstraint=XC(e.kernelConstraint),this.recurrentConstraint=XC(e.recurrentConstraint),this.biasConstraint=XC(e.biasConstraint),this.dropout=Ex([1,Ix([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ex([1,Ix([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=wC(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return oh((()=>{if(2!==e.length)throw new zA(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const s=null!=t.training&&t.training;let r;0gg(e),rate:this.dropout,training:s,dropoutFunc:this.dropoutFunc})),0gg(n),rate:this.recurrentDropout,training:s,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;r=Wx(null!=i?Ad(e,i):e,this.kernel.read()),null!=this.bias&&(r=jx(r,this.bias.read())),null!=a&&(n=Ad(n,a));let o=bd(r,Wx(n,this.recurrentKernel.read()));return null!=this.activation&&(o=this.activation.apply(o)),[o,o]}))}getConfig(){const e=super.getConfig(),t={units:this.units,activation:SS(this.activation),useBias:this.useBias,kernelInitializer:fC(this.kernelInitializer),recurrentInitializer:fC(this.recurrentInitializer),biasInitializer:fC(this.biasInitializer),kernelRegularizer:RS(this.kernelRegularizer),recurrentRegularizer:RS(this.recurrentRegularizer),biasRegularizer:RS(this.biasRegularizer),activityRegularizer:RS(this.activityRegularizer),kernelConstraint:$C(this.kernelConstraint),recurrentConstraint:$C(this.recurrentConstraint),biasConstraint:$C(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}h_.className="SimpleRNNCell",Od(h_);class d_ extends u_{constructor(e){e.cell=new h_(e),super(e)}call(e,t){return oh((()=>{null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return new e(t)}}d_.className="SimpleRNN",Od(d_);class p_ extends c_{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new zA("GRUCell does not support reset_after parameter set to true.");this.units=e.units,sx(this.units,"units"),this.activation=ES(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ES(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=mC(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=MS(e.kernelRegularizer),this.recurrentRegularizer=MS(e.recurrentRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.kernelConstraint=XC(e.kernelConstraint),this.recurrentConstraint=XC(e.recurrentConstraint),this.biasConstraint=XC(e.biasConstraint),this.dropout=Ex([1,Ix([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ex([1,Ix([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=wC(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return oh((()=>{if(2!==e.length)throw new zA(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let s=e[1];e=e[0],0gg(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0gg(s),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,i=this.recurrentDropoutMask;let a,o,l;0{null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}f_.className="GRU",Od(f_);class m_ extends c_{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,sx(this.units,"units"),this.activation=ES(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ES(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=mC(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=MS(e.kernelRegularizer),this.recurrentRegularizer=MS(e.recurrentRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.kernelConstraint=XC(e.kernelConstraint),this.recurrentConstraint=XC(e.recurrentConstraint),this.biasConstraint=XC(e.biasConstraint),this.dropout=Ex([1,Ix([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ex([1,Ix([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const n=(e=wC(e))[e.length-1];let s;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,n=this.units;s=new((t=class extends Zx{apply(t,s){const r=e.apply([n]),i=(new Qx).apply([n]),a=e.apply([2*n]);return Lx(Lx(r,i),a)}}).className="CustomInit",t)}else s=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,s,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return oh((()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new zA(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let s=e[1];const r=e[2];e=e[0],0gg(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0gg(s),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;let o,l,u,c;0{null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}g_.className="LSTM",Od(g_);class y_ extends c_{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return oh((()=>{let n=e.slice(1);const s=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?s.push(n.splice(0,e.stateSize.length)):s.push(n.splice(0,1));s.reverse();const r=[];let i;for(let a=0;a{Ax(`RNNCell_${s}`,(()=>{n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]}))})),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map((e=>({className:e.getClassName(),config:e.getConfig()})))};return Object.assign(Object.assign({},e),t)}static fromConfig(e,t,n={}){const s=[];for(const e of t.cells)s.push(ok(e,n));return new e({cells:s})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return CC(e)}setWeights(e){const t=[];for(const n of this.cells){const s=n.weights.length,r=e.splice(s);for(let e=0;enull!=i?i(t(),n):Hx(t(),n),o=()=>$x(a,t,s);if(!r||r<=1)return uh(o().clone());return Array(r).fill(void 0).map(o).map((e=>uh(e.clone())))}y_.className="StackedRNNCells",Od(y_);var w_=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r{if(null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new zA("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return oh((()=>{const{stateSize:t}=this.cell,n=e.shape,s=this.computeSingleOutputShape(n),r=ig([s[0],...s.slice(2)]);return Array.isArray(t)?Array(t.length).fill(r):[r]}))}resetStates(e,t=!1){oh((()=>{if(!this.stateful)throw new FA("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,s=this.computeSingleOutputShape(n),r=[s[0],...s.slice(2)];if(null==n[0])throw new zA("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>ig(r))):this.states_=[ig(r)];else if(null==e)lh(this.states_),null!=this.keptStates&&(lh(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>ig(r))):this.states_[0]=ig(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new zA(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):lh(this.states_);for(let t=0;tuh(e.clone())))}))}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:s,padding:r,strides:i,dilationRate:a}=this.cell,o="channelsFirst"===t,l=e[o?3:2],u=e[o?4:3],c=GS(l,s[0],r,i[0],a[0]),h=GS(u,s[1],r,i[1],a[1]);return[...e.slice(0,2),...o?[n,c,h]:[c,h,n]]}}v_.className="ConvRNN2D";class A_ extends m_{constructor(e){const{filters:t,kernelSize:n,strides:s,padding:r,dataFormat:i,dilationRate:a}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,sx(this.filters,"filters"),this.kernelSize=WS(n,2,"kernelSize"),this.kernelSize.forEach((e=>sx(e,"kernelSize"))),this.strides=WS(s||1,2,"strides"),this.strides.forEach((e=>sx(e,"strides"))),this.padding=r||"valid",yx(this.padding),this.dataFormat=i||"channelsLast",gx(this.dataFormat),this.dilationRate=WS(a||1,2,"dilationRate"),this.dilationRate.forEach((e=>sx(e,"dilationRate")))}build(e){var t;e=wC(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new zA(`The channel dimension of the input should be defined. Found ${e[n]}`);const s=e[n],r=this.kernelSize.concat([s,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const i=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,s=this.filters;e=new((t=class extends Zx{apply(e,t){return zx([n.apply([s]),ag([s]),n.apply([2*s])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return oh((()=>{if(3!==e.length)throw new zA(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,s=e[0],r=e[1],i=e[2];0gg(s),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,o=(e,t,n)=>t&&t[n]?Ad(t[n],e):e;let l=o(s,a,0),u=o(s,a,1),c=o(s,a,2),h=o(s,a,3);0gg(r),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const d=this.recurrentDropoutMask;let p=o(r,d,0),f=o(r,d,1),m=o(r,d,2),g=o(r,d,3);const[y,b,w,v]=dy(this.kernel.read(),4,3),[A,x,C,k]=this.useBias?dy(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,A,this.padding),u=this.inputConv(u,b,x,this.padding),c=this.inputConv(c,w,C,this.padding),h=this.inputConv(h,v,k,this.padding);const[S,_,E,I]=dy(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,S),f=this.recurrentConv(f,_),m=this.recurrentConv(m,E),g=this.recurrentConv(g,I);const T=this.recurrentActivation.apply(bd(l,p)),N=this.recurrentActivation.apply(bd(u,f)),O=bd(Ad(N,i),Ad(T,this.activation.apply(bd(c,m)))),R=Ad(this.recurrentActivation.apply(bd(h,g)),this.activation.apply(O));return[R,R,O]}))}getConfig(){const e=super.getConfig(),{units:t}=e,n=w_(e,["units"]),s={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},n),s)}inputConv(e,t,n,s){const r=Pf(e,t,this.strides,s||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?jx(r,n,this.dataFormat):r}recurrentConv(e,t){return Pf(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}A_.className="ConvLSTM2DCell",Od(A_);class x_ extends v_{constructor(e){const t=new A_(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}x_.className="ConvLSTM2D",Od(x_);class C_ extends NC{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(null==this.noiseShape)return this.noiseShape;const t=e.shape,n=[];for(let e=0;e{this.invokeCallHook(e,t);const n=bC(e);if(0Hx(n,this.rate,s,this.seed)),(()=>n),e)}return e}))}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}C_.className="Dropout",Od(C_);class k_ extends C_{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}k_.className="SpatialDropout1D",Od(k_);class S_ extends NC{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,sx(this.units,"units"),this.activation=ES(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=XC(e.kernelConstraint),this.biasConstraint=XC(e.biasConstraint),this.kernelRegularizer=MS(e.kernelRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.activityRegularizer=MS(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=wC(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){const t=(e=wC(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e),s=ix(this.activation.getClassName());let r;return null!=s?r=Wx(n,this.kernel.read(),s,this.bias?this.bias.read():null):(r=Wx(n,this.kernel.read()),null!=this.bias&&(r=jx(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r}))}getConfig(){const e={units:this.units,activation:SS(this.activation),useBias:this.useBias,kernelInitializer:fC(this.kernelInitializer),biasInitializer:fC(this.biasInitializer),kernelRegularizer:RS(this.kernelRegularizer),biasRegularizer:RS(this.biasRegularizer),activityRegularizer:RS(this.activityRegularizer),kernelConstraint:$C(this.kernelConstraint),biasConstraint:$C(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}S_.className="Dense",Od(S_);class __ extends NC{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=wC(e);for(const t of e.slice(1))if(null==t)throw new zA(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],_x(e,1)]}call(e,t){return oh((()=>{this.invokeCallHook(e,t);let n=bC(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=bC(e);return this.activation.apply(n)}))}getConfig(){const e={activation:SS(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}E_.className="Activation",Od(E_);class I_ extends NC{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return oh((()=>{return e=bC(e),t=e,n=this.n,oh((()=>{if(2!==t.shape.length)throw new zA(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return Px(Dx(t,1),[1,n,1])}));var t,n}))}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}I_.className="RepeatVector",Od(I_);class T_ extends NC{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=bC(e),s=n.shape,r=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return mf(n,r)}))}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}T_.className="Reshape",Od(T_);class N_ extends NC{constructor(e){if(super(e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const t=Tx(1,e.dims.length+1);if(!Mi(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new SC({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=wC(e)).slice();return this.dims.forEach(((n,s)=>{t[s+1]=e[n]})),t}call(e,t){return Py(bC(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}N_.className="Permute",Od(N_);class O_ extends NC{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const n=bC(e);return jp(fg(n,this.maskValue),-1)}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e),s=jp(fg(n,this.maskValue),-1,!0);return Ad(n,md(s,n.dtype))}))}}O_.className="Masking",Od(O_);class R_ extends NC{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(jA(e.inputLength))}this.inputDim=e.inputDim,sx(this.inputDim,"inputDim"),this.outputDim=e.outputDim,sx(this.outputDim,"outputDim"),this.embeddingsInitializer=mC(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=MS(e.embeddingsRegularizer),this.activityRegularizer=MS(e.activityRegularizer),this.embeddingsConstraint=XC(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return oh((()=>this.maskZero?(e=bC(e),fg(e,kd(e))):null))}computeOutputShape(e){if(e=wC(e),null==this.inputLength)return[...e,this.outputDim];const t=jA(this.inputLength);if(t.length!==e.length-1)throw new zA(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let s=0;s{this.invokeCallHook(e,t);let n=bC(e);"int32"!==n.dtype&&(n=Rx(n,"int32"));const s=Gx(this.embeddings.read(),mf(n,[n.size]));return mf(s,wC(this.computeOutputShape(n.shape)))}))}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:fC(this.embeddingsInitializer),embeddingsRegularizer:RS(this.embeddingsRegularizer),activityRegularizer:RS(this.activityRegularizer),embeddingsConstraint:$C(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}R_.className="Embedding",Od(R_);class D_ extends NC{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new LA}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new zA(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=null==e[0]?null:e[0].slice(1);for(let t=1;te.length));-1===e.indexOf(null)&&1===JA(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return oh((()=>{if(this.reshapeRequired){const t=[],n=e.map((e=>e.rank));if(-1===n.indexOf(null)){const s=Ix(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=Tx(1,e).concat([0]);t.push(Py(s,r)),n=!0}else t.push(s)}let s=this.mergeFunction(t);const r=s.rank;if(n)if(null==r){const e=s.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));s=mf(Py(mf(s,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(Tx(0,r-1));s=Py(s,e)}return s}}return this.mergeFunction(e)}))}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n{if(null==t)return null;if(!Array.isArray(t))throw new zA("`mask` should be an Array");if(!Array.isArray(e))throw new zA("`inputs` should be an Array");if(t.length!==e.length)throw new zA(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every((e=>null==e)))return null;let n=(t=t.map((e=>null==e?e:km(e,0))))[0];for(let e=1;e{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new zA("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return oh((()=>zx(e,this.axis)))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new zA("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),s=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[s]||null==e[s]){n[s]=null;break}n[s]+=e[s]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new zA("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new zA("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new zA(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return oh((()=>{let n=!0;if(t.forEach((e=>{null==e||(n=!1)})),n)return null;const s=[];for(let n=0;n"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0],n=e[1];if(t.length>3||n.length>3)throw new LA("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);if(t[s[0]]!==n[s[1]])throw new zA(`Dimension incompatibility: ${t[s[0]]} !== ${n[s[1]]}`)}mergeFunction(e){if(2!==e.length)throw new zA(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],s=e[1];return t=Array.isArray(this.axes)?this.axes.map(((t,n)=>V_(t,e[n].shape.length))):[V_(this.axes,n.shape.length),V_(this.axes,s.shape.length)],this.normalize&&(n=lk(n,t[0]),s=lk(s,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new LA("batchDot is not implemented for tensors of 4D or higher rank yet");if(Ni(e.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`)),Ni(e.shape.length>=2,(()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`)),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new LA("batchDot is not implemented for complex64-type Tensors yet.");const s=e.shape.length,r=t.shape.length;null==n&&(n=[s-1,r-2]);const i=n;return oh((()=>{let n,a;if(s>r){n=s-r;const e=[];for(let t=0;ts){n=r-s;const t=[];for(let e=0;e0){let e;e=s>r?s+r-3:s-1;const t=[];for(let s=e;s"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new LA("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);t.splice(s[0],1),n.splice(s[1],1),n.splice(0,1);const r=t.concat(n);return 1===r.length&&r.push(1),r}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}W_.className="Dot",Od(W_);class G_ extends NC{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e);return $x((()=>bd(Vx(n.shape,0,this.stddev),n)),(()=>n),t.training||!1)}))}}G_.className="GaussianNoise",Od(G_);class U_ extends NC{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e);if(this.rate>0&&this.rate<1){return $x((()=>{const e=Math.sqrt(this.rate/(1-this.rate));return Ad(n,Vx(n.shape,1,e))}),(()=>n),t.training||!1)}return n}))}}U_.className="GaussianDropout",Od(U_);class q_ extends NC{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||bC(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return oh((()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e),s=()=>{const t=bC(e),s=-1.7580993408473766;let r=Om(Lg(n),this.rate);r=Rx(r,"float32");const i=((1-this.rate)*(1+this.rate*s**2))**-.5,a=-i*s*this.rate,o=bd(Ad(t,r),Ad(bd(r,-1),s));return bd(Ad(o,i),a)};return $x(s,(()=>bC(e)),t.training||!1)}return e}))}}function j_(e,t,n,s,r,i=.001){let a;if(2===e.rank)a=_f(e,t,n,s,r,i);else if(3===e.rank)a=Ef(e,t,n,s,r,i);else{if(4!==e.rank)throw new LA(`batchNormalization is not implemented for array of rank ${e.rank} yet`);a=If(e,t,n,s,r,i)}return a}function H_(e,t,n,s,r=.001){return Mi(s.slice().sort(),Tx(0,e.rank-1))?function(e,t,n,s,r=.001){return oh((()=>{const i=hg(e,s),a=i.mean,o=i.variance;return[j_(e,a,o,n,t,r),a,o]}))}(e,t,n,s,r):function(e,t,n,s,r=.001){return oh((()=>{const i=hg(e,s),a=i.mean,o=i.variance,l=[];for(const t of Tx(0,e.rank))-1!==s.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=mf(a,l),c=mf(o,l),h=null==t?null:mf(t,l),d=null==n?null:mf(n,l);return[j_(e,u,c,d,h,r),a,o]}))}(e,t,n,s,r)}q_.className="AlphaDropout",Od(q_);class $_ extends NC{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=mC(e.betaInitializer||"zeros"),this.gammaInitializer=mC(e.gammaInitializer||"ones"),this.movingMeanInitializer=mC(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=mC(e.movingVarianceInitializer||"ones"),this.betaConstraint=XC(e.betaConstraint),this.gammaConstraint=XC(e.gammaConstraint),this.betaRegularizer=MS(e.betaRegularizer),this.gammaRegularizer=MS(e.gammaRegularizer)}build(e){e=wC(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new zA(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new SC({ndim:e.length,axes:{[t]:n}})];const s=[n];this.scale&&(this.gamma=this.addWeight("gamma",s,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",s,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",s,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",s,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return oh((()=>{const n=null!=t.training&&t.training,s=bC(e),r=s.shape,i=r.length,a=Tx(0,i),o=this.axis>=0?this.axis:this.axis+i;a.splice(o,1);const l=WA(1,i);l[o]=r[o];const u=a.slice();u.sort();const c=!Mi(u,Tx(0,i).slice(0,i-1));if(!n)return(()=>{if(c){const e=mf(this.movingMean.read(),l),t=mf(this.movingVariance.read(),l),n=this.center?mf(this.beta.read(),l):null,r=this.scale?mf(this.gamma.read(),l):null;return j_(s,e,t,n,r,this.epsilon)}return j_(s,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[h,d,p]=H_(s,this.gamma.read(),this.beta.read(),a,this.epsilon),f=(e,t,n)=>{oh((()=>{const s=1-n,r=e.read(),i=Ad(zd(r,t),s);e.write(zd(r,i))}))};return(()=>{f(this.movingMean,d,this.momentum),f(this.movingVariance,p,this.momentum)})(),h}))}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:fC(this.betaInitializer),gammaInitializer:fC(this.gammaInitializer),movingMeanInitializer:fC(this.movingMeanInitializer),movingVarianceInitializer:fC(this.movingVarianceInitializer),betaRegularizer:RS(this.betaRegularizer),gammaRegularizer:RS(this.gammaRegularizer),betaConstraint:$C(this.betaConstraint),gammaConstraint:$C(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}$_.className="BatchNormalization",Od($_);class K_ extends NC{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=mC(e.betaInitializer||"zeros"),this.gammaInitializer=mC(e.gammaInitializer||"ones"),this.betaRegularizer=MS(e.betaRegularizer),this.gammaRegularizer=MS(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=wC(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==JA(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map((t=>e[t])),s=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,s):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,s):this.beta=null,this.built=!0}call(e,t){const n=bC(e),s=n.shape,r=s.length;return oh((()=>{let{mean:e,variance:t}=hg(n,this.axis,!0);const i=WA(1,r);for(const e of this.axis)i[e]=s[e];const a=e=>null!=e&&e.shape.length!==r?mf(e,i):e;let o=this.scale?a(this.gamma.read()):null,l=this.center?a(this.beta.read()):null;const u=[],c=[];for(let e=0;e=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}call(e,t){return oh((()=>{return t=bC(e),n=this.padding,s=this.dataFormat,oh((()=>{if(4!==t.rank)throw new zA(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new zA("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==s&&(s="channelsLast"),"channelsLast"!==s&&"channelsFirst"!==s)throw new zA(`Unknown data format: ${s}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===s?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],bg(t,e)}));var t,n,s}))}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}function Z_(e,t,n,s,r,i){return oh((()=>{let a;gx(r),bx(i),yx(s),null==n&&(n=[1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=qS(e,r);const o="same"===s?"same":"valid";return a="max"===i?tg(e,t,n,o):gf(e,t,n,o),"channelsFirst"===r&&(a=Py(a,[0,3,1,2])),a}))}function Y_(e,t,n,s,r,i){return oh((()=>{let a;gx(r),bx(i),yx(s),null==n&&(n=[1,1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=jS(e,r);const o="same"===s?"same":"valid";return a="max"===i?ng(e,t,n,o):yf(e,t,n,o),"channelsFirst"===r&&(a=Py(a,[0,4,1,2,3])),a}))}X_.className="ZeroPadding2D",Od(X_);class Q_ extends NC{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new zA(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if(sx(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new zA(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}sx(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,yx(this.padding),this.inputSpec=[new SC({ndim:3})]}computeOutputShape(e){const t=GS((e=wC(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return oh((()=>{this.invokeCallHook(e,t),e=Dx(bC(e),2);const n=this.poolingFunction(bC(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return my(n,[2])}))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class J_ extends Q_{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"max")}}J_.className="MaxPooling1D",Od(J_);class eE extends Q_{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"avg")}}eE.className="AveragePooling1D",Od(eE);class tE extends NC{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new zA(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];sx(this.poolSize,"poolSize"),sx(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),yx(this.padding),this.inputSpec=[new SC({ndim:4})]}computeOutputShape(e){e=wC(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=GS(t,this.poolSize[0],this.padding,this.strides[0]),n=GS(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return oh((()=>(this.invokeCallHook(e,t),this.poolingFunction(bC(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class nE extends tE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"max")}}nE.className="MaxPooling2D",Od(nE);class sE extends tE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"avg")}}sE.className="AveragePooling2D",Od(sE);class rE extends NC{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new zA(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];sx(this.poolSize,"poolSize"),sx(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),yx(this.padding),this.inputSpec=[new SC({ndim:5})]}computeOutputShape(e){e=wC(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[4]:e[3];return t=GS(t,this.poolSize[0],this.padding,this.strides[0]),n=GS(n,this.poolSize[1],this.padding,this.strides[1]),s=GS(s,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,s]:[e[0],t,n,s,e[4]]}call(e,t){return oh((()=>(this.invokeCallHook(e,t),this.poolingFunction(bC(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class iE extends rE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Y_(e,t,n,s,r,"max")}}iE.className="MaxPooling3D",Od(iE);class aE extends rE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Y_(e,t,n,s,r,"avg")}}aE.className="AveragePooling3D",Od(aE);class oE extends NC{constructor(e){super(e),this.inputSpec=[new SC({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new LA}}class lE extends oE{constructor(e){super(e||{})}call(e,t){return oh((()=>{const t=bC(e);return rg(t,1)}))}}lE.className="GlobalAveragePooling1D",Od(lE);class uE extends oE{constructor(e){super(e||{})}call(e,t){return oh((()=>{const t=bC(e);return ym(t,1)}))}}uE.className="GlobalMaxPooling1D",Od(uE);class cE extends NC{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),this.inputSpec=[new SC({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new LA}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class hE extends cE{call(e,t){return oh((()=>{const t=bC(e);return"channelsLast"===this.dataFormat?rg(t,[1,2]):rg(t,[2,3])}))}}hE.className="GlobalAveragePooling2D",Od(hE);class dE extends cE{call(e,t){return oh((()=>{const t=bC(e);return"channelsLast"===this.dataFormat?ym(t,[1,2]):ym(t,[2,3])}))}}dE.className="GlobalMaxPooling2D",Od(dE);class pE extends NC{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){const s=ok(t.layer,n);delete t.layer;const r={layer:s};return Object.assign(r,t),new e(r)}}class fE extends pE{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=wC(e)).length<3)throw new zA(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=wC(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),s=e[1];return[n[0],s].concat(n.slice(1))}call(e,t){return oh((()=>l_(((e,n)=>[bC(this.layer.call(e,t)),[]]),e=bC(e),[],!1,null,null,!1,!0)[1]))}}fE.className="TimeDistributed",Od(fE);class mE extends pE{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=ok(n),t.goBackwards=!0!==t.goBackwards;const s={};var r;if(s.className=e.layer.getClassName(),s.config=t,this.backwardLayer=ok(s),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,r=this.mergeMode,tx(fx,"BidirectionalMergeMode",r),e.weights)throw new LA("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t,n,s,r=this.forwardLayer.computeOutputShape(e);return Array.isArray(r)&&Array.isArray(r[0])||(r=[r]),this.returnState?(s=r.slice(1),t=r[0]):t=r[0],"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(s).concat(s.slice()):[t].concat(s).concat(s.slice()):qA(n)}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=o_(e,n,s,this.numConstants);if(e=r.inputs,n=r.initialState,s=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==s)return super.apply(e,t);const i=[],a=[];if(null!=n){const e=n.length;if(e%2>0)throw new zA("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,i.push(...n);const s=n.map((e=>new SC({shape:e.shape})));this.forwardLayer.stateSpec=s.slice(0,e/2),this.backwardLayer.stateSpec=s.slice(e/2),a.push(...s)}if(null!=s)throw new LA("Support for constants in Bidirectional layers is not implemented yet.");const o=i[0]instanceof _C;for(const e of i)if(e instanceof _C!==o)throw new zA("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){const n=[e].concat(i),s=this.inputSpec.concat(a),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return oh((()=>{const n=t.initialState;let s,r,i,a;if(null==n)s=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const i=n.slice(0,n.length/2),a=n.slice(n.length/2);s=this.forwardLayer.call(e,Object.assign(t,{initialState:i})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:a}))}return this.returnState&&(Array.isArray(s)&&(i=s.slice(1).concat(r.slice(1))),s=s[0],r=r[0]),this.returnSequences&&(r=jg(r,1)),"concat"===this.mergeMode?a=zx([s,r]):"sum"===this.mergeMode?a=bd(s,r):"ave"===this.mergeMode?a=Ad(.5,bd(s,r)):"mul"===this.mergeMode?a=Ad(s,r):null==this.mergeMode&&(a=[s,r]),this.returnState?null==this.mergeMode?a.concat(i):[a].concat(i):a}))}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ax(this.forwardLayer.name,(()=>{this.forwardLayer.build(e)})),Ax(this.backwardLayer.name,(()=>{this.backwardLayer.build(e)})),this.built=!0}computeMask(e,t){let n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map((e=>null));return Array.isArray(n)?n.concat(e).concat(e):[n].concat(e).concat(e)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const n=ok(t.layer);if(delete t.layer,null!=t.numConstants)throw new LA("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=t;return s.layer=n,new e(s)}}mE.className="Bidirectional",Od(mE);class gE extends NC{constructor(e){super(e),this.scale=e.scale,e.offset?this.offset=e.offset:this.offset=0}getConfig(){const e={scale:this.scale,offset:this.offset},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return oh((()=>("float32"!==(e=bC(e)).dtype&&(e=Rx(e,"float32")),bd(Ad(e,this.scale),this.offset))))}}gE.className="Rescaling",Od(gE);const{resizeBilinear:yE,cropAndResize:bE}=sw;class wE extends NC{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,s,r,i,a,o){return oh((()=>{let l,u=!1;const c=[t/i,n/a,(s+t)/i,(r+n)/a],h=[];3===e.rank?(u=!0,l=gy([e])):l=e;for(let e=0;eRx(yE(e,[t,n]),s)))}call(e,t){return oh((()=>{const t=bC(e),n=t.dtype,s=t.shape,r=s[s.length-3],i=s[s.length-2];let a=0;r!==this.height&&(a=Math.floor((r-this.height)/2));let o=0;return i!==this.width&&(o=Math.floor((i-this.width)/2),0===o&&(o=1)),a>=0&&o>=0?this.centerCrop(t,a,o,this.height,this.width,r,i,n):this.upsize(e,this.height,this.width,n)}))}getConfig(){const e={height:this.height,width:this.width},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){const t=(e=wC(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}wE.className="CenterCrop",Od(wE);class vE extends NC{constructor(e){super(e),this.numTokens=e.numTokens,e.outputMode?this.outputMode=e.outputMode:this.outputMode="multiHot"}getConfig(){const e={numTokens:this.numTokens,outputMode:this.outputMode},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){return null==(e=wC(e))?[this.numTokens]:"oneHot"===this.outputMode&&1!==e[e.length-1]?(e.push(this.numTokens),e):(e[e.length-1]=this.numTokens,e)}call(e,t){return oh((()=>{let n;if("int32"!==(e=bC(e)).dtype&&(e=Rx(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new zA(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=bC(t.countWeights)}const s=ym(e),r=bm(e),i=Nm(this.numTokens,s).bufferSync().get(0),a=Om(r,0).bufferSync().get(0);if(!i||!a)throw new zA(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);return function(e,t,n,s){let r=bC(e);if("int32"!==r.dtype&&(r=Rx(r,"int32")),"int"===t)return r;const i=r.shape;if(0===r.rank&&(r=km(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=km(r,-1)),r.rank>2)throw new zA(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${i} which would result in output rank ${r.rank}.`);const a=["multiHot","oneHot"].includes(t),o=r;let l;if(l=Zf(o,void 0!==s&&"count"===t?s:[],n,a),"tfIdf"!==t)return l;if(s)return Ad(l,s);throw new zA("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)}))}}vE.className="CategoryEncoding",Od(vE);const AE=new Set(["bilinear","nearest"]);class xE extends NC{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!AE.has(e.interpolation))throw new zA(`Invalid interpolation parameter: ${e.interpolation} is not implemented`);this.interpolation=e.interpolation}else this.interpolation="bilinear";this.cropToAspectRatio=Boolean(e.cropToAspectRatio)}computeOutputShape(e){const t=(e=wC(e))[2];return[this.height,this.width,t]}getConfig(){const e={height:this.height,width:this.width,interpolation:this.interpolation,cropToAspectRatio:this.cropToAspectRatio},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return oh((()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return sw.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return sw.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...AE]} are supported`)}))}}xE.className="Resizing",Od(xE);class CE{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}CE.className="RandomSeed";class kE extends NC{constructor(e){super(e),this.randomGenerator=new CE(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}kE.className="BaseRandomLayer";const SE=new Set(["bilinear","nearest"]);class _E extends kE{constructor(e){super(e);const{factor:t,interpolation:n="bilinear"}=e;if(this.factor=t,Array.isArray(this.factor)&&2===this.factor.length)this.widthLower=this.factor[0],this.widthUpper=this.factor[1];else{if(Array.isArray(this.factor)||!(this.factor>0))throw new zA(`Invalid factor: ${this.factor}. Must be positive number or tuple of 2 numbers`);this.widthLower=-this.factor,this.widthUpper=this.factor}if(this.widthLower<-1||this.widthUpper<-1)throw new zA(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=bC(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=Lg([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let s=this.widthFactor.dataSync()[0]*n;s=Math.round(s);const r=[this.imgHeight,s];switch(this.interpolation){case"bilinear":return sw.resizeBilinear(e,r);case"nearest":return sw.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...SE]} are supported`)}}))}}_E.className="RandomWidth",Od(_E);var EE,IE;ca().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(EE||(EE={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(IE||(IE={}));const TE={};function NE(e){return TE[e]}function OE(e,t,n,s,r){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,a=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd,o=e<0?t.inputNames.length+e:e;if("tensor"===i.type)return RE(t.inputNames[o],n,s,r);if("tensors"===i.type){const i=t.inputs.slice(e,a);return t.inputNames.slice(e,a).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=i[t])||void 0===n?void 0:n.op)})).map((e=>RE(e,n,s,r)))}const l=RE(t.inputNames[o],n,s,r),u=l.dataSync();return"number"===i.type?u[0]:Ji(l.shape,u)}const a=t.attrParams[e];return a&&a.value}function RE(e,t,n,s){const[r,i]=BE(e,n);if(null!=s){const e=s.getHashTableHandleByName(r);if(null!=e)return e}const a=n.currentContextIds.find((e=>!!t[FE(r,e)]));return void 0!==a?t[FE(r,a)][i]:void 0}function DE(e,t,n){return t[FE(e,n.currentContextId)]}function ME(e,t){const[n,s,r]=BE(e,t);return[FE(n,t&&t.currentContextId),s,r]}function FE(e,t){return t?`${e}-${t}`:e}function BE(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const s=e.split(":");let r;if(1===s.length)r=[e,0,void 0];else{const e=s[0],t=3===s.length?s[1]:void 0;r=[e,Number(s[s.length-1]),t]}return n&&t.parseNodeNameCache.set(e,r),r}function zE(e,t,n){let s=OE("pad",e,t,n);if("explicit"===s){s=OE("explicitPaddings",e,t,n);const r=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)r[e][0]=s[2*e],r[e][1]=s[2*e+1];return r}return s}function LE(e){return e.kept?e:gd(e)}const PE=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],VE=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],WE=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],GE=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],UE=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],qE=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],jE=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],HE=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],$E=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],KE=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],XE=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],ZE=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],YE=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],QE=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],JE=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],eI=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],tI=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],nI=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],sI=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class rI{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[i,a,o,l,u,c,h,d,p,f,m,g,y,b,w,v,A,x,C].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,s=[],r=[],i=[],a=n.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?s.push(e[t.name]):"Const"===t.op?r.push(e[t.name]):null!=t.input&&0!==t.input.length||i.push(e[t.name]),e)),{});let o=[];const l=[];let u={},c={};null!=t&&(u=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const h=Object.keys(a);h.forEach((e=>{const t=a[e];t.inputNames.forEach(((e,n)=>{const[s,,r]=ME(e),i=a[s];if(null!=i.outputs){const e=i.outputs.indexOf(r);if(-1!==e){const r=`${s}:${e}`;t.inputNames[n]=r}}t.inputs.push(i),i.children.push(t)}))})),0===Object.keys(c).length?h.forEach((e=>{const t=a[e];0===t.children.length&&l.push(t)})):Object.keys(c).forEach((e=>{const[t]=ME(e),n=a[t];null!=n&&(n.signatureKey=c[e],l.push(n))})),Object.keys(u).length>0?Object.keys(u).forEach((e=>{const[t]=ME(e),n=a[t];n&&(n.signatureKey=u[e],o.push(n))})):o=s;let d={};null!=e.library&&null!=e.library.function&&(d=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const p={nodes:a,inputs:o,outputs:l,weights:r,placeholders:s,signature:t,functions:d};return i.length>0&&(p.initNodes=i),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=NE(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.slice(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(((t,n)=>{const s=n.type;let r;switch(n.type){case"string":r=aI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=aI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=gI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=gI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=lI(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=lI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=mI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=mI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=oI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=oI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=bI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=bI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=fI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=fI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=yI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=yI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=hI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=hI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=dI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=dI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=cI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=cI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:r,type:s},t}),{})),n}mapFunction(e){const t=e.nodeDef,n=[];let s={};null!=t&&(s=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e)),{}));const r=[],i=[];e.signature.inputArg.forEach((e=>{const[t]=ME(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:uI(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,r.push(n),s[t]=n}));Object.keys(s).forEach((e=>{const t=s[e];t.inputNames.forEach(((e,n)=>{const[r,,i]=ME(e),a=s[r];if(null!=a.outputs){const e=a.outputs.indexOf(i);if(-1!==e){const s=`${r}:${e}`;t.inputNames[n]=s}}t.inputs.push(a),a.children.push(t)}))}));const a=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=ME(a[e.name]),r=s[t];null!=r&&(r.defaultOutput=n,i.push(r))}));const o=this.mapArgsToSignature(e);return{nodes:s,inputs:r,outputs:i,weights:n,placeholders:[],signature:o}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function iI(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=ca().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function aI(e,t,n,s=!1){const r=e[t];return null!=r?iI(r.s,s):n}function oI(e,t,n){const s=e[t];return s?s.b:n}function lI(e,t,n){const s=e[t]||{},r=null!=s.i?s.i:null!=s.f?s.f:n;return"number"==typeof r?r:parseInt(r,10)}function uI(e){switch("string"==typeof e&&(e=EE[e]),e){case EE.DT_FLOAT:case EE.DT_HALF:return"float32";case EE.DT_INT32:case EE.DT_INT64:case EE.DT_INT8:case EE.DT_UINT8:return"int32";case EE.DT_BOOL:return"bool";case EE.DT_DOUBLE:return"float32";case EE.DT_STRING:return"string";case EE.DT_COMPLEX64:case EE.DT_COMPLEX128:return"complex64";default:return null}}function cI(e,t,n){const s=e[t];return s&&s.func?s.func.name:n}function hI(e,t,n){const s=e[t];return s&&s.type?uI(s.type):n}function dI(e,t,n){const s=e[t];return s&&s.list&&s.list.type?s.list.type.map((e=>uI(e))):n}function pI(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function fI(e,t,n){const s=e[t];return s&&s.shape?pI(s.shape):n}function mI(e,t,n){const s=e[t];return s?((s.list.f&&s.list.f.length?s.list.f:s.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):n}function gI(e,t,n,s=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map((e=>iI(e,s))):n}function yI(e,t,n){const s=e[t];return s&&s.list&&s.list.shape?s.list.shape.map((e=>pI(e))):n}function bI(e,t,n){const s=e[t];return s&&s.list&&s.list.b?s.list.b:n}class wI{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return RE(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return RE(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return lI(this.node.rawAttrs,e,t);if(null!=n.s)return aI(this.node.rawAttrs,e,t);if(null!=n.b)return oI(this.node.rawAttrs,e,t);if(null!=n.shape)return fI(this.node.rawAttrs,e,t);if(null!=n.type)return hI(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return mI(this.node.rawAttrs,e,t);if(null!=n.list.s)return gI(this.node.rawAttrs,e,t);if(null!=n.list.shape)return yI(this.node.rawAttrs,e,t);if(null!=n.list.b)return bI(this.node.rawAttrs,e,t);if(null!=n.list.type)return dI(this.node.rawAttrs,e,t)}return t}}function vI(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){Ni(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let s=0;sn+` Shapes ${e} and ${t} must match`))}}}function AI(e){return"number"!=typeof e&&!e.some((e=>e<0))}function xI(e,t,n){let s=CI(e,n);const r=!AI(s);if(r&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${s}`);if(r&&t.forEach((e=>{s=CI(e.shape,s)})),!AI(s))throw new Error(`Non-fully-defined elementShape: ${s}`);return s}function CI(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let s=0;s=0&&i>=0&&r!==i)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[s]=r>=0?r:i}return n}class kI{constructor(e,t,n,s,r,i,a){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=s,this.identicalElementShapes=r,this.dynamicSize=i,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=_d(0),uh(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),vI(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,uh(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,n)=>this.write(e,t[n])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,Dy(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const s=e.map((e=>(n+=e,n)));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const r=0===n?0:t.size/n,i=[];oh((()=>{t=mf(t,[1,n,r]);for(let n=0;n{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);vI(t,e.shape,"TensorList shape mismatch: "),uh(e)})),this.idTensor=_d(0),this.maxNumElements=s,uh(this.idTensor)}copy(){return new SI([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);vI(e,this.elementShape,"TensorList shape mismatch: ");const s=xI(this.elementShape,this.tensors,e);return oh((()=>{const e=this.tensors.map((e=>mf(e,s)));return gy(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=xI(this.elementShape,this.tensors,e),s=this.tensors.pop();return s.kept=!1,vI(s.shape,e,"TensorList shape mismatch: "),mf(s,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(vI(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");uh(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new SI([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);vI(this.tensors[e].shape,t,"TensorList shape mismatch: ");const s=xI(this.elementShape,this.tensors,t);return mf(this.tensors[e],s)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);vI(this.elementShape,t.shape,"TensorList shape mismatch: "),uh(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);vI(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const s=xI(this.elementShape,this.tensors,n);return 0===e.length?nh([],[0].concat(s)):oh((()=>{const t=e.map((e=>mf(this.tensors[e],s)));return gy(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);vI(this.elementShape,t,"TensorList shape mismatch: ");const n=xI(this.elementShape,this.tensors,t);return 0===this.size()?nh([],[0].concat(n)):oh((()=>{const e=this.tensors.map((e=>mf(e,n)));return bf(e,0)}))}}const _I=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const s=OE("thenBranch",e,t,n),r=OE("elseBranch",e,t,n),i=OE("cond",e,t,n),a=OE("args",e,t,n);return(await i.data())[0]?n.functionMap[s].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const s=OE("body",e,t,n),r=OE("cond",e,t,n),i=OE("args",e,t,n),a=await n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap),o=i.map((e=>e.id));let l=await a[0].data();a.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||e.dispose()}));let u=i;for(;l[0];){const e=u;u=await n.functionMap[s].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map((e=>e.id));e.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const i=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await i[0].data(),i.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return u}case"LoopCond":return[LE(OE("pred",e,t,n))];case"Switch":{const s=OE("pred",e,t,n);let r=OE("data",e,t,n);return r.kept||(r=LE(r)),(await s.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const s=e.inputNames.find((e=>void 0!==RE(e,t,n)));if(s){return[LE(RE(s,t,n))]}return}case"Enter":{const s=OE("frameName",e,t,n),r=OE("tensor",e,t,n);return n.enterFrame(s),[LE(r)]}case"Exit":{const s=OE("tensor",e,t,n);return n.exitFrame(),[LE(s)]}case"NextIteration":{const s=OE("tensor",e,t,n);return n.nextIteration(),[LE(s)]}case"TensorArrayV3":{const s=OE("size",e,t,n),r=OE("dtype",e,t,n),i=OE("elementShape",e,t,n),a=OE("dynamicSize",e,t,n),o=OE("clearAfterRead",e,t,n),l=OE("identicalElementShapes",e,t,n),u=OE("name",e,t,n),c=new kI(u,r,s,i,l,a,o);return n.addTensorArray(c),[c.idTensor,_d(1)]}case"TensorArrayWriteV3":{const s=OE("tensorArrayId",e,t,n),r=OE("index",e,t,n),i=OE("tensor",e,t,n),a=n.getTensorArray(s.id);return a.write(r,i),[a.idTensor]}case"TensorArrayReadV3":{const s=OE("tensorArrayId",e,t,n),r=OE("index",e,t,n);return[n.getTensorArray(s.id).read(r)]}case"TensorArrayGatherV3":{const s=OE("tensorArrayId",e,t,n),r=OE("indices",e,t,n),i=OE("dtype",e,t,n);return[n.getTensorArray(s.id).gather(r,i)]}case"TensorArrayScatterV3":{const s=OE("tensorArrayId",e,t,n),r=OE("indices",e,t,n),i=OE("tensor",e,t,n),a=n.getTensorArray(s.id);return a.scatter(r,i),[a.idTensor]}case"TensorArrayConcatV3":{const s=OE("tensorArrayId",e,t,n),r=n.getTensorArray(s.id),i=OE("dtype",e,t,n);return[r.concat(i)]}case"TensorArraySplitV3":{const s=OE("tensorArrayId",e,t,n),r=OE("tensor",e,t,n),i=OE("lengths",e,t,n),a=n.getTensorArray(s.id);return a.split(i,r),[a.idTensor]}case"TensorArraySizeV3":{const s=OE("tensorArrayId",e,t,n);return[_d(n.getTensorArray(s.id).size(),"int32")]}case"TensorArrayCloseV3":{const s=OE("tensorArrayId",e,t,n),r=n.getTensorArray(s.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const s=OE("tensorListId",e,t,n),r=OE("index",e,t,n),i=OE("tensor",e,t,n),a=n.getTensorList(s.id);return a.setItem(r,i),[a.idTensor]}case"TensorListGetItem":{const s=OE("tensorListId",e,t,n),r=OE("index",e,t,n),i=OE("elementShape",e,t,n),a=OE("elementDType",e,t,n);return[n.getTensorList(s.id).getItem(r,i,a)]}case"TensorListScatterV2":case"TensorListScatter":{const s=OE("indices",e,t,n),r=function(e,t,n,s){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const r=Math.max(...t);if(null!=s&&-1!==s&&r>=s)throw new Error(`Max index must be < array size (${r} vs. ${s})`);const i=new SI([],n,e.dtype,s),a=Dy(e,0);return t.forEach(((e,t)=>{i.setItem(e,a[t])})),i}(OE("tensor",e,t,n),s,OE("elementShape",e,t,n),OE("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const s=OE("elementShape",e,t,n),r=OE("elementDType",e,t,n);let i;i="TensorListReserve"===e.op?"numElements":"maxNumElements";const a=OE(i,e,t,n),o=function(e,t,n,s){return new SI([],e,t,s)}(s,r,0,"TensorListReserve"===e.op?-1:a);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{const s=OE("tensorListId",e,t,n),r=OE("indices",e,t,n),i=OE("elementShape",e,t,n),a=OE("elementDType",e,t,n);return[n.getTensorList(s.id).gather(r,a,i)]}case"TensorListStack":{const s=OE("tensorListId",e,t,n),r=OE("elementShape",e,t,n),i=OE("elementDType",e,t,n),a=OE("numElements",e,t,n);return[n.getTensorList(s.id).stack(r,i,a)]}case"TensorListFromTensor":{const s=function(e,t,n){const s=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);vI(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=Dy(e);return new SI(r,t,s)}(OE("tensor",e,t,n),OE("elementShape",e,t,n),OE("elementDType",e,t,n));return n.addTensorList(s),[s.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const s=OE("tensorListId",e,t,n),r=n.getTensorList(s.id),i=OE("dtype",e,t,n),a=OE("elementShape",e,t,n);return[r.concat(i,a)]}case"TensorListPushBack":{const s=OE("tensorListId",e,t,n),r=OE("tensor",e,t,n),i=n.getTensorList(s.id);return i.pushBack(r),[i.idTensor]}case"TensorListPopBack":{const s=OE("tensorListId",e,t,n),r=OE("elementShape",e,t,n),i=OE("elementDType",e,t,n);return[n.getTensorList(s.id).popBack(r,i)]}case"TensorListSplit":{const s=OE("tensor",e,t,n),r=OE("elementShape",e,t,n),i=function(e,t,n){let s=0;const r=t.map((e=>(s+=e,s)));if(s!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${s}, and tensor's shape is: ${e.shape}`);const i=CI(e.shape.slice(1),n),a=0===s?0:e.size/s,o=oh((()=>{const n=[];e=mf(e,[1,s,a]);for(let s=0;se.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return _d(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),oh((()=>{const e=Dy(t),s=n.length,r=e.length;Ni(s===r,(()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${r} elements.`));for(let t=0;t{const e=[];for(let s=0;s{switch(e.category){case"arithmetic":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[s.add(OE("a",e,t,n),OE("b",e,t,n))];case"AddN":return[s.addN(OE("tensors",e,t,n))];case"FloorMod":case"Mod":return[s.mod(OE("a",e,t,n),OE("b",e,t,n))];case"Mul":return[s.mul(OE("a",e,t,n),OE("b",e,t,n))];case"RealDiv":case"Div":return[s.div(OE("a",e,t,n),OE("b",e,t,n))];case"DivNoNan":return[s.divNoNan(OE("a",e,t,n),OE("b",e,t,n))];case"FloorDiv":return[s.floorDiv(OE("a",e,t,n),OE("b",e,t,n))];case"Sub":return[s.sub(OE("a",e,t,n),OE("b",e,t,n))];case"Minimum":return[s.minimum(OE("a",e,t,n),OE("b",e,t,n))];case"Maximum":return[s.maximum(OE("a",e,t,n),OE("b",e,t,n))];case"Pow":return[s.pow(OE("a",e,t,n),OE("b",e,t,n))];case"SquaredDifference":return[s.squaredDifference(OE("a",e,t,n),OE("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"basic_math":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Abs":case"ComplexAbs":return[s.abs(OE("x",e,t,n))];case"Acos":return[s.acos(OE("x",e,t,n))];case"Acosh":return[s.acosh(OE("x",e,t,n))];case"Asin":return[s.asin(OE("x",e,t,n))];case"Asinh":return[s.asinh(OE("x",e,t,n))];case"Atan":return[s.atan(OE("x",e,t,n))];case"Atan2":return[s.atan2(OE("x",e,t,n),OE("y",e,t,n))];case"Atanh":return[s.atanh(OE("x",e,t,n))];case"Ceil":return[s.ceil(OE("x",e,t,n))];case"Complex":return[s.complex(OE("real",e,t,n),OE("imag",e,t,n))];case"Cos":return[s.cos(OE("x",e,t,n))];case"Cosh":return[s.cosh(OE("x",e,t,n))];case"Elu":return[s.elu(OE("x",e,t,n))];case"Erf":return[s.erf(OE("x",e,t,n))];case"Exp":return[s.exp(OE("x",e,t,n))];case"Expm1":return[s.expm1(OE("x",e,t,n))];case"Floor":return[s.floor(OE("x",e,t,n))];case"Log":return[s.log(OE("x",e,t,n))];case"Log1p":return[s.log1p(OE("x",e,t,n))];case"Imag":return[s.imag(OE("x",e,t,n))];case"Neg":return[s.neg(OE("x",e,t,n))];case"Reciprocal":return[s.reciprocal(OE("x",e,t,n))];case"Real":return[s.real(OE("x",e,t,n))];case"Relu":return[s.relu(OE("x",e,t,n))];case"Round":return[s.round(OE("x",e,t,n))];case"Selu":return[s.selu(OE("x",e,t,n))];case"Sigmoid":return[s.sigmoid(OE("x",e,t,n))];case"Sin":return[s.sin(OE("x",e,t,n))];case"Sign":return[s.sign(OE("x",e,t,n))];case"Sinh":return[s.sinh(OE("x",e,t,n))];case"Softplus":return[s.softplus(OE("x",e,t,n))];case"Sqrt":return[s.sqrt(OE("x",e,t,n))];case"Square":return[s.square(OE("x",e,t,n))];case"Tanh":return[s.tanh(OE("x",e,t,n))];case"Tan":return[s.tan(OE("x",e,t,n))];case"ClipByValue":return[s.clipByValue(OE("x",e,t,n),OE("clipValueMin",e,t,n),OE("clipValueMax",e,t,n))];case"Relu6":return[s.relu6(OE("x",e,t,n))];case"Rsqrt":return[s.rsqrt(RE(e.inputNames[0],t,n))];case"LeakyRelu":return[s.leakyRelu(OE("x",e,t,n),OE("alpha",e,t,n))];case"Prelu":return[s.prelu(OE("x",e,t,n),OE("alpha",e,t,n))];case"IsNan":return[s.isNaN(RE(e.inputNames[0],t,n))];case"IsInf":return[s.isInf(RE(e.inputNames[0],t,n))];case"IsFinite":return[s.isFinite(RE(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return _I(e,t,n);case"convolution":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Conv1D":{const r=OE("stride",e,t,n),i=OE("pad",e,t,n),a=OE("dataFormat",e,t,n).toUpperCase(),o=OE("dilation",e,t,n);return[s.conv1d(OE("x",e,t,n),OE("filter",e,t,n),r,i,a,o)]}case"Conv2D":{const r=OE("strides",e,t,n),i=zE(e,t,n),a=OE("dataFormat",e,t,n).toUpperCase(),o=OE("dilations",e,t,n);return[s.conv2d(OE("x",e,t,n),OE("filter",e,t,n),[r[1],r[2]],i,a,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=EI(e,t,n);return[s.fused.conv2d({x:OE("x",e,t,n),filter:OE("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=EI(e,t,n);return[s.fused.depthwiseConv2d({x:OE("x",e,t,n),filter:OE("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=OE("outputShape",e,t,n),i=OE("strides",e,t,n),a=zE(e,t,n);return[s.conv2dTranspose(OE("x",e,t,n),OE("filter",e,t,n),r,[i[1],i[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=OE("strides",e,t,n),i=zE(e,t,n),a=OE("dilations",e,t,n),o=OE("dataFormat",e,t,n).toUpperCase();return[s.depthwiseConv2d(OE("input",e,t,n),OE("filter",e,t,n),[r[1],r[2]],i,o,[a[1],a[2]])]}case"Conv3D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("dataFormat",e,t,n).toUpperCase(),o=OE("dilations",e,t,n);return[s.conv3d(OE("x",e,t,n),OE("filter",e,t,n),[r[1],r[2],r[3]],i,a,[o[1],o[2],o[3]])]}case"AvgPool":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.avgPool(OE("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPool":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.maxPool(OE("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPoolWithArgmax":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n),o=OE("includeBatchInIndex",e,t,n),{result:l,indexes:u}=s.maxPoolWithArgmax(OE("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i,o);return[l,u]}case"AvgPool3D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.avgPool3d(OE("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"MaxPool3D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.maxPool3d(OE("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"Dilation2D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("dilations",e,t,n),o=r[1],l=r[2],u=a[1],c=a[2];return[s.dilation2d(OE("x",e,t,n),OE("filter",e,t,n),[o,l],i,[u,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Fill":{const r=OE("shape",e,t,n),i=OE("dtype",e,t,n),a=OE("value",e,t,n);return[s.fill(r,a,i)]}case"LinSpace":{const r=OE("start",e,t,n),i=OE("stop",e,t,n),a=OE("num",e,t,n);return[s.linspace(r,i,a)]}case"Multinomial":{const r=OE("logits",e,t,n),i=OE("numSamples",e,t,n),a=OE("seed",e,t,n);return[s.multinomial(r,i,a)]}case"OneHot":{const r=OE("indices",e,t,n),i=OE("depth",e,t,n),a=OE("onValue",e,t,n),o=OE("offValue",e,t,n),l=OE("dtype",e,t,n);return[s.oneHot(r,i,a,o,l)]}case"Ones":return[s.ones(OE("shape",e,t,n),OE("dtype",e,t,n))];case"OnesLike":return[s.onesLike(OE("x",e,t,n))];case"RandomStandardNormal":return[s.randomStandardNormal(OE("shape",e,t,n),OE("dtype",e,t,n),OE("seed",e,t,n))];case"RandomUniform":return[s.randomUniform(OE("shape",e,t,n),OE("minval",e,t,n),OE("maxval",e,t,n),OE("dtype",e,t,n))];case"RandomUniformInt":return[s.randomUniformInt(OE("shape",e,t,n),OE("minval",e,t,n),OE("maxval",e,t,n),OE("seed",e,t,n))];case"Range":{const r=OE("start",e,t,n),i=OE("stop",e,t,n),a=OE("step",e,t,n);return[s.range(r,i,a,OE("dtype",e,t,n))]}case"TruncatedNormal":{const r=OE("shape",e,t,n),i=OE("mean",e,t,n),a=OE("stdDev",e,t,n),o=OE("seed",e,t,n);return[s.truncatedNormal(r,i,a,OE("dtype",e,t,n),o)]}case"Zeros":return[s.zeros(OE("shape",e,t,n),OE("dtype",e,t,n))];case"ZerosLike":return[s.zerosLike(OE("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"dynamic":return(async(e,t,n,s,r=k)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=II(e,t,n),c=await r.image.nonMaxSuppressionWithScoreAsync(s,i,a,o,l,u);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=II(e,t,n),u=OE("padToMaxOutputSize",e,t,n),c=await r.image.nonMaxSuppressionPaddedAsync(s,i,a,o,l,u);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=II(e,t,n);return[await r.image.nonMaxSuppressionAsync(s,i,a,o,l)]}case"Where":{const s=r.cast(OE("condition",e,t,n),"bool"),i=[await r.whereAsync(s)];return s.dispose(),i}case"ListDiff":return r.setdiff1dAsync(OE("x",e,t,n),OE("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"LowerBound":{const r=OE("sortedSequence",e,t,n),i=OE("values",e,t,n);return[s.lowerBound(r,i)]}case"TopKV2":{const r=OE("x",e,t,n),i=OE("k",e,t,n),a=OE("sorted",e,t,n),o=s.topk(r,i,a);return[o.values,o.indices]}case"UpperBound":{const r=OE("sortedSequence",e,t,n),i=OE("values",e,t,n);return[s.upperBound(r,i)]}case"Unique":{const r=OE("x",e,t,n),i=s.unique(r);return[i.values,i.indices]}case"UniqueV2":{const r=OE("x",e,t,n),i=OE("axis",e,t,n),a=s.unique(r,i);return[a.values,a.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ResizeBilinear":{const r=OE("images",e,t,n),i=OE("size",e,t,n),a=OE("alignCorners",e,t,n),o=OE("halfPixelCenters",e,t,n);return[s.image.resizeBilinear(r,[i[0],i[1]],a,o)]}case"ResizeNearestNeighbor":{const r=OE("images",e,t,n),i=OE("size",e,t,n),a=OE("alignCorners",e,t,n),o=OE("halfPixelCenters",e,t,n);return[s.image.resizeNearestNeighbor(r,[i[0],i[1]],a,o)]}case"CropAndResize":{const r=OE("image",e,t,n),i=OE("boxes",e,t,n),a=OE("boxInd",e,t,n),o=OE("cropSize",e,t,n),l=OE("method",e,t,n),u=OE("extrapolationValue",e,t,n);return[s.image.cropAndResize(r,i,a,o,l,u)]}case"ImageProjectiveTransformV3":{const r=OE("images",e,t,n),i=OE("transforms",e,t,n),a=OE("outputShape",e,t,n),o=OE("fillValue",e,t,n),l=OE("interpolation",e,t,n),u=OE("fillMode",e,t,n);return[s.image.transform(r,i,l.toLowerCase(),u.toLowerCase(),o,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=OE("default",e,t,n);return[RE(e.name,t,n)||r];case"Placeholder":return[RE(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[LE(OE("x",e,t,n))];case"IdentityN":return OE("x",e,t,n).map((e=>LE(e)));case"Shape":return[s.tensor1d(OE("x",e,t,n).shape,"int32")];case"ShapeN":return OE("x",e,t,n).map((e=>s.tensor1d(e.shape)));case"Size":return[s.scalar(OE("x",e,t,n).size,"int32")];case"Rank":return[s.scalar(OE("x",e,t,n).rank,"int32")];case"NoOp":return[s.scalar(1)];case"Print":const i=OE("x",e,t,n),a=OE("data",e,t,n);OE("message",e,t,n),OE("summarize",e,t,n);for(let e=0;e((e,t,n,s=k)=>{switch(e.op){case"Equal":return[s.equal(OE("a",e,t,n),OE("b",e,t,n))];case"NotEqual":return[s.notEqual(OE("a",e,t,n),OE("b",e,t,n))];case"Greater":return[s.greater(OE("a",e,t,n),OE("b",e,t,n))];case"GreaterEqual":return[s.greaterEqual(OE("a",e,t,n),OE("b",e,t,n))];case"Less":return[s.less(OE("a",e,t,n),OE("b",e,t,n))];case"LessEqual":return[s.lessEqual(OE("a",e,t,n),OE("b",e,t,n))];case"LogicalAnd":return[s.logicalAnd(OE("a",e,t,n),OE("b",e,t,n))];case"LogicalNot":return[s.logicalNot(OE("a",e,t,n))];case"LogicalOr":return[s.logicalOr(OE("a",e,t,n),OE("b",e,t,n))];case"Select":case"SelectV2":return[s.where(OE("condition",e,t,n),OE("a",e,t,n),OE("b",e,t,n))];case"BitwiseAnd":return[s.bitwiseAnd(OE("a",e,t,n),OE("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"matrices":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[s.matMul(OE("a",e,t,n),OE("b",e,t,n),OE("transposeA",e,t,n),OE("transposeB",e,t,n))];case"Einsum":return[s.einsum(OE("equation",e,t,n),...OE("tensors",e,t,n))];case"Transpose":return[s.transpose(OE("x",e,t,n),OE("perm",e,t,n))];case"_FusedMatMul":const[r,i]=OE("fusedOps",e,t,n),a="biasadd"===r,o="prelu"===i,l=OE("numArgs",e,t,n),u=OE("leakyreluAlpha",e,t,n);if(a){if(o&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,h]=OE("args",e,t,n);return[s.fused.matMul({a:OE("a",e,t,n),b:OE("b",e,t,n),transposeA:OE("transposeA",e,t,n),transposeB:OE("transposeB",e,t,n),bias:c,activation:i,preluActivationWeights:h,leakyreluAlpha:u})];case"MatrixBandPart":return[s.linalg.bandPart(OE("a",e,t,n),OE("numLower",e,t,n),OE("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"normalization":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"EuclideanNorm":return[s.euclideanNorm(OE("x",e,t,n),OE("axis",e,t,n),OE("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[s.batchNorm(OE("x",e,t,n),OE("mean",e,t,n),OE("variance",e,t,n),OE("offset",e,t,n),OE("scale",e,t,n),OE("epsilon",e,t,n))];case"LRN":return[s.localResponseNormalization(OE("x",e,t,n),OE("radius",e,t,n),OE("bias",e,t,n),OE("alpha",e,t,n),OE("beta",e,t,n))];case"Softmax":return[s.softmax(OE("x",e,t,n))];case"LogSoftmax":return[s.logSoftmax(OE("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"ragged":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:i}=s.raggedGather(OE("paramsNestedSplits",e,t,n),OE("paramsDenseValues",e,t,n),OE("indices",e,t,n),OE("outputRaggedRank",e,t,n));return r.concat(i)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:i}=s.raggedRange(OE("starts",e,t,n),OE("limits",e,t,n),OE("splits",e,t,n));return[r,i]}case"RaggedTensorToTensor":return[s.raggedTensorToTensor(OE("shape",e,t,n),OE("values",e,t,n),OE("defaultValue",e,t,n),OE("rowPartitionTensors",e,t,n),OE("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"reduction":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Max":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.max(OE("x",e,t,n),r,i)]}case"Mean":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.mean(OE("x",e,t,n),r,i)]}case"Min":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.min(OE("x",e,t,n),r,i)]}case"Sum":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.sum(OE("x",e,t,n),r,i)]}case"All":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.all(OE("x",e,t,n),r,i)]}case"Any":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.any(OE("x",e,t,n),r,i)]}case"ArgMax":{const r=OE("axis",e,t,n);return[s.argMax(OE("x",e,t,n),r)]}case"ArgMin":{const r=OE("axis",e,t,n);return[s.argMin(OE("x",e,t,n),r)]}case"Prod":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.prod(OE("x",e,t,n),r,i)]}case"Cumprod":{const r=OE("axis",e,t,n),i=OE("exclusive",e,t,n),a=OE("reverse",e,t,n);return[s.cumprod(OE("x",e,t,n),r,i,a)]}case"Cumsum":{const r=OE("axis",e,t,n),i=OE("exclusive",e,t,n),a=OE("reverse",e,t,n);return[s.cumsum(OE("x",e,t,n),r,i,a)]}case"Bincount":const r=OE("x",e,t,n),i=OE("weights",e,t,n),a=OE("size",e,t,n);return[s.bincount(r,i,a)];case"DenseBincount":{const r=OE("x",e,t,n),i=OE("weights",e,t,n),a=OE("size",e,t,n),o=OE("binaryOutput",e,t,n);return[s.denseBincount(r,i,a,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=OE("n",e,t,n),i=OE("axis",e,t,n);let a=OE("tensors",e,t,n);return a=a.slice(0,r),[s.concat(a,i)]}case"Gather":{const r=OE("x",e,t,n),i=OE("indices",e,t,n);return[s.gather(r,s.cast(i,"int32"),0)]}case"GatherV2":{const r=OE("axis",e,t,n),i=OE("batchDims",e,t,n),a=OE("x",e,t,n),o=OE("indices",e,t,n);return[s.gather(a,s.cast(o,"int32"),r,i)]}case"Reverse":{const r=OE("dims",e,t,n),i=[];for(let e=0;e{const r=OE("axis",e,t,n),i=OE("tensors",e,t,n),a=i[0].shape,o=s.squeeze(i[0]).shape,l=i.map((e=>{const t=Mi(e.shape,a);if(!t&&!Mi(s.squeeze(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:s.reshape(e,a)}));return[s.stack(l,r)]}));case"Unpack":{const r=OE("axis",e,t,n),i=OE("tensor",e,t,n);return s.unstack(i,r)}case"Tile":{const r=OE("reps",e,t,n);return[s.tile(OE("x",e,t,n),r)]}case"Split":case"SplitV":{const r=OE("axis",e,t,n),i=OE("numOrSizeSplits",e,t,n),a=OE("x",e,t,n);return s.split(a,i,r)}case"ScatterNd":{const r=OE("indices",e,t,n),i=OE("values",e,t,n),a=OE("shape",e,t,n);return[s.scatterND(r,i,a)]}case"GatherNd":{const r=OE("x",e,t,n),i=OE("indices",e,t,n);return[s.gatherND(r,i)]}case"SparseToDense":{const r=OE("sparseIndices",e,t,n),i=OE("outputShape",e,t,n),a=OE("sparseValues",e,t,n),o=OE("defaultValue",e,t,n);return[s.sparseToDense(r,a,i,a.dtype===o.dtype?o:s.cast(o,a.dtype))]}case"TensorScatterUpdate":{const r=OE("indices",e,t,n),i=OE("values",e,t,n),a=OE("tensor",e,t,n);return[s.tensorScatterUpdate(a,r,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:i,emptyRowIndicator:a,reverseIndexMap:o}=s.sparse.sparseFillEmptyRows(OE("indices",e,t,n),OE("values",e,t,n),OE("denseShape",e,t,n),OE("defaultValue",e,t,n));return[r,i,a,o]}case"SparseReshape":{const{outputIndices:r,outputShape:i}=s.sparse.sparseReshape(OE("inputIndices",e,t,n),OE("inputShape",e,t,n),OE("newShape",e,t,n));return[r,i]}case"SparseSegmentMean":return[s.sparse.sparseSegmentMean(OE("data",e,t,n),OE("indices",e,t,n),OE("segmentIds",e,t,n))];case"SparseSegmentSum":return[s.sparse.sparseSegmentSum(OE("data",e,t,n),OE("indices",e,t,n),OE("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"spectral":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"FFT":return[s.fft(OE("x",e,t,n))];case"IFFT":return[s.ifft(OE("x",e,t,n))];case"RFFT":return[s.rfft(OE("x",e,t,n))];case"IRFFT":return[s.irfft(OE("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"string":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"StaticRegexReplace":return[s.string.staticRegexReplace(OE("input",e,t,n),OE("pattern",e,t,n),OE("rewrite",e,t,n),OE("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:i}=s.string.stringNGrams(OE("data",e,t,n),OE("dataSplits",e,t,n),OE("separator",e,t,n),OE("nGramWidths",e,t,n),OE("leftPad",e,t,n),OE("rightPad",e,t,n),OE("padWidth",e,t,n),OE("preserveShortSequences",e,t,n));return[r,i]}case"StringSplit":{const{indices:r,values:i,shape:a}=s.string.stringSplit(OE("input",e,t,n),OE("delimiter",e,t,n),OE("skipEmpty",e,t,n));return[r,i,a]}case"StringToHashBucketFast":return[s.string.stringToHashBucketFast(OE("input",e,t,n),OE("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"transformation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Cast":return[s.cast(OE("x",e,t,n),OE("dtype",e,t,n))];case"ExpandDims":{const r=OE("axis",e,t,n);return[s.expandDims(OE("x",e,t,n),r)]}case"Squeeze":{const r=OE("axis",e,t,n);return[s.squeeze(OE("x",e,t,n),r)]}case"Reshape":return[s.reshape(OE("x",e,t,n),OE("shape",e,t,n))];case"EnsureShape":return[s.ensureShape(OE("x",e,t,n),OE("shape",e,t,n))];case"MirrorPad":return[s.mirrorPad(OE("x",e,t,n),OE("padding",e,t,n),OE("mode",e,t,n))];case"PadV2":case"Pad":return[s.pad(OE("x",e,t,n),OE("padding",e,t,n),OE("constantValue",e,t,n))];case"SpaceToBatchND":{const r=OE("blockShape",e,t,n),i=OE("paddings",e,t,n);return[s.spaceToBatchND(OE("x",e,t,n),r,i)]}case"BatchToSpaceND":{const r=OE("blockShape",e,t,n),i=OE("crops",e,t,n);return[s.batchToSpaceND(OE("x",e,t,n),r,i)]}case"DepthToSpace":{const r=OE("blockSize",e,t,n),i=OE("dataFormat",e,t,n).toUpperCase();return[s.depthToSpace(OE("x",e,t,n),r,i)]}case"BroadcastTo":return[s.broadcastTo(OE("x",e,t,n),OE("shape",e,t,n))];case"BroadcastArgs":return[s.broadcastArgs(OE("s0",e,t,n),OE("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"hash_table":return(async(e,t,n,s)=>{switch(e.op){case"HashTable":case"HashTableV2":{const r=s.getHashTableHandleByName(e.name);if(null!=r)return[r];{const r=OE("keyDType",e,t,n),i=OE("valueDType",e,t,n),a=new TI(r,i);return s.addHashTable(e.name,a),[a.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=OE("tableHandle",e,t,n,s),i=OE("keys",e,t,n),a=OE("values",e,t,n),o=s.getHashTableById(r.id);return[await o.import(i,a)]}case"LookupTableFind":case"LookupTableFindV2":{const r=OE("tableHandle",e,t,n,s),i=OE("keys",e,t,n),a=OE("defaultValue",e,t,n),o=s.getHashTableById(r.id);return[await o.find(i,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=OE("tableHandle",e,t,n,s);return[s.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,s);case"custom":const i=NE(e.op);if(i&&i.customExecutor)return i.customExecutor(new wI(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return aa(i)?i.then((e=>[].concat(e))):[].concat(i)}class OI{constructor(e={},t={},n={},s={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=s,this.parseNodeNameCache=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function RI(e,t,n,s){const r=new Set,i=[];let a=null,o=null;const l=new Set,u=new Set(Object.keys(e).map((e=>BE(e)[0])));s=s||[];const c=new Set(s.map((e=>BE(e.name)[0]))),h=[...t];for(;h.length>0;){const e=h.pop();(LI(e)||PI(e)||VI(e))&&null==a&&(a=e,o=a.children.map((e=>e.name)).filter((e=>r.has(e)))),r.add(e.name),null==n[e.name]&&(u.has(e.name)||c.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{l.has(e.name)||(l.add(e.name),h.push(e))})):i.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:i,dynamicNode:a,syncInputs:o}}function DI(e,t){const{usedNodes:n,inputs:s}=t,r=Object.keys(s).map((e=>BE(e)[0])).map((t=>e.nodes[t])),i=e.initNodes||[],a=e=>n.has("string"==typeof e?e:e.name);function o(e){return[...new Map(e.map((e=>[e.name,e]))).values()]}const l=o([...r,...e.weights,...i]).filter(a),u=o([...l,...Object.values(e.nodes)]).filter(a),c=new Map(u.map((e=>[e.name,e]))),h={};for(const e of u){h[e.name]=h[e.name]||0;for(const t of e.children)a(t)||(h[t.name]=Number.POSITIVE_INFINITY),h[t.name]=(h[t.name]||0)+1}const d=Object.entries(h).filter((([,e])=>0===e)).map((([e])=>e)),p=[...d];for(;d.length>0;){const e=d.pop(),t=c.get(e);for(const e of t.children.filter(a))0==--h[e.name]&&(p.push(e.name),d.push(e.name))}const f=function(e,t){const n=new Map(e.map((e=>[e.name,e]))),s=t.map((e=>e.name)),r=new Set(s);for(;s.length>0;){const e=s.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!r.has(e.name)&&(r.add(e.name),s.push(e.name))}const i=e.filter((e=>r.has(e.name)));return i}(p.map((e=>c.get(e))),l);return function(e,t){const n=new Map(e.map(((e,t)=>[e.name,t]))),s=new Set(t.map((e=>e.name))),r=e=>s.has("string"==typeof e?e:e.name),i=new Set(e.map((e=>e.name))),a=e=>i.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(a)){if(!n.has(e.name))throw new MI(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new MI(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!r(t))for(const e of t.inputs){if(!n.has(e.name))throw new MI(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new MI(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class MI extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const FI=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),BI=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),zI=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function LI(e){return FI.has(e.op)}function PI(e){return BI.has(e.op)}function VI(e){return zI.has(e.op)}class WI{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new WI(e.functions[t],this)}))}getCompilationKey(e,t){const n=e.map((e=>e.name)).sort(),s=t.map((e=>e.name)).sort();return n.join(this.SEPARATOR)+"--"+s.join(this.SEPARATOR)}compile(e,t){const n=RI(e,t,this.weightMap,this._initNodes),{missingInputs:s,dynamicNode:r,syncInputs:i}=n;if(null!=r)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${i}]`);if(s.length>0){const n=t.map((e=>e.name)),r=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${r}]. Missing the following inputs: [${s}]`)}const a=DI(this.graph,n),o=function(e){const t=new Map(e.map(((e,t)=>[e.name,t]))),n=Number.MAX_SAFE_INTEGER,s=e.map(((e,t)=>LI(e)?n:t)),r=e=>{const n=s[t.get(e.name)];return null==n?-1:n},i=e.map(((e,t)=>e.children.map(r).reduce(((e,t)=>Math.max(e,t)),s[t]))),a=new Map;for(let t=0;tthis.cloneAndKeepTensor(e)));return t}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.cloneTensorList(t)])))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const s=n.map((e=>this.graph.nodes[BE(e)[0]])),r=t.map((e=>BE(e)[0])),i=new Set(r);let a=r.map((e=>this.graph.nodes[e]));0===a.length&&(a=this._outputs);const o=this.getCompilationKey(s,a);let l=this.compiledMap.get(o);null==l&&(l=this.compile(e,a),this.compiledMap.set(o,l));try{this.keepIntermediateTensors=ca().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const u={},c={};return oh((()=>{const n=new OI(this.weightMap,u,c,this.functionExecutorMap,this.parseNodeNameCache),s=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,i]=BE(t,n),a=[];a[i]=e[t],s[r]=a,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(a))}));const r=this.getFrozenTensorIds(s),{orderedNodes:a,nodeLiveUntilMap:o}=l;for(const e of a){if(s[e.name])continue;const t=NI(e,s,n,this._resourceManager);if(aa(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);s[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,s,n,r,i,o.get(e.name))}return null==this.parent&&n.dispose(r),t.map((e=>RE(e,s,n)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,n,s,r,i,a){if(!LI(t)&&!i.has(e)){for(const s of n[e])null!=s&&(a[s.id]=(a[s.id]||0)+t.children.length);for(const e of t.inputs){if(LI(e))continue;const t=DE(e.name,n,s);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=a[e.id];1===t?(e.dispose(),delete a[e.id]):null!=t&&a[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,s,r,i){function a(e){return LI(e)||r.has(e.name)}if(!LI(e)&&null!=i)for(const e of i){if(a(e))continue;const r=DE(e.name,t,n);for(const e of r)!e||e.kept||s.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,s={},r={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=ca().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const i=new OI(this.weightMap,s,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const a=await this.executeWithControlFlow(e,i,t,n),o=t.map((e=>RE(e,a,i))),l=o.map((e=>e.id)),u=Object.keys(e).map((t=>e[t].id)),c=new Set([...l,...u,...this.weightIds]);return Object.values(a).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||c.has(e.id)||e.dispose()}))})),null==this.parent&&i.dispose(c),o}async executeFunctionAsync(e,t,n){const s=e.reduce(((e,t,n)=>(e[this.inputs[n].name]=t,e)),{});return this._executeAsync(s,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,s){const r=Object.keys(e),i=r.map((e=>this.graph.nodes[BE(e)[0]])),a=n.map((e=>BE(e)[0])),o=new Set(a);let l=a.map((e=>this.graph.nodes[e]));0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:h,syncInputs:d}=RI(e,l,this.weightMap,this._initNodes),p=[...i,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),f=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,s]=BE(t),r=[];r[s]=e[t],f[n]=r}));const m={},g=this.getFrozenTensorIds(f),y={};for(;p.length>0;){const e=this.processStack(i,p,t,f,y,g,o,m,u);await Promise.all(e)}const b=l.filter((e=>!LI(e)&&!RE(e.name,f,t))).map((e=>e.name));if(b.length>0){let e="";throw null!=h&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${b}] from the provided inputs [${r}]. Consider providing the following inputs: [${c}]. ${e}`)}return f}processStack(e,t,n,s,r,i,a,o,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&OE("isConstant",e.node,s,n)&&([c]=ME(e.node.name,n)),null==s[e.node.name]){const h=NI(e.node,s,n,this._resourceManager);c||([c]=ME(e.node.name,n));const d=n.currentContext;aa(h)?u.push(h.then((u=>(s[c]=u,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(u)),n.currentContext=d,this.checkTensorForDisposal(c,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l),u)))):(s[c]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(h)),this.checkTensorForDisposal(c,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l))}else this.processChildNodes(e.node,t,n,s,r,l)}return u}processChildNodes(e,t,n,s,r,i){e.children.forEach((e=>{const[a]=ME(e.name,n);!r[a]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!RE(e,s,n)))&&(r[a]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!RE(e,s,n)))&&(r[a]=!0,t.push({contexts:n.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const n=e[t],[s]=BE(t),r=this.graph.nodes[s];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value;Ni(e.length===n.shape.length&&n.shape.every(((t,n)=>-1===e[n]||e[n]===t)),(()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`))}r.attrParams.dtype&&r.attrParams.dtype.value&&Ni(n.dtype===r.attrParams.dtype.value,(()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(e){var t,n;const s={};for(const r in e){const i=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=i?s[i.name]=e[r]:s[r]=e[r]}return s}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=BE(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>{var t,n;const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=s?s.name:e}),{})}checkOutputs(e){e.forEach((e=>{const[t]=BE(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class GI{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}const UI="?tfjs-format=file",qI="model.json";class jI{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(t,n={},s=e){this.modelUrl=t,this.loadOptions=n,this.version="n/a",this.io=s,null==n&&(this.loadOptions={}),this.resourceManager=new GI}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return aa(e)?e.then((e=>null==e.getWeightStream?this.loadSync(e):this.loadStreaming(e))):this.loadSync(e)}loadSync(e){const t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(null==e.getWeightStream)throw new Error("Model artifacts missing streamWeights function");const t=await wh(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const n=this.artifacts.modelTopology;let s=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(s=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}if(this.signature=s,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new WI(rI.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=rI.Instance.transformGraph(e.modelInitializer);this.initializer=new WI(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t={};return(e instanceof vc?[e]:e).forEach(((e,n)=>t[this.structuredOutputKeys[n]]=e)),t}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof vc||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const s=n[t];null!=s.resourceId&&(e[t]=this.resourceIdToCapturedInput[s.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let s=0;return this.inputNodes.reduce(((t,n)=>{var r,i,a;const o=null===(a=null===(i=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===i?void 0:i[n])||void 0===a?void 0:a.resourceId;return t[n]=null!=o?this.resourceIdToCapturedInput[o]:e[s++],t}),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let s=0;s1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,n)=>(t[n]=[e[n]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&lh(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function HI(t,n={},s=e){if(null==t)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==n&&(n={}),n.fromTFHub&&"string"==typeof t&&(t=function(e){e.endsWith("/")||(e+="/");return`${e}${qI}${UI}`}(t));const r=new jI(t,n,s);return await r.load(),r}function $I(e,t,n=new Map,s=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(s.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse){if(YI(e)){const r=Array.isArray(e)?[]:{};s.add(e);for(const i in e){const a=$I(e[i],t,n,s);r[i]=a}return s.delete(e),e.__proto__&&(r.__proto__=e.__proto__),r}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return n.set(e,r.value),r.value}function KI(e,t=ZI){return XI(e,t)}function XI(e,t,n=new Set){const s=e[0];if(n.has(s))throw new Error("Circular references are not supported.");const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse){if(YI(s)){const r=Array.isArray(s)?[]:{};n.add(s);for(const i in s){const s=XI(e.map((e=>e[i])),t,n);r[i]=s}return n.delete(s),r}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return r.value}function ZI(e){return null===e?null:YI(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function YI(e){let t=!1;if(ca().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(7695);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof vc)&&!(e instanceof Promise)&&!t)}function QI(e){return function(e,t){return $I(e,t)}(e,JI)}function JI(e){return e instanceof vc?{value:e.clone(),recurse:!1}:YI(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class eT{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}}class tT extends eT{constructor(){super(tT.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){const e=2*this.capacity,t=new Array(e),n=this.length();for(let e=0;e!0===e))}rowMajorBatch(e,t=!0){return new cT(this,e,t)}columnMajorBatch(e,t=!0,n=ZI){return this.rowMajorBatch(e,t).map((e=>KI(e,n)))}concatenate(e,t){return new yT(new iT([this,e]),t)}take(e){return e<0||null==e?this:new uT(this,e)}skip(e){return e<0||null==e?this:new lT(this,e)}prefetch(e){return new wT(this,e)}shuffle(e,t){return new vT(this,e,t)}serial(){return new oT(this)}}class iT extends rT{constructor(e){super(),this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const e=this.items[this.trav];return this.trav++,{value:QI(e),done:!1}}}class aT extends rT{constructor(e){super(),this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}}class oT extends rT{constructor(e){super(),this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){return this.upstream.next()}}class lT extends rT{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class cT extends rT{constructor(e,t,n=!0){super(),this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){const e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class hT extends rT{constructor(e,t){super(),this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;lh(e.value)}}}class dT extends rT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Fc(e.value),n=this.transform(e.value),s=Fc(n);for(const e of t)Mc(e,s)||e.dispose();return{value:n,done:!1}}}class pT extends rT{constructor(e,t){super(),this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}}class fT extends rT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Fc(e.value),n=await this.transform(e.value),s=Fc(n);for(const e of t)Mc(e,s)||e.dispose();return{value:n,done:!1}}}class mT extends rT{constructor(){super(),this.outputQueue=new tT,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class gT extends mT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=Fc(e.value),n=this.transform(e.value),s=Fc(n);this.outputQueue.pushAll(n);for(const e of t)Mc(e,s)||e.dispose();return!0}}class yT extends rT{constructor(e,t){super(),this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}var bT;!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(bT||(bT={}));class wT extends rT{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new eT(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class vT extends wT{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Og.alea(n||ec().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}}class AT{constructor(){this.size=null}batch(e,t=!0){const n=this;let s;return Ni(e>0,(()=>`batchSize needs to be positive, but it is\n ${e}`)),s=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),xT((async()=>(await n.iterator()).columnMajorBatch(e,t,CT)),s)}concatenate(e){const t=this;let n;return n=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,xT((async()=>(await t.iterator()).concatenate(await e.iterator())),n)}filter(e){const t=this;let n;return n=this.size===1/0?1/0:null,xT((async()=>(await t.iterator()).filter((t=>oh((()=>e(t)))))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return xT((async()=>(await t.iterator()).map((t=>oh((()=>e(t)))))),this.size)}mapAsync(e){const t=this;return xT((async()=>(await t.iterator()).mapAsync(e)),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return xT((async()=>(await t.iterator()).prefetch(e)),this.size)}repeat(e){const t=this;let n;return n=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,xT((async()=>sT(nT((async()=>({value:await t.iterator(),done:!1}))).take(e))),n)}skip(e){const t=this;let n;return n=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size(await t.iterator()).skip(e)),n)}shuffle(e,t,n=!0){if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const s=this,r=Og.alea(t||ec().toString());return xT((async()=>{let t=r.int32();return n&&(t+=r.int32()),(await s.iterator()).shuffle(e,t.toString())}),this.size)}take(e){const t=this;let n;return n=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,xT((async()=>(await t.iterator()).take(e)),n)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function xT(e,t=null){return new class extends AT{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function CT(e){if(null===e)return null;const t=e[0];if(null==(n=t)||null===(s=n)||"object"!=typeof s&&"function"!=typeof s||Array.isArray(n)||"object"==typeof n&&n instanceof vc||sc(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof vc?gy(e):nh(e)}(e),recurse:!1}}var n,s;return{value:null,recurse:!0}}AT.MAX_BUFFER_SIZE=1e4;Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote");function kT(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&Ni("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const ST=By;class _T extends ki{nextDataId(){return _T.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new Ci(this,ih())}write(e,t,n){this.firstUse&&(this.firstUse=!1,ca().get("IS_NODE")&&Eu());const s={id:this.nextDataId()};return this.data.set(s,{values:e,dtype:n,refCount:1}),s}makeTensorInfo(e,t,n){let s;if("string"===t&&null!=n&&n.length>0&&Hi(n[0])){const r=n.map((e=>tc(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return{dataId:s,shape:e,dtype:t}}refCount(e){if(this.data.has(e)){return this.data.get(e).refCount}return 0}incRef(e){this.data.get(e).refCount++}decRef(e){if(this.data.has(e)){this.data.get(e).refCount--}}move(e,t,n,s,r){this.data.set(e,{values:t,dtype:s,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);if("complex64"===t){return Fw(this.readSync(n.real.dataId),this.readSync(n.imag.dataId))}return function(e,t){if(Array.isArray(e))return e;if("float32"===t)return e instanceof Float32Array?e:new Float32Array(e);if("int32"===t)return e instanceof Int32Array?e:new Int32Array(e);if("bool"===t||"string"===t)return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}(this.data.get(e).values,t)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>nc(e)));return fd(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return fd(e.shape,e.dtype,t)}makeOutput(e,t,n){return ih().makeTensorFromTensorInfo(this.makeTensorInfo(t,n,e),this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=ec();e();return{kernelMs:ec()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){kT([e],"where");const t=this.readSync(e.dataId);return ST(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}_T.nextDataId=0;function ET(e){return(t,n,s)=>{const r=Ui(n,t.length);for(let n=0;n{const{x:a}=s;kT(a,e);const o=i,l=o.data.get(a.dataId).values;let u;if("string"===a.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=mv(l)}else u=l;const c=n||a.dtype,h=t(u,c,r);return o.makeTensorInfo(a.shape,c,h)}}ch("cpu",(()=>new _T),1);const NT=IT(fo,(e=>e>=0?e:Math.exp(e)-1)),OT={kernelName:fo,backendName:"cpu",kernelFunc:NT};function RT(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const DT={kernelName:Oo,backendName:"cpu",kernelFunc:RT};function MT(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s;kT([r],"leakyRelu");const a=Di(r.shape),o=n.data.get(r.dataId).values,l=Gi("float32",a);for(let e=0;e{const a=Gd(t,n),o=a.length,l=Yi(a),u=Gi(i,Di(a)),c=t.length,h=n.length,d=Yi(t),p=Yi(n),f=Vd(t,a),m=Vd(n,a);if(f.length+m.length===0)for(let t=0;ti[e]=0));const a=ra(i,c,d),g=n.slice(-h);m.forEach((e=>g[e]=0));const y=ra(g,h,p);u[t]=e(s[a],r[y])}return[u,a]}}const zT=BT(((e,t)=>e<0?t*e:e));function LT(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t;kT([s,r],"prelu");const i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,[o,l]=zT(s.shape,r.shape,i,a,"float32");return n.makeTensorInfo(l,"float32",o)}const PT={kernelName:bl,backendName:"cpu",kernelFunc:LT},VT=IT(_l,(e=>Math.max(0,e))),WT={kernelName:_l,backendName:"cpu",kernelFunc:VT},GT=IT(Rl,(e=>Math.min(Math.max(0,e),6))),UT={kernelName:Rl,backendName:"cpu",kernelFunc:GT},qT=ET((e=>1/(1+Math.exp(-e)))),jT=IT(jl,(e=>1/(1+Math.exp(-e)))),HT={kernelName:jl,backendName:"cpu",kernelFunc:jT};function $T(e,t,n,s,r){if("linear"===n)return RT({inputs:{x:t},backend:e});if("relu"===n)return VT({inputs:{x:t},backend:e});if("elu"===n)return NT({inputs:{x:t},backend:e});if("relu6"===n)return GT({inputs:{x:t},backend:e});if("prelu"===n)return LT({inputs:{x:t,alpha:s},backend:e});if("leakyrelu"===n)return MT({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return jT({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function KT(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,o=n.makeTensorInfo(s.shape,"complex64");return n.data.get(o.dataId).complexTensorInfos={real:n.makeTensorInfo(s.shape,"float32",i),imag:n.makeTensorInfo(r.shape,"float32",a)},o}const XT={kernelName:Wa,backendName:"cpu",kernelFunc:KT};function ZT(e,t,n="float32"){if("complex64"===n){return KT({inputs:{real:ZT(e,t,"float32"),imag:ZT(e,t,"float32")},backend:e})}const s=ta(Di(t),n);return e.makeTensorInfo(t,n,s)}function YT(e){const{inputs:t,backend:n}=e,{input:s}=t,r=n.data.get(s.dataId).complexTensorInfos.real,i=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,i)}const QT={kernelName:kl,backendName:"cpu",kernelFunc:YT};function JT(e,t,n,s){if("int32"===s){return[t,"int32",Int32Array.from(e)]}if("bool"===s){const s=Ju([0],n),[r,i]=BT(((e,t)=>e!==t?1:0))(t,[],e,s,"bool");return[i,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${s}`)}function eN(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dtype:i}=s;if("complex64"===i){if("complex64"===r.dtype)return RT({inputs:{x:r},backend:n});const e=ZT(n,r.shape,r.dtype),t=eN({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),s=KT({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),s}if("complex64"===r.dtype){const e=YT({inputs:{input:r},backend:n}),t=eN({inputs:{x:e},backend:n,attrs:{dtype:i}});return n.disposeIntermediateTensorInfo(e),t}if(!qi(r.dtype,i)){const e=RT({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:i}}const a=n.data.get(r.dataId).values,[o,l,u]=JT(a,r.shape,r.dtype,i);return n.makeTensorInfo(o,l,u)}const tN={kernelName:La,backendName:"cpu",kernelFunc:eN};function nN(e,t,n,s){return null==n?({inputs:n,backend:r})=>{const{a:i,b:a}=n,o=r;kT([i,a],e);const l=o.data.get(i.dataId).values,u=o.data.get(a.dataId).values,c="string"===i.dtype?mv(l):l,h="string"===i.dtype?mv(u):u,d=s||i.dtype,[p,f]=t(i.shape,a.shape,c,h,d);return o.makeTensorInfo(f,d,p)}:({inputs:e,backend:r})=>{const{a:i,b:a}=e,o=r;if("complex64"===i.dtype||"complex64"===a.dtype){const e=eN({inputs:{x:i},backend:o,attrs:{dtype:"complex64"}}),t=o.data.get(e.dataId),s=t.complexTensorInfos.real,r=t.complexTensorInfos.imag,l=o.data.get(s.dataId).values,u=o.data.get(r.dataId).values,c=eN({inputs:{x:a},backend:o,attrs:{dtype:"complex64"}}),h=o.data.get(c.dataId),d=h.complexTensorInfos.real,p=h.complexTensorInfos.imag,f=o.data.get(d.dataId).values,m=o.data.get(p.dataId).values,[g,y,b]=n(i.shape,a.shape,l,u,f,m),w=o.makeTensorInfo(b,"float32",g),v=o.makeTensorInfo(b,"float32",y),A=KT({inputs:{real:w,imag:v},backend:o});return o.disposeIntermediateTensorInfo(e),o.disposeIntermediateTensorInfo(c),o.disposeIntermediateTensorInfo(w),o.disposeIntermediateTensorInfo(v),A}{const e=o.data.get(i.dataId).values,n=o.data.get(a.dataId).values,r=s||i.dtype,[l,u]=t(i.shape,a.shape,e,n,r);return o.makeTensorInfo(u,r,l)}}}function sN(e){return(t,n,s,r,i,a)=>{const o=Gd(t,n),l=Di(o),u=o.length,c=Yi(o),h=Gi("float32",l),d=Gi("float32",l),p=Vd(t,o),f=Vd(n,o),m=Fw(s,r),g=Fw(i,a),y=t.length,b=Yi(t),w=n.length,v=Yi(n);if(p.length+f.length===0)for(let t=0;ts[e]=0));const r=ra(s,y,b),i=n.slice(-w);f.forEach((e=>i[e]=0));const a=ra(i,w,v),o=e(m[2*r],m[2*r+1],g[2*a],g[2*a+1]);h[t]=o.real,d[t]=o.imag}return[h,d,o]}}const rN=BT(((e,t)=>e+t)),iN=sN(((e,t,n,s)=>({real:e+n,imag:t+s}))),aN=nN(ba,rN,iN),oN={kernelName:ba,backendName:"cpu",kernelFunc:aN};function lN(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{shape:i}=s,a=Di(r.shape),o=Pi(i,a),l=Di(o);Ni(a===l,(()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`)),n.incRef(r.dataId);const u=n.data.get(r.dataId);if(null!=u.complexTensorInfos){const e=u.complexTensorInfos.real,t=u.complexTensorInfos.imag;e.shape=o,t.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}const uN={kernelName:El,backendName:"cpu",kernelFunc:lN};function cN(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;kT([r,i],"matMul");const l=r.shape.length,u=i.shape.length,c=a?r.shape[l-2]:r.shape[l-1],h=o?i.shape[u-1]:i.shape[u-2],d=a?r.shape[l-1]:r.shape[l-2],p=o?i.shape[u-2]:i.shape[u-1],f=r.shape.slice(0,-2),m=i.shape.slice(0,-2),g=Di(f),y=Di(m),b=Gd(r.shape.slice(0,-2),i.shape.slice(0,-2)).concat([d,p]);Ni(c===h,(()=>`Error in matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${r.shape} and ${i.shape} and transposeA=${a} and transposeB=${o} must match.`));const w=o?[y,p,h]:[y,h,p],v=lN({inputs:{x:r},backend:n,attrs:{shape:a?[g,c,d]:[g,d,c]}}),A=lN({inputs:{x:i},backend:n,attrs:{shape:w}}),x=a?v.shape[1]:v.shape[2],C=a?v.shape[2]:v.shape[1],k=o?A.shape[1]:A.shape[2],S=Math.max(g,y),_=n.data.get(v.dataId).values,E=n.data.get(A.dataId).values,I=Yi(v.shape),T=Yi(A.shape),[N,O,R]=a?[I[0],1,I[1]]:[I[0],I[1],1],[D,M,F]=o?[1,T[1],T[0]]:[T[1],1,T[0]],B=C*k,z=fd([S,C,k],v.dtype),L=z.values,P=n.blockSize;for(let e=0;e{const{x:t}=e.inputs,n=e.backend;kT(t,"abs");let s=new Float32Array(Di(t.shape));return s=pN(n.data.get(t.dataId).values),n.makeOutput(s,t.shape,t.dtype)}},mN=IT(ga,(e=>Math.acos(e))),gN={kernelName:ga,backendName:"cpu",kernelFunc:mN},yN=IT(ya,(e=>Math.acosh(e))),bN={kernelName:ya,backendName:"cpu",kernelFunc:yN};const wN={kernelName:wa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,s=t;kT(t,"addN");const r=s.map((e=>n.data.get(e.dataId).values)),i=fd(s[0].shape,s[0].dtype),a=i.values;for(let e=0;en&&(n=r,s=e)}d[e]=s}return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}};const _N={kernelName:Ca,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;kT(r,"argMin");let a=Vi(i,r.shape);const o=fm(a,r.shape.length);let l=r;const u=[];null!=o&&(l=AN({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),a=gm(a.length,l.shape.length)),a=[a[0]],pm("argMin",a,l.shape.length);const[c,h]=hm(l.shape,a),d=ta(Di(c),"int32"),p=Di(h),f=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}},EN=IT(ka,(e=>Math.asin(e))),IN={kernelName:ka,backendName:"cpu",kernelFunc:EN},TN=IT(Sa,(e=>Math.asinh(e))),NN={kernelName:Sa,backendName:"cpu",kernelFunc:TN},ON=IT(_a,(e=>Math.atan(e))),RN={kernelName:_a,backendName:"cpu",kernelFunc:ON},DN=BT(((e,t)=>Math.atan2(e,t))),MN=nN(Ia,DN),FN={kernelName:Ia,backendName:"cpu",kernelFunc:MN},BN=IT(Ea,(e=>Math.atanh(e))),zN={kernelName:Ea,backendName:"cpu",kernelFunc:BN};function LN(e,t,n,s,r,i){const a=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,h=r.effectiveFilterWidth,d=r.padInfo.top,p=r.padInfo.left,f="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=fd(r.outShape,n),g=m.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],b=r.outShape[2]*r.outShape[3],w=r.outShape[3];for(let t=0;ty?y=a:"avg"===i&&(b+=a,v++)}if(isNaN(y))break}g[C+n*w+t]="avg"===i?b/v:y}}}return m}function PN(e,t,n,s,r=!1,i=!1){const a=fd(s.outShape,"int32"),o=s.strideHeight,l=s.strideWidth,u=s.dilationHeight,c=s.dilationWidth,h=s.effectiveFilterHeight,d=s.effectiveFilterWidth,p=s.padInfo.top,f=s.padInfo.left,m=fd(t,n,e);for(let e=0;ev&&(v=u,A=r?i?((e*s.inHeight+n)*s.inWidth+o)*s.inChannels+t:(n*s.inWidth+o)*s.inChannels+t:a*d+l)}}a.set(A,e,n,o,t)}}return a}function VN(e,t,n,s,r,i){const a=r.strideDepth,o=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,c=r.dilationHeight,h=r.dilationWidth,d=r.effectiveFilterDepth,p=r.effectiveFilterHeight,f=r.effectiveFilterWidth,m=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,b="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=fd(r.outShape,n),v=w.values,A=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],x=r.outShape[2]*r.outShape[3]*r.outShape[4],C=r.outShape[3]*r.outShape[4],k=r.outShape[4];for(let t=0;tx?x=r:"avg"===i&&(C+=r,S++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}v[g+t]="avg"===i?C/Math.max(S,1):x}}}}return w}const WN={kernelName:Ta,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;kT(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;Ni(hf(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))c=RT({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=Yi(r.shape),s=LN(e,r.shape,r.dtype,t,u,"avg");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const GN={kernelName:Oa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:u}=s;kT(r,"avgPool3d");const c=tf(r.shape,i,a,1,o,l,u),h=VN(n.data.get(r.dataId).values,r.shape,r.dtype,Yi(r.shape),c,"avg");return n.makeTensorInfo(h.shape,"float32",h.values)}};const UN={kernelName:Ra,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:u}=s;kT([r,i],"avgPool3DGrad");const c=tf(i.shape,a,o,1,l,u),h=c.strideDepth,d=c.strideHeight,p=c.strideWidth,f=c.filterDepth,m=c.filterHeight,g=c.filterWidth,y=c.dilationDepth,b=c.dilationHeight,w=c.dilationWidth,v=c.effectiveFilterDepth,A=c.effectiveFilterHeight,x=c.effectiveFilterWidth,C=v-1-c.padInfo.front,k=x-1-c.padInfo.left,S=A-1-c.padInfo.top,_=fd(i.shape,"float32"),E=1/(f*m*g),I=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let n=0;n=c.outHeight||Math.floor(r)!==r))for(let n=0;n=c.outWidth||Math.floor(i)!==i)continue;l+=I.get(e,s,r,i,t)}}}_.set(l*E,e,n,s,r,t)}return n.makeTensorInfo(_.shape,_.dtype,_.values)}};const qN={kernelName:Na,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;kT([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=ef(a.shape,o,l,1,u),h=c.strideHeight,d=c.strideWidth,p=c.filterHeight,f=c.filterWidth,m=c.dilationHeight,g=c.dilationWidth,y=c.effectiveFilterHeight,b=c.effectiveFilterWidth,w=b-1-c.padInfo.left,v=y-1-c.padInfo.top,A=fd(a.shape,"float32"),x=1/(p*f),C=n.data.get(r.dataId).values,k=fd(r.shape,"float32",C);for(let e=0;e=c.outHeight||Math.floor(s)!==s))for(let n=0;n=c.outWidth||Math.floor(r)!==r)continue;a+=k.get(e,s,r,t)}}A.set(a*x,e,n,s,t)}return n.makeTensorInfo(A.shape,A.dtype,A.values)}};const jN={kernelName:_o,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,scale:i,offset:a,mean:o,variance:l}=t;Ni(o.shape.length===l.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),Ni(null==a||o.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),Ni(null==i||o.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),kT([r,o,l,i,a],"batchNorm");let{varianceEpsilon:u}=s;null==u&&(u=.001);const c=n.data.get(r.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=i?n.data.get(i.dataId).values:new Float32Array([1]),f=a?n.data.get(a.dataId).values:new Float32Array([0]),m=new Float32Array(c.length),g=f.length,y=p.length,b=d.length,w=h.length;let v=0,A=0,x=0,C=0;for(let e=0;e=g&&(v=0),A>=w&&(A=0),x>=y&&(x=0),C>=b&&(C=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};function HN(e,t,n,s,r){const i=Bp(s,t,n),a=Di(n),o=Yi(s);if(i){const n=zp(t,o);return"string"===r?e.slice(n,n+a):e.subarray(n,n+a)}const l=fd(s,r,"string"===r?mv(e):e),u=fd(n,r);for(let e=0;ee+t[n]));u.set(l.get(...s),...n)}return"string"===r?gv(u.values):u.values}function $N(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s;kT(r,"slice");const[o,l]=Lp(r,i,a);kp(r,o,l);const u=HN(n.data.get(r.dataId).values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const KN={kernelName:Wl,backendName:"cpu",kernelFunc:$N};const XN={kernelName:Ma,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;kT([r],"batchToSpaceND");const o=i.reduce(((e,t)=>e*t)),l=Aw(r.shape,i,o),u=xw(l.length,i.length),c=Cw(r.shape,i,o),h=kw(a,i.length),d=Sw(c,a,i.length),p=lN({inputs:{x:r},backend:n,attrs:{shape:l}}),f=AN({inputs:{x:p},backend:n,attrs:{perm:u}}),m=lN({inputs:{x:f},backend:n,attrs:{shape:c}}),g=$N({inputs:{x:m},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};function ZN(e,t,n,s,r){const i=Di(s),a=ta(r,n);for(let n=0;n=r||(a[s]+=i>0?t[n]:1)}return a}function YN(e,t,n,s=!1){const r=e.shape[0],i=e.shape[1],a=fd([r,n],t.dtype);for(let o=0;o=n||(s?a.set(1,o,i):t.size>0?a.set(a.get(o,i)+t.get(o,r),o,i):a.set(a.get(o,i)+1,o,i))}return a}const QN={kernelName:Fa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=ZN(n.data.get(r.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,o)}},JN=BT(((e,t)=>e&t)),eO=nN(Ba,JN),tO={kernelName:Ba,backendName:"cpu",kernelFunc:eO};const nO={kernelName:za,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,o=Gd(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},sO=ET((e=>Math.ceil(e))),rO=TT(Pa,sO),iO={kernelName:Pa,backendName:"cpu",kernelFunc:rO},aO=IT(Va,((e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,s=new Float32Array(Di(t.shape)),r=n.data.get(t.dataId),i=r.complexTensorInfos.real,a=r.complexTensorInfos.imag,o=n.data.get(i.dataId).values,l=n.data.get(a.dataId).values;for(let e=0;e{const n=Di(e.shape);r.set(e.vals,t),t+=n}))}else{let s=0;e.forEach((e=>{const i="string"===n?mv(e.vals):e.vals;let a=0;for(let n=0;ne.shape)),i);let a=dw(t.map((e=>e.shape)),i);if(0===Di(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Di(e.shape)>0));if(1===o.length)return RT({inputs:{x:o[0]},backend:n});if("complex64"===o[0].dtype){const e=o.map((e=>YT({inputs:{input:e},backend:n}))),t=o.map((e=>cO({inputs:{input:e},backend:n}))),s=dO({inputs:e,backend:n,attrs:{axis:i}}),r=dO({inputs:t,backend:n,attrs:{axis:i}}),a=KT({inputs:{real:s,imag:r},backend:n});return e.forEach((e=>n.disposeIntermediateTensorInfo(e))),t.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(r),a}const l=o.map((e=>{const t=Di(e.shape.slice(i));return lN({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),u=l.map((e=>({vals:n.data.get(e.dataId).values,shape:e.shape})));a=dw(l.map((e=>e.shape)),1);const c=1===l[0].shape[0],h=uO(u,a,t[0].dtype,c),d=dw(o.map((e=>e.shape)),i),p=n.makeTensorInfo(d,t[0].dtype,h);return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}const pO={kernelName:Ua,backendName:"cpu",kernelFunc:dO};function fO(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s;kT([r,i],"conv2d");const h=pf(l),d=nf(r.shape,i.shape,a,u,o,c,!1,h),p=d.filterHeight,f=d.filterWidth,m=d.dilationHeight,g=d.dilationWidth,y=d.padInfo.left,b=d.padInfo.top,w="channelsLast"===d.dataFormat,v=new gc(d.outShape,r.dtype),A=Yi(r.shape),x=Yi(i.shape),C=A[0],k=w?A[1]:A[2],S=w?A[2]:1,_=w?1:A[1],E=v.strides[0],I=w?v.strides[1]:v.strides[2],T=w?v.strides[2]:1,N=w?1:v.strides[1],O=n.data.get(r.dataId).values,R=n.data.get(i.dataId).values,D=v.values;for(let e=0;e=d.inHeight)continue;const i=e*x[0],a=t+n*k;for(let e=0;e=d.inWidth)continue;const r=a+s*S;let o=i+e*x[1];for(let e=0;e=u.inDepth)continue;const i=e*S[0],a=t+n*k[1];for(let e=0;e=u.inHeight)continue;const r=i+e*S[1],o=a+s*k[2];for(let e=0;e=u.inWidth)continue;const i=r+e*S[2],a=o+t*u.inChannels;let l=i;for(let e=0;eMath.cos(e))),xO={kernelName:Za,backendName:"cpu",kernelFunc:AO},CO=IT(Ya,(e=>Math.cosh(e))),kO={kernelName:Ya,backendName:"cpu",kernelFunc:CO};const SO={kernelName:eo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:u}=s,[c,h,d,p]=r.shape,f=i.shape[0],[m,g]=o,y=fd([f,m,g,p],"float32"),b=n.data.get(i.dataId).values,w=n.data.get(a.dataId).values,v=n.data.get(r.dataId).values,A=Yi(r.shape),x=Yi(y.shape);for(let e=0;e=c)continue;const o=m>1?(r-n)*(h-1)/(m-1):0,f=g>1?(i-s)*(d-1)/(g-1):0;for(let t=0;t1?n*(h-1)+t*o:.5*(n+r)*(h-1);if(c<0||c>h-1)for(let n=0;n1?s*(d-1)+l*f:.5*(s+i)*(d-1);if(c<0||c>d-1){for(let n=0;n1?s*(d-1)+n*f:.5*(s+i)*(d-1);if(r<0||r>d-1){for(let s=0;se+f-t-1:(e,t)=>e+t;for(let e=0;ee+f-t-1:(e,t)=>e+t;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`));const o=r.shape[0],l=r.shape[1],u=r.shape[2],c=r.shape[3],h=l*i,d=u*i,p=c/(i*i),f=n.data.get(r.dataId).values,m=new Float32Array(o*h*d*p);let g=0;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${d}'`));const p=nf(r.shape,i.shape,a,d,o,u,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:b}=p,w=b.left,v=b.top,A=p.outChannels/p.inChannels,x=new gc(p.outShape,r.dtype),C=n.data.get(r.dataId).values,k=n.data.get(i.dataId).values,S=x.values;for(let e=0;e=p.inHeight)continue;const i=e*h[0],a=t+n*c[1];for(let e=0;e=p.inWidth)continue;const r=i+e*h[1],o=a+s*p.inChannels;let l=t,u=r;for(let e=0;e{const{x:s,filter:r}=e,{strides:i,pad:a,dilations:o}=n,l=t,u=l.data.get(s.dataId).values,c=s.shape.length,h=l.data.get(r.dataId).values,d=r.shape.length,{batchSize:p,inHeight:f,inWidth:m,inChannels:g,outHeight:y,outWidth:b,padInfo:w,strideHeight:v,strideWidth:A,filterHeight:x,filterWidth:C,dilationHeight:k,dilationWidth:S,outShape:_}=Jp(s.shape,r.shape,i,a,"NHWC",o),E=Di(_),I=_.length,T=Ui(s.dtype,E);for(let e=0;e=0&&i=0&&pl&&(l=m)}}}T[ra([e,t,i,o],I,Yi(_))]=l}}}return{dataId:l.write(Ju(T,s.dtype),_,s.dtype),shape:_,dtype:s.dtype}}},BO={kernelName:uo,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,u=t,c=Ji(s.shape,u.data.get(s.dataId).values),h=Ji(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=Jp(s.shape,r.shape,a,o,"NHWC",l);Ni(i.rank===S.length,(()=>`Error in ${uo}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const _=Ji(S,u.data.get(i.dataId).values),E=na(r.shape,r.dtype);for(let e=0;e=0&&s=0&&ua&&(a=r,o=t,l=n)}}}E[o][l][i]+=_[e][t][s][i]}}}return{dataId:u.write(Ju(E,s.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},zO={kernelName:lo,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,u=t,c=Ji(s.shape,u.data.get(s.dataId).values),h=Ji(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=Jp(s.shape,r.shape,a,o,"NHWC",l);Ni(i.rank===S.length,(()=>`Error in ${lo}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const _=Ji(S,u.data.get(i.dataId).values),E=na(s.shape,s.dtype);for(let e=0;e=0&&s=0&&ua&&(a=r,o=s,l=u)}}}E[e][o][l][i]+=_[e][t][s][i]}}}return{dataId:u.write(Ju(E,s.dtype),s.shape,s.dtype),shape:s.shape,dtype:s.dtype}}};const LO={kernelName:co,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r}=t,{canvas:i,options:a}=s,{contextOptions:o,imageOptions:l}=a||{},u=(null==l?void 0:l.alpha)||1,c=(null==o?void 0:o.contextType)||"2d";if("2d"!==c)throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);const h=i.getContext(c,(null==o?void 0:o.contextAttributes)||{});if(null==h)throw new Error(`Could not get the context with ${c} type.`);const[d,p]=r.shape.slice(0,2),f=2===r.shape.length?1:r.shape[2],m=n.data.get(r.dataId).values,g="float32"===r.dtype?255:1,y=new Uint8ClampedArray(p*d*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${s}.`)}else if("int32"===r.dtype&&(s<0||s>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${s}.`);1===f?(t[0]=s*g,t[1]=s*g,t[2]=s*g):t[n]=s*g}const n=4*e;y[n+0]=Math.round(t[0]),y[n+1]=Math.round(t[1]),y[n+2]=Math.round(t[2]),y[n+3]=Math.round(t[3])}i.width=p,i.height=d;const b=new ImageData(y,p,d);return h.putImageData(b,0,0),r}},PO=BT(((e,t)=>e*t)),VO=sN(((e,t,n,s)=>({real:e*n-t*s,imag:e*s+t*n}))),WO=nN(ol,PO,VO),GO={kernelName:ol,backendName:"cpu",kernelFunc:WO};function UO(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;let o;kT(r,"sum"),o="bool"===r.dtype?eN({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):RT({inputs:{x:r},backend:n});const l=o.shape.length,u=Vi(i,o.shape),c=fm(u,l);let h=u,d=o;null!=c&&(d=AN({inputs:{x:o},backend:n,attrs:{perm:c}}),h=gm(h.length,l)),pm("sum",h,d.shape.length);const[p,f]=hm(d.shape,h);let m=ZT(n,p,Tc(d.dtype,"int32"));const g=Di(f),y=n.data.get(m.dataId).values,b=n.data.get(d.dataId).values;for(let e=0;e=0&&(d=UO({inputs:{x:d},backend:n,attrs:{axis:u[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}};const HO={kernelName:mo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:s,y:r}=t;kT([s,r],"eluGrad");const i=new Float32Array(Di(r.shape)),a=n.data.get(r.dataId).values,o=n.data.get(s.dataId).values;for(let e=0;e=0?o[e]:o[e]*(t+1)}return n.makeTensorInfo(r.shape,"float32",i)}},$O=BT(((e,t)=>e===t?1:0)),KO=nN(yo,$O,null,"bool"),XO={kernelName:yo,backendName:"cpu",kernelFunc:KO},ZO=Tw,YO=Nw,QO=Ow,JO=Rw,eR=Dw,tR=Mw,nR=IT(go,(e=>{const t=Math.sign(e),n=Math.abs(e),s=1/(1+ZO*n);return t*(1-((((tR*s+eR)*s+JO)*s+QO)*s+YO)*s*Math.exp(-n*n))})),sR={kernelName:go,backendName:"cpu",kernelFunc:nR},rR=ET((e=>Math.exp(e))),iR=TT(bo,rR,"float32"),aR={kernelName:bo,backendName:"cpu",kernelFunc:iR};function oR(e){const{inputs:t,backend:n,attrs:s}=e,{input:r}=t,{dim:i}=s,a=r.shape.length,o=r.shape.slice();let l=i;return i<0&&(Ni(-(a+1)<=i,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+i+1),o.splice(l,0,1),lN({inputs:{x:r},backend:n,attrs:{shape:o}})}const lR={kernelName:wo,backendName:"cpu",kernelFunc:oR},uR=ET((e=>Math.expm1(e))),cR=TT(vo,uR),hR={kernelName:vo,backendName:"cpu",kernelFunc:cR},dR=BT(((e,t)=>e/t)),pR=nN(ho,dR),fR={kernelName:ho,backendName:"cpu",kernelFunc:pR},mR=BT(((e,t)=>e-t)),gR=sN(((e,t,n,s)=>({real:e-n,imag:t-s}))),yR=nN(cu,mR,gR),bR={kernelName:cu,backendName:"cpu",kernelFunc:yR};function wR(e,t,n){const s=e.shape,r=s[0],i=s[1],a=n.data.get(e.dataId),o=a.complexTensorInfos.real,l=a.complexTensorInfos.imag,u=[r,i],c=Di(u),h=Gi("float32",c),d=Gi("float32",c);for(let e=0;e{const{image:s}=e,r=n,i=Gi(s.dtype,Di(s.shape)),[a,o,l,u]=s.shape,c=r.data.get(s.dataId).values;for(let e=0;e=0&&aMath.floor(e))),ER=TT(ko,_R),IR={kernelName:ko,backendName:"cpu",kernelFunc:ER},TR=BT(((e,t)=>Math.floor(e/t))),NR=nN(So,TR,null,"int32"),OR={kernelName:So,backendName:"cpu",kernelFunc:NR};const RR={kernelName:Su,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=fO({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(a){const e=m;if("NCHW"===c&&1===a.shape.length&&1!==a.shape[0]){const e=lN({inputs:{x:a},backend:n,attrs:{shape:[a.shape[0],1,1]}});m=aN({inputs:{a:m,b:e},backend:n}),n.disposeIntermediateTensorInfo(e)}else m=aN({inputs:{a:m,b:a},backend:n});n.disposeIntermediateTensorInfo(e)}if(p){const e=m;if("NCHW"===c&&"prelu"===p&&1===o.shape.length&&1!==o.shape[0]){const e=lN({inputs:{x:o},backend:n,attrs:{shape:[o.shape[0],1,1]}});m=$T(n,m,p,e,f),n.disposeIntermediateTensorInfo(e)}else m=$T(n,m,p,o,f);n.disposeIntermediateTensorInfo(e)}return m}};const DR={kernelName:_u,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=NO({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(a){const e=m;m=aN({inputs:{a:m,b:a},backend:n}),n.disposeIntermediateTensorInfo(e)}if(p){const e=m;m=$T(n,m,p,o,f),n.disposeIntermediateTensorInfo(e)}return m}};function MR(e,t,n,s,r,i,a,o,l){const u=fd([s,i],n);for(let n=0;n=l/i)throw new Error(`Invalid indices: ${s} does not index into ${o}`);for(let e=0;e=0,(()=>`GatherV2: the index value ${t} is not in [0, ${c-1}]`))}let h=o;null==o&&(h=0);const d=Di(i.shape),p=fv(r,i,l,h),f=lN({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=lN({inputs:{x:i},backend:n,attrs:{shape:[p.batchSize,d/p.batchSize]}}),g=[p.batchSize,p.outerSize,d/p.batchSize,p.sliceSize],y=n.bufferSync(m),b=BR(n.bufferSync(f),y,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,b.dtype,b.values)}},LR=BT(((e,t)=>e>t?1:0)),PR=nN(To,LR,null,"bool"),VR={kernelName:To,backendName:"cpu",kernelFunc:PR},WR=BT(((e,t)=>e>=t?1:0)),GR=nN(No,WR,null,"bool"),UR={kernelName:No,backendName:"cpu",kernelFunc:GR};const qR={kernelName:Ro,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t,r=Di(s.shape),i=s.shape[s.shape.length-1],a=lN({inputs:{x:s},backend:n,attrs:{shape:[r/i,i]}}),o=wR(a,!0,n),l=lN({inputs:{x:o},backend:n,attrs:{shape:s.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(o),l}},jR=IT(Mo,(e=>Number.isFinite(e)?1:0),"bool"),HR={kernelName:Mo,backendName:"cpu",kernelFunc:jR},$R=IT(Fo,(e=>Math.abs(e)===1/0?1:0),"bool"),KR={kernelName:Fo,backendName:"cpu",kernelFunc:$R},XR=IT(Bo,(e=>Number.isNaN(e)?1:0),"bool"),ZR={kernelName:Bo,backendName:"cpu",kernelFunc:XR},YR=BT(((e,t)=>ee<=t?1:0)),tD=nN(Po,eD,null,"bool"),nD={kernelName:Po,backendName:"cpu",kernelFunc:tD};function sD(e,t,n){const s=(t-e)/(n-1),r=ta(n,"float32");r[0]=e;for(let e=1;eMath.log(e))),aD=TT(Wo,iD),oD={kernelName:Wo,backendName:"cpu",kernelFunc:aD},lD=IT(Go,(e=>Math.log1p(e))),uD={kernelName:Go,backendName:"cpu",kernelFunc:lD},cD=BT(((e,t)=>e&&t)),hD=nN(Uo,cD,null,"bool"),dD={kernelName:Uo,backendName:"cpu",kernelFunc:hD},pD=IT(qo,(e=>e?0:1),"bool"),fD={kernelName:qo,backendName:"cpu",kernelFunc:pD},mD=BT(((e,t)=>e||t)),gD=nN(jo,mD,null,"bool"),yD={kernelName:jo,backendName:"cpu",kernelFunc:gD};const bD={kernelName:Ho,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s;kT(r,"LRN");const u=r.shape[3],c=u-1,h=n.data.get(r.dataId).values,d=Di(r.shape),p=new Float32Array(d);function f(e){const t=e%u;let n=e-t+Math.max(0,t-i);const s=e-t+Math.min(t+i,c);let r=0;for(;n<=s;n++){const e=h[n];r+=e*e}return r}for(let e=0;ei)&&(i=t)}r[n]=i}return r}function AD(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=n;let l=r.shape;const u=l.length,c=Vi(i,l);let h=c;const d=fm(h,u);let p=o.data.get(r.dataId).values;if(null!=d){const e=new Array(u);for(let t=0;tMath.max(e,t))),kD=nN(Xo,CD),SD={kernelName:Xo,backendName:"cpu",kernelFunc:kD};const _D={kernelName:Zo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;kT(r,"maxPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;Ni(hf(a,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))c=RT({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=Yi(r.shape),s=LN(e,r.shape,r.dtype,t,u,"max");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const ED={kernelName:Qo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:u}=s;kT(r,"maxPool3d");const c=tf(r.shape,i,a,1,o,l,u),h=VN(n.data.get(r.dataId).values,r.shape,r.dtype,Yi(r.shape),c,"max");return n.makeTensorInfo(h.shape,"float32",h.values)}};const ID={kernelName:Jo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:u}=s;kT([r,i],"maxPool3DGrad");const c=tf(i.shape,a,o,1,l,u),h=function(e,t){const n=fd(t.outShape,"int32"),s=t.strideDepth,r=t.strideHeight,i=t.strideWidth,a=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=k&&(k=o,S=n*c*h+r*c+a)}}}n.set(S,m,y,s,r,g)}}}return n}(n.bufferSync(i),c),d=c.strideDepth,p=c.strideHeight,f=c.strideWidth,m=c.dilationDepth,g=c.dilationHeight,y=c.dilationWidth,b=c.effectiveFilterDepth,w=c.effectiveFilterHeight,v=c.effectiveFilterWidth,A=b-1-c.padInfo.front,x=v-1-c.padInfo.left,C=w-1-c.padInfo.top,k=fd(i.shape,"float32"),S=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let r=0;r=c.outHeight||Math.floor(i)!==i))for(let a=0;a=c.outWidth||Math.floor(u)!==u)continue;const d=b*w*v-1-h.get(e,s,i,u,t)===n*w*v+r*v+a?1:0;if(0===d)continue;l+=S.get(e,s,i,u,t)*d}}}k.set(l,e,n,s,r,t)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}};const TD={kernelName:Yo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;kT([i,a],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=ef(o.shape,l,u,1,c,h),p=n.data.get(o.dataId).values,f=fd(d.outShape,o.dtype,PN(p,o.shape,o.dtype,d).values),m=d.strideHeight,g=d.strideWidth,y=d.dilationHeight,b=d.dilationWidth,w=d.effectiveFilterHeight,v=d.effectiveFilterWidth,A=v-1-d.padInfo.left,x=w-1-d.padInfo.top,C=fd(o.shape,"float32"),k=n.data.get(r.dataId).values,S=fd(r.shape,"float32",k);for(let e=0;e=d.outHeight||Math.floor(s)!==s))for(let r=0;r=d.outWidth||Math.floor(o)!==o)continue;const l=w*v-1-f.get(e,s,o,t)===n*v+r?1:0;if(0===l)continue;a+=S.get(e,s,o,t)*l}}C.set(a,e,n,s,t)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}};const ND={kernelName:el,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;kT(s,"MaxPoolWithArgmax");const u=l.data.get(s.dataId).values,c=ef(s.shape,r,i,[1,1],a),[h,d]=function(e,t,n,s,r){const i=LN(e,0,n,Yi(t),r,"max"),a=PN(e,t,n,r,!0,s);return[i.values,a.values]}(u,s.shape,s.dtype,o,c),p=l.write(h,c.outShape,s.dtype),f=l.write(d,c.outShape,s.dtype);return[{dataId:p,shape:c.outShape,dtype:s.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};const OD={kernelName:tl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=Vi(i,r.shape),l=Di(hm(r.shape,o)[1]),u=[],c=n.makeTensorInfo([],"float32",new Float32Array([l]));u.push(c);const h=eN({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});u.push(h);const d=pR({inputs:{a:h,b:c},backend:n});u.push(d);const p=UO({inputs:{x:d},backend:n,attrs:{axis:i,keepDims:a}});return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}};const RD={kernelName:nl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;kT(r,"min");const o=Vi(i,r.shape);let l=o;const u=fm(l,r.shape.length);let c=r;null!=u&&(c=AN({inputs:{x:r},backend:n,attrs:{perm:u}}),l=gm(l.length,r.shape.length)),pm("min",l,c.shape.length);const[h,d]=hm(c.shape,l),p=Di(d),f=ta(Di(h),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;eMath.min(e,t))),MD=nN(sl,DD),FD={kernelName:sl,backendName:"cpu",kernelFunc:MD};const BD={kernelName:rl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,mode:a}=s;kT(r,"mirrorPad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),u=i.map(((e,t)=>e[0]+r.shape[t])),c="reflect"===a?0:1,h=n.data.get(r.dataId).values,d=r.shape.length,p=Yi(r.shape),f=Di(o),m=o.length,g=Yi(o),y=Gi(r.dtype,f);for(let e=0;e=u[e]&&(t[e]=2*(u[e]-1)-t[e]+c);t=t.map(((e,t)=>e-l[t]));const n=ra(t,d,p);y[e]=h[n]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}},zD=BT(((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),LD=nN(il,zD),PD={kernelName:il,backendName:"cpu",kernelFunc:LD};function VD(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=r.shape.length;let o=i;if(-1===o&&(o=a-1),o!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${o}`);const l=Vi([o],r.shape),u=AD({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),c=dm(u.shape,l),h=lN({inputs:{x:u},backend:n,attrs:{shape:c}}),d=yR({inputs:{a:r,b:h},backend:n}),p=iR({inputs:{x:d},backend:n}),f=UO({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=lN({inputs:{x:f},backend:n,attrs:{shape:c}}),g=pR({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const WD={kernelName:Yl,backendName:"cpu",kernelFunc:VD};const GD={kernelName:al,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s;kT(r,"multinomial");const l=o?r:VD({inputs:{logits:r},backend:n,attrs:{dim:-1}}),u=l.shape[0],c=l.shape[1],h=n.data.get(l.dataId).values,d=[u,i],p=ta(Di(d),"int32");for(let e=0;ee!==t?1:0)),QD=nN(ul,YD,null,"bool"),JD={kernelName:ul,backendName:"cpu",kernelFunc:QD};const eM={kernelName:fl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s;kT(r,"oneHot");const u=Di(r.shape),c=new Float32Array(u*a);c.fill(l);const h=n.data.get(r.dataId).values;for(let e=0;e=0&&h[e]{Oi(i,e.shape,"All tensors passed to stack must have matching shapes"),Ni(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=dO({inputs:t.map((e=>{const t=oR({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}const iM={kernelName:ml,backendName:"cpu",kernelFunc:rM};const aM={kernelName:gl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,constantValue:a}=s;kT(r,"pad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),u=n.data.get(r.dataId).values,c=Di(r.shape),h=r.shape.length,d=Yi(r.shape),p=Di(o),f=o.length,m=Yi(o),g=Gi(r.dtype,p);0!==a&&g.fill(a);for(let e=0;ee+l[t])),f,m)]=u[e]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}},oM=BT(((e,t)=>Math.pow(e,t))),lM=nN(yl,oM),uM={kernelName:yl,backendName:"cpu",kernelFunc:lM};function cM(e,t,n,s){const[r,i]=hm(e,s),a=Tc(t,"int32"),o=ta(Di(r),a),l=Di(i);for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(y,g,f)}};function dM(e,t,n,s){const r=[];let i=0;const a=t.length-1+n.length,o=new Array(a).fill(null).map((()=>[0]));!function(e,t){for(let n=0;nr)throw new Error("Ragged splits must not point past values");for(let e=1;es[e])throw new Error("Ragged splits must be sorted in ascending order")}}(n,s);let l=1;for(let e=0;e=0){const e=o[r],t=e[e.length-1]-s[a];for(let e=a;e{if(e<0||e>=n){const r=ia(s,t.length,Yi(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}}))}(i,a,t[0][0]-1),0===s.length)throw new Error("params.rank must be nonzero");const l=s[0],{outSplits:u,valueSlices:c,numValues:h}=dM(i,a,e,l),d=function(e){const t=[];for(let n=0;ns[t]=e))}return t}(u),p=fM(n,s,r,c,h);return[d,p[0],p[1]]}const gM={kernelName:vl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.data.get(e.dataId).values)),u=r.map((e=>e.shape)),c=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,[d,p,f]=mM(l,u,c,i.shape,i.dtype,h,a.shape),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}},yM=2147483647;function bM(e,t,n,s,r,i,a){if(t.length>1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(a.length>1)throw new Error("deltas must be a scalar or vector");const o=0===t.length,l=0===r.length,u=0===a.length,c=[];o||c.push(t[0]),l||c.push(r[0]),u||c.push(a[0]);for(let e=1;e0&&rn)c=0;else if(c=Math.ceil(Math.abs((r-n)/a)),c>yM)throw new Error(`Requires ((limit - start) / delta) <= ${yM}`);d[t+1]=d[t]+c}const p=Ui(n,d[h]);let f=0;for(let t=0;tn&&(n=t)}return n}static getMaxWidthValueRowID(e){const t=e.length;if(0===t)return 0;let n=0,s=e[0],r=0;for(let i=1;i"Final length of result must be equal to firstDimension.")),r}calculateOutputIndexRowSplit(e,t,n,s){const r=e.length,i=[];for(let a=0;a0&&i.length!==e[r-1])throw new Error("Invalid row split size.");return i}calculateOutputIndexValueRowID(e,t,n,s){const r=e.length,i=[];if(0===r)return[];let a=0,o=e[0];if(o>=t.length)throw new Error(`Got currentValueRowId=${o}, which is not less than ${t.length}`);let l=t[o];i.push(l);for(let u=1;u=0&&(++a,a=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}i.push(l)}if(i.length!==e.length)throw new Error("Invalid row ids.");return i}calculateOutputIndex(e,t,n,s){const r=this.getRowPartitionTensor(e),i=this.getRowPartitionTypeByDimension(e);switch(i){case vM.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,s);case vM.ROW_SPLITS:if(r.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${r.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(r,t,n,s);default:throw new Error(`Unsupported partition type: ${vM[i]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const t=this.rowPartitionTypes[0];switch(t){case vM.FIRST_DIM_SIZE:return e[0];case vM.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case vM.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${vM[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const e=this.getFirstDimensionSize(),t=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let e=n.length-2;e>=0;--e)n[e]=n[e+1]*t[e+1];const s=CM(t,!1),r=Ui(this.valuesDType,Di(s));if(n[0]*t[0]>0){let i=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){i=this.calculateOutputIndex(e-1,i,n[e],t[e])}this.setOutput(this.raggedRank,i,r,s)}return[s,r]}setOutput(e,t,n,s){if(0===n.length)return;const r=this.values,i=n;let a=s.slice();a=a.slice(e+1);const o=Di(a),l=t.length;let u=this.defaultValue;if(u.length!==o&&1!==u.length){const e=this.defaultValueShape;oh((()=>{const t=mf(u,e),n=Rf(t,a);u=n.dataSync()}))}let c=0,h=0,d=0;for(let e=0;e<=l;++e){let s=e=l){const e=n.length;s=Math.floor(e/o)}if(s>d)if(1===this.defaultValue.length)i.subarray(d*o,s*o).fill(this.defaultValue[0]),d=s;else for(;s>d;){xM(i.slice(d*o),u,o),++d}s<0?(c=e+1,h=d):(c=e,h=d,d=h+1)}else++d}}}function xM(e,t,n){for(let s=0;s= 0`);if(s<-1)throw new Error(`Dimension ${s} must be >= -1`);s=-1}n.push(s)}return n}function kM(e,t,n,s,r,i,a,o,l,u){return new AM(e,t,n,s,r,i,a,o,l,u).compute()}const SM={kernelName:xl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.data.get(r.dataId).values,c=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,d=o.map((e=>n.data.get(e.dataId).values)),p=o.map((e=>e.shape)),[f,m]=kM(u,r.shape,c,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}};function _M(e,t,n,s){if(e===t||e1)return ta(0,s);const r=ta(Math.abs(Math.ceil((t-e)/n)),s);t1/e)),TM={kernelName:Sl,backendName:"cpu",kernelFunc:IM};const NM={kernelName:Nl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s;kT(r,"resizeBilinear");const l=Yi(r.shape),[u,c]=o,[h,d,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array(Di([h,u,c,f])),y=[i&&u>1?d-1:d,i&&c>1?p-1:p],b=[i&&u>1?u-1:u,i&&c>1?c-1:c];let w=0;const v=y[0]/b[0],A=y[1]/b[1];for(let e=0;e1?u-1:u,a&&p>1?c-1:c],g=[a&&d>1?d-1:d,a&&p>1?p-1:p],y=m[0]/g[0],b=m[1]/g[1],w=n.data.get(i.dataId).values;let v=0;for(let e=0;e1?d-1:d,i&&c>1?p-1:p],b=[i&&u>1?u-1:u,i&&c>1?c-1:c],w=y[0]/b[0],v=y[1]/b[1];let A=0;for(let e=0;e1?c-1:c,a&&f>1?h-1:h],b=[a&&p>1?p-1:p,a&&f>1?f-1:f],w=y[0]/b[0],v=y[1]/b[1],A=1/w,x=1/v,C=2*Math.ceil(A)+2,k=2*Math.ceil(x)+2;for(let e=0;e=p)continue;const d=t+u*l[1],m=u*w;if(e===Math.min(c-1,a?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=d+t*l[2],i=t*v;s===Math.min(h-1,a?Math.round(i):Math.floor(i))&&(o+=g[r+n])}}m[i+n]=o}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const MM={kernelName:Dl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s;kT(r,"reverse");const a=r.shape.length,o=Vi(i,r.shape);if(0===a)return RT({inputs:{x:r},backend:n});const l=new gc(r.shape,r.dtype),u=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e])),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},FM={kernelName:Cu,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=Gi(s.dtype,Di(s.shape)),[u,c,h,d]=s.shape,[p,f]=vw(a,c,h),m=Math.sin(r),g=Math.cos(r),y=o.data.get(s.dataId).values;for(let e=0;e=0&&v=0&&A{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),zM={kernelName:Ml,backendName:"cpu",kernelFunc:BM},LM=ET((e=>1/Math.sqrt(e))),PM=TT(Fl,LM),VM={kernelName:Fl,backendName:"cpu",kernelFunc:PM};function WM(e,t,n,s,r,i,a,o,l,u){const c=[s/r,r],h=e.values,d=t.values;if(0===s)return fd(n,t.dtype);const p=l instanceof gc?l:fd(c,t.dtype);"string"==typeof l||"number"==typeof l?p.values.fill(l):"boolean"==typeof l&&p.values.fill(+l);for(let e=0;e=s/r)throw new Error(`Invalid indices: ${i} does not index into ${n}`);for(let n=0;n1||1===r.shape.length?1:Di(r.shape.slice(1));for(let e=0;ee>=0?KM*e:$M*(Math.exp(e)-1))),ZM={kernelName:Vl,backendName:"cpu",kernelFunc:XM},YM=IT(ql,(e=>e<0?-1:e>0?1:0)),QM={kernelName:ql,backendName:"cpu",kernelFunc:YM},JM=IT(Gl,(e=>Math.sin(e))),eF={kernelName:Gl,backendName:"cpu",kernelFunc:JM},tF=IT(Ul,(e=>Math.sinh(e))),nF={kernelName:Ul,backendName:"cpu",kernelFunc:tF},sF=Math.log(1.1920928955078125e-7)+2,rF=IT(Hl,(e=>{const t=e>-sF,n=e=l)throw new Error(nv(t,n,l));++f[n],d=d&&n>=p,p=n}let m=!0;for(let e=0;e0&&(f[e]+=f[e-1])}if(m&&d){const t=e,n=s;for(let e=0;eNumber(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};function uF(e,t,n,s,r){const i=Di(s),a=t[0],o=r.length,l=[];let u=1,c=-1;for(let e=0;e0){d[h-1]=1;for(let e=h-2;e>=0;--e)d[e]=d[e+1]*s[e+1]}const p=[];if(o>0){p[o-1]=1;for(let e=o-2;e>=0;--e)p[e]=p[e+1]*l[e+1]}const f=Ui(n,a*o);for(let t=0;t0?r[o-1]+1:0;if(c<0)throw new Error("segment ids must be >= 0");const h=t.slice();h[0]=c;const d=Ui(n,h.reduce(((e,t)=>e*t),1));if(0===o)return c>0&&d.fill(a),[d,h];if(c<=0)throw new Error("segment ids must be >= 0");let p=0,f=1,m=0,g=r[p];for(;;){let t=0;if(f=t)throw new Error("segment ids are not increasing")}if(g<0||g>=c)throw new Error(cv(g,c));g>m&&d.fill(a,m*u,g*u);for(let t=p;t=l[0])throw new Error(hv(t,s[t],l[0]));for(let t=0;to)break}return m{const t=[...c];t[o]=e;const s=$N({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[o]+=e,s}))}},gF=ET((e=>Math.sqrt(e))),yF=IT($l,(e=>Math.sqrt(e))),bF={kernelName:$l,backendName:"cpu",kernelFunc:yF},wF={kernelName:ru,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,s=t;kT(n,"square");const r=s.data.get(n.dataId).values,i=new Float32Array(r.length);for(let e=0;e{const n=e-t;return n*n})),AF=nN(su,vF),xF={kernelName:su,backendName:"cpu",kernelFunc:AF},CF=ET(((e,t)=>{const{pattern:n,replaceGlobal:s,rewrite:r}=t;return e.replace(new RegExp(n,s?"g":""),r)})),kF=TT(iu,CF),SF={kernelName:iu,backendName:"cpu",kernelFunc:kF},_F=IT(Au,((e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),EF={kernelName:Au,backendName:"cpu",kernelFunc:_F};function IF(e,t,n,s){const r=fd(e,t.dtype);for(let e=0;e=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=_p(b,w,v),t=$N({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=lN({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=IF(p,n.bufferSync(r),v,b);A=n.makeTensorInfo(f,e.dtype,e.values)}return A}};class NF{constructor(e,t,n,s,r,i){this.separator=tc(e),this.nGramWidths=t,this.leftPad=tc(n),this.rightPad=tc(s),this.padWidth=r,this.preserveShort=i}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const n=this.getPadWidth(t);return Math.max(0,e+2*n-t+1)}createNGrams(e,t,n,s,r,i){for(let a=0;a0?0:a-o);let d=0;d+=l*this.leftPad.length;for(let t=0;te.forEach((e=>p[f++]=e));for(let e=0;e0){m(e[h+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let r=1;r=e;if(s=s&&t[r]<=n,!s)throw new Error(`Invalid split value ${t[r]}, must be in [${e}, ${n}]`);e=t[r]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const r=s-1,i=Ui("int32",s);if(0===n||0===s){const e=new Array(n);for(let e=0;e<=r;++e)i[e]=0;return[e,i]}i[0]=0;for(let e=1;e<=r;++e){const n=t[e]-t[e-1];let s=0;this.nGramWidths.forEach((e=>{s+=this.getNumNGrams(n,e)})),this.preserveShort&&n>0&&0===s&&(s=1),i[e]=i[e-1]+s}const a=new Array(i[r]);for(let n=0;n{const o=t[n+1]-t[n],l=this.getNumNGrams(o,i);this.createNGrams(e,s,a,r,l,i),r+=l})),this.preserveShort&&r===i[n]){const i=t[n+1]-t[n];if(0===i)continue;const o=i+2*this.padWidth,l=1;this.createNGrams(e,s,a,r,l,o)}}return[a,i]}}function OF(e,t,n,s,r,i,a,o){return new NF(n,s,r,i,a,o).compute(e,t)}const RF={kernelName:ou,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.data.get(c.dataId).values,p=n.data.get(h.dataId).values,[f,m]=OF(d,p,r,i,a,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};function DF(e,t,n,s){if(!e.length)return;if(0===t.length){for(let t=0;tMath.tan(e))),PF={kernelName:hu,backendName:"cpu",kernelFunc:LF},VF=IT(du,(e=>Math.tanh(e)));const WF={kernelName:zl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{tensor:s,indices:r,updates:i}=t,{sliceRank:a,numUpdates:o,sliceSize:l,strides:u,outputSize:c}=Ey(0,r,s.shape),h=n.bufferSync(r),d=n.bufferSync(i),p=n.bufferSync(s),f=WM(h,d,s.shape,c,l,o,a,u,p,!1);return n.makeTensorInfo(s.shape,f.dtype,f.values)}};function GF(e,t){const n=new Array(e.rank);for(let s=0;s{const n=t.value-e.value;return 0===n?e.index-t.index:n};function jF(e,t,n=0,s=e.length-1){for(;s>n;){if(s-n>600){const r=s-n+1,i=t-n+1,a=Math.log(r),o=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*o*(r-o)/r)*Math.sign(i-r/2);jF(e,t,Math.max(n,Math.floor(t-i*o/r+l)),Math.min(s,Math.floor(t+(r-i)*o/r+l)))}const r=e[t];let i=n,a=s;for(Ti(e,n,t),qF(e[s],r)>0&&Ti(e,n,s);i0;)a-=1}0===qF(e[n],r)?Ti(e,n,a):(a+=1,Ti(e,a,s)),a<=t&&(n=a+1),t<=a&&(s=a-1)}}function HF(e,t,n,s,r){const i=t[t.length-1],[a,o]=[e.length/i,i],l=Gi(n,a*s),u=Gi("int32",a*s);for(let t=0;ta[t]={value:e,index:t})),st-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return Ei(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return Ei(0,n,t-1)}(e,t);case"nearest":return function(e,t){return Ei(0,e,t-1)}(e,t);default:return function(e,t){return e}(e)}}function ZF(e,t,n,s,r,i,a,o,l,u,c){return 0<=o&&o{for(let n=0;nn.disposeIntermediateTensorInfo(e))),h}},sB=[dN,fN,gN,bN,oN,wN,CN,kN,SN,_N,IN,NN,RN,FN,zN,WN,GN,UN,qN,hN,jN,XN,QN,tO,nO,tN,iO,oO,XT,lO,pO,mO,gO,yO,bO,wO,vO,xO,kO,SO,_O,EO,IO,TO,OO,RO,DO,MO,FO,BO,zO,LO,jO,OT,HO,XO,sR,aR,lR,hR,xR,kR,SR,IR,OR,RR,DR,FR,zR,VR,UR,DT,qR,hO,HR,KR,ZR,FT,JR,nD,rD,oD,uD,dD,fD,yD,bD,wD,xD,SD,_D,ED,ID,TD,ND,OD,RD,FD,BD,PD,GD,GO,qD,HD,KD,ZD,JD,eM,sM,iM,aM,uM,PT,hM,gM,wM,SM,EM,QT,fR,TM,WT,UT,uN,NM,OM,RM,DM,MM,FM,zM,VM,GM,jM,HM,ZM,HT,QM,eF,nF,KN,WD,iF,aF,lF,cF,dF,pF,fF,mF,bF,wF,xF,SF,EF,TF,RF,FF,zF,bR,qO,PF,{kernelName:du,backendName:"cpu",kernelFunc:VF},WF,UF,$F,KF,xN,eB,tB,nB,nM];for(const e of sB)Mu(e);const rB={},iB={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function aB(e,t){if(!(e in rB)||null!=t){const n=function(e,t){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=null==t?function(e){if(ca().getBool("IS_SAFARI")||"undefined"==typeof OffscreenCanvas||2!==e){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}return new OffscreenCanvas(300,150)}(e):t;n.addEventListener("webglcontextlost",(t=>{t.preventDefault(),delete rB[e]}),!1),ca().getBool("SOFTWARE_WEBGL_ENABLED")&&(iB.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",iB)||n.getContext("experimental-webgl",iB);return n.getContext("webgl2",iB)}(e,t);if(null===n)return null;rB[e]=n}const n=rB[e];return null==n||n.isContextLost()?(delete rB[e],aB(e)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),rB[e])}var oB,lB,uB;function cB(e,t){return[t,e]}function hB(e){const t=Di(e);return Bi(Math.ceil(t/4))}function dB(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function pB(e,t){const n=e;let s,r,i,a,o,l,u,c,h,d;return 2===ca().getNumber("WEBGL_VERSION")?(s=n.R32F,r=n.R16F,i=n.RGBA16F,a=n.RGBA32F,o=n.RED,u=4,c=1,h=n.HALF_FLOAT,d=n.FLOAT,l=n.RGBA8):(s=e.RGBA,r=e.RGBA,i=e.RGBA,a=n.RGBA,o=e.RGBA,u=4,c=4,h=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT,l=e.RGBA),{internalFormatFloat:s,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:a,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:h,textureTypeFloat:d}}function fB(e,t){const n=t();return ca().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${t}`}}(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(oB||(oB={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(lB||(lB={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(uB||(uB={}));function mB(e){return!!(ca().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8e.getExtension(t)),'Extension "'+t+'" not supported on this browser.')}const yB=/ERROR: [0-9]+:([0-9]+):/g;function bB(e,t){const n=yB.exec(t);if(null==n)return;const s=+n[1],r=e.split("\n"),i=r.length.toString().length+2,a=r.map(((e,t)=>zi((t+1).toString(),i)+e));let o=0;for(let e=0;ee.validateProgram(t))),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw new Error("Shader program validation failed.")}function vB(e,t,n,s,r,i,a){const o=e.getAttribLocation(t,n);return-1!==o&&(fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,s))),fB(e,(()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,i,a))),fB(e,(()=>e.enableVertexAttribArray(o))),!0)}function AB(e,t,n,s){fB(e,(()=>function(e,t,n){_B(e,n),fB(e,(()=>e.activeTexture(e.TEXTURE0+n))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,t)))}(e,t,s))),fB(e,(()=>e.uniform1i(n,s)))}function xB(e,t,n){fB(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,n))),fB(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)))}function CB(e,t){fB(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,t))),fB(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)))}function kB(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}(e,t))}function SB(e,t,n){const s=fB(e,(()=>t()));if(null==s)throw new Error(n);return s}function _B(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,s=t+e.TEXTURE0;if(sn){throw new Error(`textureUnit must be in ${`[gl.TEXTURE0, gl.TEXTURE${n}]`}.`)}}function EB(e,t=2){return Di(e.slice(0,e.length-t))}function IB(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function TB(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[EB(e),...IB(e)]),t}function NB(e){return e%2==0}function OB(e,t){if(Mi(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const n=e[e.length-1],s=t[t.length-1];if(n===s)return!0;if(NB(n)&&NB(s)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&NB(e[0])&&NB(t[0])}let RB,DB;function MB(e,t){return null!=e.getExtension(t)}function FB(e){try{if(null!=aB(e))return!0}catch(e){return!1}return!1}function BB(e){if(0===e)return!1;const t=aB(e);if(1!==e){if(MB(t,"EXT_color_buffer_float"))return zB(t);const e="EXT_color_buffer_half_float";if(MB(t,e)){const n=t.getExtension(e);return function(e,t){const n=pB(e,t),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const r=1,i=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,i,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(s),e.deleteFramebuffer(a),o}(t,n)}return!1}if(!MB(t,"OES_texture_float"))return!1;if(!MB(t,"WEBGL_color_buffer_float"))return!1;return zB(t)}function zB(e){const t=pB(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const r=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),r}function LB(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&Ni("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the WebGL backend.`))}))}const PB=ca();function VB(){let e,t,n,s,r,i,a,o,l,u;return 2===ca().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",s="in",r="texture",i="outputColor",a="out vec4 outputColor;",o=ca().getBool("WEBGL2_ISNAN_CUSTOM")?"\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ":"",l="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",s="varying",r="texture2D",i="gl_FragColor",a="",o="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",l="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:s,texture2D:r,output:i,defineOutput:a,defineSpecialNaN:o,defineSpecialInf:l,defineRound:u}}function WB(e,t,n="index"){const s=Yi(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${t}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${t}`:`index -= ${e[r]} * ${t}`};`)).join("")}function GB(e,t,n="index"){const s=Yi(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / outShapeStrides[${r}]`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * outShapeStrides[${r}]`:`index -= ${e[r]} * outShapeStrides[${r}]`};`)).join("")}function UB(e,t,n="index"){const s=function(e,t){const n=e.length,s=e.map((e=>`${t}[${e}]`)),r=new Array(n-1);r[n-2]=s[n-1];for(let e=n-3;e>=0;--e)r[e]=`(${r[e+1]} * ${s[e+1]})`;return r}(e.map(((e,t)=>t)),t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${s[r]}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${s[r]}`:`index -= ${e[r]} * ${s[r]}`};`)).join("")}function qB(e){const t=Yi(e).map((e=>e.toString()));return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n }\n`}PB.registerFlag("HAS_WEBGL",(()=>PB.getNumber("WEBGL_VERSION")>0)),PB.registerFlag("WEBGL_VERSION",(()=>FB(2)?2:FB(1)?1:0)),PB.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(()=>!1)),PB.registerFlag("WEBGL_BUFFER_SUPPORTED",(()=>2===PB.get("WEBGL_VERSION"))),PB.registerFlag("WEBGL_CPU_FORWARD",(()=>!0)),PB.registerFlag("WEBGL_FORCE_F16_TEXTURES",(()=>!1)),PB.registerFlag("WEBGL_PACK",(()=>PB.getBool("HAS_WEBGL"))),PB.registerFlag("WEBGL_PACK_NORMALIZATION",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_CLIP",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_DEPTHWISECONV",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_REDUCE",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_LAZILY_UNPACK",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_CONV_IM2COL",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(()=>function(e){if(null==RB){const t=aB(e);RB=t.getParameter(t.MAX_TEXTURE_SIZE)}return RB}(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(()=>function(e){if(null==DB){const t=aB(e);DB=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,DB)}(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(()=>{const e=PB.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const n=aB(e);return t=MB(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:MB(n,"EXT_disjoint_timer_query")?1:0,t}(e)})),PB.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(()=>PB.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!qc())),PB.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(()=>function(e){if(0===e)return!1;const t=aB(e);if(1===e){if(!MB(t,"OES_texture_float"))return!1}else if(!MB(t,"EXT_color_buffer_float"))return!1;return zB(t)}(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(()=>!PB.getBool("WEBGL_FORCE_F16_TEXTURES")&&PB.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))),PB.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(()=>BB(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_FENCE_API_ENABLED",(()=>{return 2===(e=PB.getNumber("WEBGL_VERSION"))&&null!=aB(e).fenceSync;var e})),PB.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(()=>PB.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0)),PB.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",(()=>-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)})),PB.registerFlag("WEBGL_FLUSH_THRESHOLD",(()=>qc()?1:-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)})),PB.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(()=>128)),PB.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(()=>!1)),PB.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e5)),PB.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(()=>128)),PB.registerFlag("WEBGL_EXP_CONV",(()=>!1)),PB.registerFlag("SOFTWARE_WEBGL_ENABLED",(()=>PB.getBool("IS_TEST"))),PB.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",(()=>1/0)),PB.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",(()=>!1)),PB.registerFlag("WEBGL2_ISNAN_CUSTOM",(()=>!1)),PB.registerFlag("ENGINE_COMPILE_ONLY",(()=>!1));const jB="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",{getBroadcastDims:HB}=r;function $B(e,t,n){const s=[];if(e.forEach((e=>{const t=Di(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?s.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(s.push(`uniform sampler2D ${e.name};`),s.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=rz(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:s.push(`uniform int ${e.name}Shape;`);break;case 2:s.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:s.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:s.push(`uniform ivec4 ${e.name}Shape;`)}s.push(`uniform ivec2 ${e.name}TexShape;`)}})),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:s.push("uniform int outShape;");break;case 2:s.push("uniform ivec2 outShape;"),s.push("uniform int outShapeStrides;");break;case 3:s.push("uniform ivec3 outShape;"),s.push("uniform ivec2 outShapeStrides;");break;case 4:s.push("uniform ivec4 outShape;"),s.push("uniform ivec3 outShapeStrides;")}s.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach((e=>{s.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)}));const r=s.join("\n"),i=e.map((e=>function(e,t,n=!1,s){let r="";r+=n?XB(e,s):KB(e,s);const i=e.shapeInfo.logicalShape,a=t.logicalShape;i.length<=a.length&&(r+=n?function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",i=e.shapeInfo.logicalShape.length,a=t.logicalShape.length,o=HB(e.shapeInfo.logicalShape,t.logicalShape),l=sz(a),u=a-i;let c;const h=["x","y","z","w","u","v"];c=0===i?"":a<2&&o.length>=1?"coords = 0;":o.map((e=>`coords.${h[e+u]} = 0;`)).join("\n");let d="";d=a<2&&i>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${h[t+u]}`)).join(", ");let p="return outputValue;";const f=1===Di(e.shapeInfo.logicalShape),m=Di(t.logicalShape),g=1===m;if(1!==i||f||g){if(f&&!g)p=1===a?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(o.length){const e=i-2,t=i-1;o.indexOf(e)>-1&&o.indexOf(t)>-1?p="return vec4(outputValue.x);":o.indexOf(e)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(t)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return`\n vec4 ${r}() {\n ${l} coords = getOutputCoords();\n ${c}\n vec4 outputValue = get${s}(${d});\n ${p}\n }\n `}(e,t):function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",i=t.texShape,a=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&null==e.shapeInfo.flatOffset&&Mi(a,i))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const u=sz(l),c=HB(e.shapeInfo.logicalShape,t.logicalShape),h=l-o;let d;const p=["x","y","z","w","u","v"];d=0===o?"":l<2&&c.length>=1?"coords = 0;":c.map((e=>`coords.${p[e+h]} = 0;`)).join("\n");let f="";f=l<2&&o>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${p[t+h]}`)).join(", ");return`\n float ${r}() {\n ${u} coords = getOutputCoords();\n ${d}\n return get${s}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms))).join("\n"),a=t.texShape,o=VB(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(o);let u,c,h=function(e){const t=`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFs} vec2 resultUV;\n ${e.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${e.defineSpecialNaN}\n ${e.defineSpecialInf}\n ${e.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${ZB}\n ${YB}\n ${QB}\n `;return t}(o);t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return ez();case 1:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===s[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${s[1]}.0);\n }\n `;if(1===s[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${s[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n return 2 * (resTexRC.x * ${s[1]} + resTexRC.y);\n }\n `}(0,t,n);case 2:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(Mi(e,t))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(${s[0]}, ${s[1]}));\n }\n `;const r=Math.ceil(e[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec2(r, c);\n }\n `}(e,t,n);case 3:return function(e,t,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),i=r*Math.ceil(e[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n\n int b = index / ${i};\n index -= b * ${i};\n\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec3(b, r, c);\n }\n `}(e,t,n);default:return function(e,t,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),i=r*Math.ceil(e[e.length-2]/2);let a=i,o="",l="b, r, c";for(let t=2;t1&&!Mi(t,n)&&s.lengthe[t])).join(", ")}function oz(e,t,n,s){const r=n.map(((e,n)=>{const s={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(s.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:s}})),i=r.map((e=>e.shapeInfo)),a={logicalShape:s.shape,texShape:s.texData.texShape,isUniform:!1,isPacked:s.texData.isPacked,flatOffset:null},o=$B(r,a,t),l=function(e,t){const n=SB(e,(()=>e.createShader(e.FRAGMENT_SHADER)),"Unable to create fragment WebGLShader.");if(fB(e,(()=>e.shaderSource(n,t))),fB(e,(()=>e.compileShader(n))),ca().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw bB(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}(e.gl,o),u=e.createProgram(l);return ca().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:i,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:i,outShapeInfo:a},lz(e,t,u)))}function lz(e,t,n){const s=[],r=[];let i,a,o,l=null,u=null;u=e.getUniformLocation(n,"NAN",!1),1===ca().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const c=!1;for(const r of t.variableNames){const i={name:r,uniform:e.getUniformLocation(n,r,c),offset:e.getUniformLocation(n,`offset${r}`,c)};t.enableShapeUniforms&&(i.shape=e.getUniformLocation(n,`${r}Shape`,c),i.texShape=e.getUniformLocation(n,`${r}TexShape`,c)),s.push(i)}if(t.enableShapeUniforms&&(i=e.getUniformLocation(n,"outShape",c),o=e.getUniformLocation(n,"outShapeStrides",c),a=e.getUniformLocation(n,"outTexShape",c)),t.customUniforms)for(const s of t.customUniforms)r.push(e.getUniformLocation(n,s.name,c));return{variablesLocations:s,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:i,outShapeStridesLocation:o,outTexShapeLocation:a}}function uz(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach(((e,n)=>{const s=e.logicalShape,r=t[n],i=r.shape;if(!Mi(s,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${s} and ${i} must match`);if(e.isUniform&&r.isUniform)return;const a=e.texShape,o=r.isUniform?null:r.texData.texShape;if(!Mi(a,o))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${a} and ${o} must match`)}))}function cz(e){return ca().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class hz{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=oB.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=VB();this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?GB(["r","c","d"],e):WB(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${t.output} = result;\n }\n `}}class dz{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=oB.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=VB();this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?GB(["r","c","d"],e):WB(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${t.output} = result;\n }\n `}}class pz{constructor(e){this.variableNames=["A"],this.outTexUsage=lB.DOWNLOAD;const t=VB();this.outputShape=e,this.userCode=`\n ${jB}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}}class fz{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=lB.DOWNLOAD;const t=VB();this.outputShape=e,this.userCode=`\n ${jB}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${t.output} = encode_float(x);\n }\n `}}const mz={R:0,G:1,B:2,A:3};class gz{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const s=VB();this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let i="";for(let e=0;ee.createShader(e.VERTEX_SHADER)),"Unable to create vertex WebGLShader.");if(fB(e,(()=>e.shaderSource(n,t))),fB(e,(()=>e.compileShader(n))),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error("Failed to compile vertex shader.");return n}(e,`${t.version}\n precision highp float;\n ${t.attribute} vec3 clipSpacePos;\n ${t.attribute} vec2 uv;\n ${t.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`)}function wz(e){return function(e,t){const n=SB(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),fB(e,(()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function vz(e){return function(e,t){const n=SB(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return fB(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n))),fB(e,(()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Uint16Array([0,1,2,2,1,3]))}function Az(e,t,n,s,r,i){!function(e,t){const n=ca().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0)throw new Error(`Requested texture size [${e}x${t}] is invalid.`);if(e>n||t>n)throw new Error(`Requested texture size [${e}x${t}] greater than WebGL maximum on this browser / GPU [${n}x${n}].`)}(t,n);const a=function(e){return SB(e,(()=>e.createTexture()),"Unable to create WebGLTexture.")}(e),o=e.TEXTURE_2D;return fB(e,(()=>e.bindTexture(o,a))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST))),1===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texImage2D(o,0,s,t,n,0,r,i,null))):fB(e,(()=>e.texStorage2D(o,1,s,t,n))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,null))),{texture:a,texShape:[n,t]}}function xz(e){return e.internalFormatFloat}function Cz(e){return e.internalFormatHalfFloat}function kz(e){return e.downloadTextureFormat}function Sz(e){return e.internalFormatPackedFloat}function _z(e){return e.internalFormatPackedHalfFloat}function Ez(e,t,n,s,r,i,a,o){const l=e,u=new Float32Array(function(e,t){const[n,s]=dB(e,t);return n*s*4}(i,a));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}class Iz{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=ca().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,function(e,t){rB[e]=t}(t,e)):this.gl=aB(t),e=this.gl,2===ca().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>fB(t,(()=>t.createVertexArray())),this.bindVertexArray=e=>fB(t,(()=>t.bindVertexArray(e))),this.deleteVertexArray=e=>fB(t,(()=>t.deleteVertexArray(e))),this.getVertexArray=()=>fB(t,(()=>t.getParameter(t.VERTEX_ARRAY_BINDING)))}else if(null!=e){const t=e.getExtension("OES_vertex_array_object");if(null==t)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>fB(e,(()=>t.createVertexArrayOES())),this.bindVertexArray=n=>fB(e,(()=>t.bindVertexArrayOES(n))),this.deleteVertexArray=n=>fB(e,(()=>t.deleteVertexArrayOES(n))),this.getVertexArray=()=>fB(e,(()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES)))}let n="WEBGL_color_buffer_float";const s="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===ca().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=gB(this.gl,e),MB(this.gl,t))this.textureHalfFloatExtension=gB(this.gl,t);else if(ca().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),MB(this.gl,s))this.colorBufferHalfFloatExtension=gB(this.gl,s);else if(ca().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",MB(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!MB(this.gl,s))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(s)}this.vertexBuffer=wz(this.gl),this.indexBuffer=vz(this.gl),this.framebuffer=function(e){return SB(e,(()=>e.createFramebuffer()),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=pB(this.gl,this.textureHalfFloatExtension)}get debug(){return ca().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program,this.outputTexture;const e=this.gl;fB(e,(()=>e.finish())),fB(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,null))),fB(e,(()=>e.deleteFramebuffer(this.framebuffer))),fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,null))),fB(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null))),fB(e,(()=>e.deleteBuffer(this.indexBuffer))),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=cB(t,n);return Az(e,r,i,xz(s),s.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=cB(t,n);return Az(e,r,i,Cz(s),s.textureFormatFloat,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=cB(t,n);return Az(e,r,i,kz(s),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,n){fB(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),n.data instanceof Uint8Array?2===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data))):fB(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data))):2===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n))):fB(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,s){this.throwIfDisposed(),function(e,t,n,s,r,i){let a,o,l;fB(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),r instanceof Uint8Array?(a=new Uint8Array(n*s*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(a=new Float32Array(n*s*4),o=e.FLOAT,l=i.internalFormatPackedFloat),a.set(r),2===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,s,e.RGBA,o,a))):fB(e,(()=>e.texImage2D(e.TEXTURE_2D,0,l,n,s,0,e.RGBA,o,a))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t,n,s,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=dB(t,n);return Az(e,r,i,_z(s),e.RGBA,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=dB(t,n);return Az(e,r,i,Sz(s),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(CB(this.gl,this.framebuffer),this.outputTexture=null),fB(this.gl,(()=>this.gl.deleteTexture(e)))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n,s){const[r,i]=cB(t,n),a=new Uint8Array(t*n*4);return fB(e,(()=>e.readPixels(0,0,r,i,s.downloadTextureFormat,e.UNSIGNED_BYTE,a))),new Float32Array(a.buffer)}(this.gl,t,n,this.textureConfig)))}downloadPackedMatrixFromBuffer(e,t,n,s,r,i){return Ez(this.gl,e,0,0,0,r,i,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return function(e,t,n){const s=e,r=new Float32Array(n);return s.bindBuffer(s.PIXEL_PACK_BUFFER,t),s.getBufferSubData(s.PIXEL_PACK_BUFFER,0,r),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),r}(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const s=function(e,t,n,s){const r=e.createBuffer();fB(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r)));const i=16*t*n;return fB(e,(()=>e.bufferData(e.PIXEL_PACK_BUFFER,i,e.STREAM_READ))),fB(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0))),fB(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null))),r}(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),s}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(ca().getBool("WEBGL_FENCE_API_ENABLED")){const s=e,r=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=s.clientWaitSync(r,0,0);return e===s.ALREADY_SIGNALED||e===s.CONDITION_SATISFIED},t=r}else ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n){const s=new Float32Array(t*n*4);return fB(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,s))),s}(this.gl,t,n)))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=bz(t));const n=function(e){return SB(e,(()=>e.createProgram()),"Unable to create WebGLProgram.")}(t);fB(t,(()=>t.attachShader(n,this.vertexShader))),fB(t,(()=>t.attachShader(n,e))),function(e,t){if(fB(e,(()=>e.linkProgram(t))),!ca().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw new Error("Failed to link vertex and fragment shaders.")}(t,n);const s=Object.assign(n,{vao:this.createVertexArray()});return this.debug&&wB(t,s),s}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;fB(t,(()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer))),function(e,t,n){fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),vB(e,t,"clipSpacePos",n,3,20,0)&&vB(e,t,"uv",n,2,20,12)}(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(fB(this.gl,(()=>this.gl.deleteProgram(e))),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&wB(this.gl,this.program),fB(this.gl,(()=>this.gl.useProgram(e)))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?function(e,t,n){return SB(e,(()=>e.getUniformLocation(t,n)),'uniform "'+n+'" not present in program.')}(this.gl,e,t):function(e,t,n){return e.getUniformLocation(t,n)}(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),fB(this.gl,(()=>this.gl.getAttribLocation(e,t)))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),AB(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[s,r]=dB(t,n);this.setOutputMatrixTextureDriver(e,s,r)}setOutputMatrixWriteRegion(e,t,n,s){this.setOutputMatrixWriteRegionDriver(n,e,s,t)}setOutputPackedMatrixWriteRegion(e,t,n,s){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&wB(this.gl,this.program),kB(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){this.getVertexArray();this.debugValidate()}fB(e,(()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),fB(this.gl,(()=>this.gl.finish()))}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=gB(this.gl,2===ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await Li((()=>this.disposed||this.isQueryAvailable(e,ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))),this.getQueryTime(e,ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){const t=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),n=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise((t=>{this.addItemToPoll((()=>e.isFencePassed()),(()=>t()))}))}pollItems(){const e=function(e){let t=0;for(;te.isDoneFn)));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let n;"setTimeoutCustom"in ca().platform&&(n=ca().platform.setTimeoutCustom.bind(ca().platform)),Li((()=>(this.pollItems(),0===this.itemsToPoll.length)),(()=>0),null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),xB(this.gl,e,this.framebuffer),this.debug&&kB(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(xB(this.gl,this.outputTexture,this.framebuffer),this.debug&&kB(this.gl)):CB(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const s=this.gl;xB(s,e,this.framebuffer),this.debug&&kB(s),this.outputTexture=e,fB(s,(()=>s.viewport(0,0,t,n))),fB(s,(()=>s.scissor(0,0,t,n)))}setOutputMatrixWriteRegionDriver(e,t,n,s){this.throwIfDisposed(),fB(this.gl,(()=>this.gl.scissor(e,t,n,s)))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}}const{mx:Tz,XI:Nz,Nk:Oz,f6:Rz,ct:Dz,YG:Mz,hH:Fz,z3:Bz,sG:zz,uM:Lz,vS:Pz,qB:Vz,GG:Wz,rq:Gz,lg:Uz,WR:qz,cu:jz,GE:Hz,px:$z,jC:Kz,He:Xz,hE:Zz,BF:Yz,Dk:Qz,cl:Jz,_B:eL,ub:tL,_f:nL,Ku:sL,qy:rL,Zy:iL,bu:aL,zv:oL,dH:lL,HS:uL,yH:cL,l3:hL,z9:dL,x6:pL,_m:fL,eW:mL,GK:gL,SP:yL,yr:bL,dl:wL,Dw:vL,xT:AL,_X:xL,wz:CL}=S;function kL(e,t){return["x","y","z","w","u","v"].slice(0,t).map((t=>`${e}.${t}`))}function SL(e,t){return 1===t?[e]:kL(e,t)}class _L{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=cz(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=SL("rc",this.rank),t=sz(this.rank),n=this.getOutOfBoundsCondition(e),s=this.getSetup(e),r=this.getOutput(e);this.userCode=`\n void main() {\n ${t} rc = getOutputCoords();\n\n if(${n}) {\n setOutput(vec4(0));\n } else {\n ${s}\n\n setOutput(vec4(${r}));\n }\n }\n `}}getSourceCoordsArr(e){const t=[];for(let n=0;n<=1;n++)for(let s=0;s<=1;s++){let r=`${0===n?"r":"rp1"}, ${0===s?"c":"cp1"}`;for(let t=2;t ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let n=this.rank-2;n= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n= ${n};\n bool rEdge = rp1 >= ${s};\n `}getOutput(e){const t=this.getSourceCoordsArr(e);if(1===this.rank){return`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${t[0]}),\n cEdge ? 0. : getA(${t[1]}),\n rEdge ? 0. : getA(${t[2]}),\n rEdge || cEdge ? 0. : getA(${t[3]})`}}class EL{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length);let n="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),n+=`\n ${t}\n ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${e>0?"}":""}\n `}var s,r;this.userCode=`\n ${s=t,r=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${r?UB(["r","c","d"],"inputShape"):WB(["r","c","d"],s)}\n return ivec3(r, c, d);\n }\n `}\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":qB(e)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n ${n}\n\n setOutput(result);\n }\n `}}class IL{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,n){const s=NL(t,n),r=OL(e,s,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const i=TL(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=i,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let a;return s===uB.PACKED_2X2_FLOAT32?a=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):s===uB.PACKED_2X2_FLOAT16?a=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):s===uB.UNPACKED_FLOAT32?a=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):s===uB.UNPACKED_FLOAT16?a=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):s===uB.PACKED_4X1_UNSIGNED_BYTE&&(a=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(a),this.numUsedTextures++,this._numBytesAllocated+=i,this.log(),a}releaseTexture(e,t,n,s){if(null==this.freeTextures)return;const r=NL(n,s),i=OL(t,r,s);i in this.freeTextures||(this.freeTextures[i]=[]);const a=TL(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,s),o=ca().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==o&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=a):(this.freeTextures[i].push(e),this.numFreeTextures++,this._numBytesFree+=a),this.numUsedTextures--;const l=this.usedTextures[i],u=l&&l.indexOf(e);if(null==u||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),this.log()}log(){if(!this.logEnabled)return;this.numFreeTextures,this.numUsedTextures,this._numBytesFree,this._numBytesAllocated}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));for(const e in this.usedTextures)this.usedTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function TL(e,t,n,s,r){const i=function(e,t){switch(e){case uB.PACKED_2X2_FLOAT32:return Sz(t);case uB.PACKED_2X2_FLOAT16:return _z(t);case uB.UNPACKED_FLOAT32:return xz(t);case uB.UNPACKED_FLOAT16:return Cz(t);case uB.PACKED_4X1_UNSIGNED_BYTE:return kz(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,s);let a;if(r){const[t,n]=dB(e[0],e[1]);a=t*n}else{const[t,n]=cB(e[0],e[1]);a=t*n}const o=function(e,t){const n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;if(t===n.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}(n,i);return a*o}function NL(e,t){if(e===lB.UPLOAD)return uB.PACKED_2X2_FLOAT32;if(e===lB.RENDER||null==e)return function(e){return ca().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?uB.PACKED_2X2_FLOAT32:uB.UNPACKED_FLOAT32:e?uB.PACKED_2X2_FLOAT16:uB.UNPACKED_FLOAT16}(t);if(e===lB.DOWNLOAD||e===lB.PIXELS)return uB.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function OL(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}class RL{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${t}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}const DL="if (isnan(x)) return x;",ML="return x;",FL="return abs(x);";const BL="return (x >= 0.0) ? x : (exp(x) - 1.0);",zL=DL+"\n return (x < 0.0) ? 0.0 : x;\n",LL=DL+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",PL="return x;",VL="return 1.0 / (1.0 + exp(-1.0 * x));",WL="return x;",GL="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",UL="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",qL="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",jL="return 1.0 / (1.0 + exp(-1.0 * x));";class HL{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${t}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}class $L{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length);const t=e.length,n=SL("rc",t),s=sz(t),r=function(e,t){if(1===e)return"rc";let n="";for(let s=0;st.push(e)))}const t=this.texData.get(e),{values:n,shape:s,slice:r,dtype:i,complexTensorInfos:a,isPacked:o}=t;if(null!=r){let t;t=o?new HL(s,PL):new RL(s,PL);const n=this.runWebGLProgram(t,[{dataId:e,shape:s,dtype:i}],i),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if(ca().getBool("DEBUG")&&!ca().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===ca().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,u,c=null;if("complex64"!==i&&ca().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);c=this.gpgpu.createBufferFromTexture(t.texture.texture,...hB(s))}if(this.pendingRead.set(e,[]),"complex64"!==i&&await this.gpgpu.createAndWaitForFence(),"complex64"===i){const e=await Promise.all([this.read(a.real.dataId),this.read(a.imag.dataId)]);u=Fw(e[0],e[1])}else if(null==c)u=this.getValuesFromTexture(e);else{const e=Di(s);u=this.gpgpu.downloadFloat32MatrixFromBuffer(c,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=c){const e=this.gpgpu.gl;fB(e,(()=>e.deleteBuffer(c)))}const h=this.convertAndCacheOnCPU(e,u),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach((e=>e(h))),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&ih().removeDataId(e,this),this.pendingDeletes--),h}readToGPU(e,t={}){const n=this.texData.get(e),{values:s,shape:r,slice:i,dtype:a,isPacked:o,texture:l}=n;if("complex64"===a)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=i){let n;n=o?new HL(r,PL):new RL(r,PL);const s=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:a}],a),i=this.readToGPU(s,t);return this.disposeIntermediateTensorInfo(s),i}if(null==l)throw null!=s?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const u=this.decode(e,t.customTexShape),c=ih().makeTensorFromTensorInfo(u),h=this.texData.get(u.dataId);return Object.assign({tensorRef:c},h.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>nc(e)));return fd(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return fd(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t0}time(e){const t=this.activeTimers,n=[];let s=!1;null==this.programTimersStack?(this.programTimersStack=n,s=!0):this.activeTimers.push(n),this.activeTimers=n,e();const r=rc(this.activeTimers.map((e=>e.query))).filter((e=>null!=e)),i=rc(this.activeTimers.map((e=>e.name))).filter((e=>null!=e));this.activeTimers=t,s&&(this.programTimersStack=null);const a={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);a.kernelMs=function(e){let t=0;for(let n=0;ne.map(((e,t)=>({name:i[t],ms:e}))).map((e=>`${e.name}: ${e.ms}`)).join(", ")}else a.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,a})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:ec(),endMs:null}}endTimer(e){return ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=ec(),e)}async getQueryTime(e){if(ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:n}=this.texData.get(e);return null!=n&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:n,texShape:s,usage:r,isPacked:i,slice:a}=this.texData.get(e),o=a&&a.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),null!=t&&(this.numBytesInGPU-=this.computeBytes(s,n),this.textureManager.releaseTexture(t,s,r,i)));const u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=ZL){return ca().getBool("WEBGL_CPU_FORWARD")&&e.every((e=>null==this.texData.get(e.dataId).texture&&Di(e.shape)0&&Hi(n[0])){const r=n.map((e=>tc(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return this.texData.get(s).usage=null,{dataId:s,shape:e,dtype:t}}makeOutput(e,t,n){return ih().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new $L(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new _L(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[EB(e.shape),...IB(e.shape)],s={dtype:e.dtype,shape:n,dataId:e.dataId},r=[EB(t),...IB(t)],i=new EL(r,n),a=[n],o=this.runWebGLProgram(i,[s],e.dtype,a,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:s,shape:r,dtype:i}=n;if(null!=t){Ni(Di(r)<=t[0]*t[1]*4,(()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data."))}const a=TB(r);let o;o=s?new dz(a):new hz(a);const l=[null!=t?t:hB(a)];return{dtype:i,shape:r,dataId:this.runWebGLProgram(o,[{shape:a,dtype:i,dataId:e}],i,l,!0,t).dataId}}runWebGLProgram(e,t,n,s,r=!1,i){const a=this.makeTensorInfo(e.outputShape,n),o=this.texData.get(a.dataId);if(e.packedOutput&&(o.isPacked=!0),e.outPackingScheme===oB.DENSE){const t=null!=i?i:hB(e.outputShape);o.texShape=t.map((e=>2*e))}if(null!=e.outTexUsage&&(o.usage=e.outTexUsage),0===Di(a.shape))return o.values=Gi(a.dtype,0),a;const l=[],u=t.map((t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&Di(t.shape)<=ca().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!n.isPacked!=!!e.packedInputs)t=n.isPacked?this.unpackTensor(t):this.packTensor(t),l.push(t),n=this.texData.get(t.dataId);else if(n.isPacked&&!OB(n.shape,t.shape)){const e=t,s=t.shape;t.shape=n.shape,t=this.packedReshape(t,s),l.push(t),n=this.texData.get(t.dataId),e.shape=s}return{shape:t.shape,texData:n,isUniform:!1}}));this.uploadToGPU(a.dataId);const c={shape:a.shape,texData:o,isUniform:!1},h=function(e,t,n){let s="";t.concat(n).forEach((t=>{const r=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const i=t.texData.texShape,{useSqueezeShape:a,uniformShape:o,keptDims:l}=rz(e.packedInputs,t.shape,i);let u="",c="",h="";if(1===o.length&&e.packedInputs){const e=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==o.length||e.packedInputs){if(o.length>2&&!e.packedInputs){const e=Yi(o);h=`${e[0]===i[1]}_${e[e.length-1]===i[1]}`}}else c=`${o[0]>1}_${o[1]>1}`;const d=t.shape.length,p=2===o.length&&Mi(t.shape,i),f=1===Di(t.shape),m=Vd(t.shape,n.shape),g=!e.packedInputs&&d===n.shape.length&&Mi(i,n.texData.texShape),y=e.packedInputs||o.length>2?"":`${i[0]>1}_${i[1]>1}`;s+=`${d}_${g}_${a?l:""}_${o.length}_${f}_${m}_${p}_${u}_${c}_${h}_${y}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;s+=`${t.shape}_${e}_${r}`}}));const r=e.userCode;let i=e.constructor.name;return i+="_"+s+"_"+r+`${ca().getNumber("WEBGL_VERSION")}`,i}(e,u,c),d=this.getAndSaveBinary(h,(()=>oz(this.gpgpu,e,u,c))),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),ca().get("ENGINE_COMPILE_ONLY")||function(e,t,n,s,r){t.program.enableShapeUniforms||(uz(t.inShapeInfos,n),uz([t.outShapeInfo],[s]));const i=s.texData.texture,a=s.texData.texShape;s.texData.isPacked?e.setOutputPackedMatrixTexture(i.texture,a[0],a[1]):e.setOutputMatrixTexture(i.texture,a[0],a[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===ca().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let s=0;sthis.disposeIntermediateTensorInfo(e))),p&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));const m=ca().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=ec();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!ca().getBool("WEBGL_LAZILY_UNPACK")&&o.isPacked&&!1===r){const e=this.unpackTensor(a);return this.disposeIntermediateTensorInfo(a),e}return a}compileAndRun(e,t,n,s,r=!1){n=n||t[0].dtype;return this.runWebGLProgram(e,t,n,s,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){if(!this.disposed){if(!ca().getBool("IS_TEST")){Object.keys(this.binaryCache).forEach((e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}))}this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=oh((()=>{if(!ca().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=ca().getBool("DEBUG");ca().set("DEBUG",!1);const t=this.abs(_d(1e-8)).dataSync()[0];if(ca().set("DEBUG",e),t>0)return 32}return 16}))),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:n,dtype:s,values:r,texture:i,usage:a,isPacked:o}=t;if(null!=i)return;const l=null!=this.activeTimers;let u;l&&(u=ec());let c=t.texShape;if(null==c&&(c=function(e,t=!1){let n=ca().getNumber("WEBGL_MAX_TEXTURE_SIZE"),s=ca().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(s===1/0&&ca().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(s=n/2),t&&(n*=2,s*=2,1===(e=e.map(((t,n)=>n>=e.length-2?Ii(e[n]):e[n]))).length&&(e=[2,e[0]])),2!==e.length){const t=Wi(e);e=t.newShape}let r=Di(e),i=null;e.length<=1&&r<=n?i=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?i=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?i=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?i=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?i=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(i=[e[0],e[1]*e[2]*e[3]]);const a=null!=i&&Math.max(...i)>s&&Math.min(...i)<=(t?2:1)&&Math.min(...i)>0;if(null==i||a)if(t){const t=EB(e);let n=2,s=2;e.length&&([n,s]=IB(e)),r=t*(n/2)*(s/2),i=Bi(r).map((e=>2*e))}else i=Bi(r);return i}(n,o),t.texShape=c),null!=r){const e=TB(n);let i,a=c[1],h=c[0];const d=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!o&&d||([a,h]=dB(c[0],c[1])),i=o?new yz(e,d):new gz(e,d);const p=d?[h,a]:c,f=this.makeTensorInfo(p,s),m=this.texData.get(f.dataId);m.usage=d?lB.PIXELS:lB.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),a,h,r);const g=[[h,a]],y=!0,b=this.runWebGLProgram(i,[f],s,g,y),w=this.texData.get(b.dataId);t.texShape=w.texShape,t.isPacked=w.isPacked,t.usage=w.usage,ca().get("ENGINE_COMPILE_ONLY")?this.disposeData(b.dataId):(t.texture=w.texture,t.values=null,this.texData.delete(b.dataId)),this.disposeIntermediateTensorInfo(f),l&&(this.uploadWaitMs+=ec()-u)}else{const e=this.acquireTexture(c,a,s,o);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:s}=n;return null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t1024*this.numMBBeforeWarning*1024){(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0}return this.textureManager.acquireTexture(e,t,s)}computeBytes(e,t){return e[0]*e[1]*ji(t)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}for(const[,t]of Object.entries(this.binaryCache)){const n=new Promise((e=>{try{this.checkCompletion_(t),e(!0)}catch(e){throw e}}));e.push(n)}return Promise.all(e)}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await cw(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw bB(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.");throw new Error("Failed to link vertex and fragment shaders.")}return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:t,customUniformLocations:n,infLoc:s,nanLoc:r,outShapeLocation:i,outShapeStridesLocation:a,outTexShapeLocation:o}=lz(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=s,e.nanLoc=r,e.outShapeLocation=i,e.outShapeStridesLocation=a,e.outTexShapeLocation=o}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:s,height:r,width:i,channels:a}=e,o=ih().backend;if(!o.gpgpu.gl.isTexture(s))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const l=o.writeTexture(s,t,n,r,i,a);return ih().makeTensorFromDataId(l,t,n,o)}}YL.nextDataId=0;jc()&&ch("webgl",(()=>new YL),2);const QL="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class JL{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=Gd(t,n),this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${e}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}}const eP="\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n";class tP{constructor(e,t,n,s=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Gd(t,n);const r=this.outputShape.length;this.enableShapeUniforms=cz(r);let i="";if(s)if(0===r||1===Di(this.outputShape))i="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(i=`\n ${sz(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?i+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":i+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=SL("coords",r);this.enableShapeUniforms?i+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= outShape[${r} - 2];\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= outShape[${r} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:i+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= ${this.outputShape[r-2]};\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= ${this.outputShape[r-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${e}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${i}\n\n setOutput(result);\n }\n `}}function nP(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const sP={kernelName:Oo,backendName:"webgl",kernelFunc:nP};function rP(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.makeTensorInfo(s.shape,"complex64"),a=n.texData.get(i.dataId),o=nP({inputs:{x:s},backend:n}),l=nP({inputs:{x:r},backend:n});return a.complexTensorInfos={real:o,imag:l},i}const iP={kernelName:Wa,backendName:"webgl",kernelFunc:rP},aP="return (a < 0.) ? b * a : a;",oP="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const lP={kernelName:zo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s,a=n.makeTensorInfo([],"float32",Qu(i,"float32")),o=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new tP(oP,r.shape,a.shape):new JL(aP,r.shape,a.shape),l=n.runWebGLProgram(o,[r,a],"float32");return n.disposeIntermediateTensorInfo(a),l}},uP="return (a < 0.) ? b * a : a;",cP="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const hP={kernelName:bl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t,i=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new tP(cP,s.shape,r.shape):new JL(uP,s.shape,r.shape);return n.runWebGLProgram(i,[s,r],"float32")}},dP="if (isnan(x)) return x;";function pP({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:s}){return({inputs:r,backend:i})=>{const{x:a}=r,o=i,l=s||a.dtype;if(o.shouldExecuteOnCPU([a])&&null!=n){const e=o.texData.get(a.dataId),t=n(e.values,l);return o.makeTensorInfo(a.shape,l,t)}let u;return u=ca().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new HL(a.shape,t):new RL(a.shape,e),o.runWebGLProgram(u,[a],l)}}function fP({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:s=!1,cpuKernelImpl:r,dtype:i}){return({inputs:a,backend:o})=>{const{a:l,b:u}=a,c=o;if(s&&"complex64"===l.dtype){const t=c.texData.get(l.dataId),n=c.texData.get(u.dataId),[s,r]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map((t=>{const[n,s]=t,r={dataId:n.dataId,dtype:n.dtype,shape:l.shape},i={dataId:s.dataId,dtype:s.dtype,shape:u.shape},a=new JL(e,l.shape,u.shape);return c.runWebGLProgram(a,[r,i],Tc(n.dtype,s.dtype))})),i=rP({inputs:{real:s,imag:r},backend:c});return c.disposeIntermediateTensorInfo(s),c.disposeIntermediateTensorInfo(r),i}const h=i||Tc(l.dtype,u.dtype);if(("string"===l.dtype||"string"===u.dtype||c.shouldExecuteOnCPU([l,u]))&&null!=r){const e=c.texData.get(l.dataId).values,t=c.texData.get(u.dataId).values,n="string"===l.dtype?mv(e):e,s="string"===l.dtype?mv(t):t,[i,a]=r(l.shape,u.shape,n,s,h),o=c.makeTensorInfo(a,h);return c.texData.get(o.dataId).values=i,o}let d;return d=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new tP(t,l.shape,u.shape,n):new JL(e,l.shape,u.shape),c.runWebGLProgram(d,[l,u],h)}}function mP(e,t=!1){if("linear"===e)return t?WL:ML;if("relu"===e)return t?UL:zL;if("elu"===e)return t?GL:BL;if("relu6"===e)return t?qL:LL;if("prelu"===e)return t?cP:uP;if("leakyrelu"===e)return t?oP:aP;if("sigmoid"===e)return t?jL:VL;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class gP{constructor(e,t,n,s=!1,r=!1,i=!1,a=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=cz(this.outputShape.length);const u=s?e[1]:e[2],c=Math.ceil(u/2),h=s?"i * 2, rc.y":"rc.y, i * 2",d=r?"rc.z, i * 2":"i * 2, rc.z",p=s?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",g="";a&&(m=o?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${a}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${a}\n }`:`vec4 activation(vec4 x) {\n ${a}\n }`,g="result = activation(result);");const y=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let b="rc.x",w="rc.x";e[0]`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`));const c=a.texData.get(r.dataId);return!c.isPacked||OB(r.shape,l)||null!==c.texture&&OB(c.shape,l)?(a.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}):function(e,t,n){const s=[EB(e.shape),...IB(e.shape)],r={dtype:e.dtype,shape:s,dataId:e.dataId},i=[EB(t),...IB(t)],a=new EL(i,s),o=[s],l=n.runWebGLProgram(a,[r],e.dtype,o,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,a)}const CP={kernelName:El,backendName:"webgl",kernelFunc:xP};class kP{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];const a=4*Math.floor(n/4),o=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${Fi(e)?e.toPrecision(2):e}, ones);`}let u="";r%n>0&&(u=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${u}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${a}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${l}\n }\n\n int inIdx = inOffset + ${a};\n if (${1===o}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${l}\n } else if (${2===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${l}\n } else if (${3===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${l}\n }\n setOutput(sumValue);\n }\n `}}class SP{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];let a="0.0",o="";"prod"===t?a="1.0":"min"===t?(a="1.0 / 1e-20",o="min"):"max"===t&&(a="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const u=4*Math.floor(n/4),c=n%4;let h=`\n if (${"sum"===t}) {\n sumValue += dot(values, ones);\n } else if (${"prod"===t}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${o}(values, minMaxValue);\n if (${"min"===t} || ${"max"===t}) {\n minMaxValue = ${o}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,d="vec4";"all"===t?(a="1.0",h="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===t&&(a="0.0",h="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");let p="";r%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${a};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${p}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n vec4 minMaxValue = vec4(${a});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${u}; i += 4) {\n int inIdx = inOffset + i;\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${h}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${2===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${3===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${h}\n }\n setOutput(${l});\n }\n `}}function _P(e,t,n,s){const r=function(e){const t=[];for(;0===t.length||1!==t[t.length-1].outSize;){const n=t.length?t[t.length-1].outSize:e[1],s=ww(n);t.push({inSize:n,windowSize:s,outSize:Math.ceil(n/s)})}return t}(e.shape);let i=e;for(let a=0;a6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],s=new Array(t);for(let t=0;t6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const s=sz(this.rank),r=kL("rc",this.rank),i=new Array(this.rank);for(let e=0;e`Error in matMul: inner shapes (${h}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${s} must match.`));const v=n?[y,h,p]:[y,p,h],A=s?[b,f,d]:[b,d,f],x=xP({inputs:{x:e},backend:r,attrs:{shape:v}}),C=xP({inputs:{x:t},backend:r,attrs:{shape:A}}),k=[x,C],S=Math.max(y,b),_=n?x.shape[1]:x.shape[2],E=null!=i,I=null!=a,T="leakyrelu"===l,N=null!=l?mP(l,!0):null;let O;if((1===p||1===f)&&_>MP&&!1===(E||I||T||null!=N)){let e=x,t=C;n&&(e=RP({inputs:{x},backend:r,attrs:{perm:[0,2,1]}}),k.push(e)),s&&(t=RP({inputs:{x:C},backend:r,attrs:{perm:[0,2,1]}}),k.push(t));const i=1===f;let a=e;1!==f&&(a=xP({inputs:{x:e},backend:r,attrs:{shape:[S,_,1]}}),k.push(a));const o=1===f?2:1;let l=t;i&&(l=xP({inputs:{x:t},backend:r,attrs:{shape:[S,1,_]}}),k.push(l));const u=vP({inputs:{a,b:l},backend:r});O=NP({inputs:{x:u},backend:r,attrs:{axis:o,keepDims:!0}}),k.push(u)}else{const l=Tc(e.dtype,t.dtype),u=new gP(v,A,[S,p,f],n,s,E,N,I,T),c=[x,C];if(null!=i&&c.push(i),I&&c.push(a),T){const e=r.makeTensorInfo([],"float32",Qu(o,"float32"));c.push(e),k.push(e)}O=r.runWebGLProgram(u,c,l)}const R=xP({inputs:{x:O},backend:r,attrs:{shape:w}});k.push(O);for(const e of k)r.disposeIntermediateTensorInfo(e);return R}const BP={kernelName:ku,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i,bias:a,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:h}=s;return FP({a:r,b:i,transposeA:l,transposeB:u,backend:n,bias:a,preluActivationWeights:o,leakyreluAlpha:h,activation:c})}},zP="return abs(x);";const LP={kernelName:ma,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])&&"complex64"!==s.dtype){const e=n.texData.get(s.dataId),t=lL(e.values);return n.makeTensorInfo(s.shape,s.dtype,t)}let r;return r=ca().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new HL(s.shape,zP):new RL(s.shape,zP),n.runWebGLProgram(r,[s],s.dtype)}},PP=pP({opSnippet:DL+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),VP={kernelName:ga,backendName:"webgl",kernelFunc:PP},WP=pP({opSnippet:DL+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),GP={kernelName:ya,backendName:"webgl",kernelFunc:WP},UP="return a + b;",qP=fP({opSnippet:UP,packedOpSnippet:UP,supportsComplex:!0,cpuKernelImpl:Tz}),jP={kernelName:ba,backendName:"webgl",kernelFunc:qP};class HP{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`float v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${s};\n setOutput(result);\n }\n `}}class $P{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`vec4 v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${s};\n setOutput(result);\n }\n `}}const KP={kernelName:wa,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,r=n;if(1===r.length)return nP({inputs:{x:r[0]},backend:s});if(r.length>ca().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:s}),i=e({inputs:r.slice(t),backend:s});return e({inputs:[n,i],backend:s})}const i=r.map((e=>e.dtype)).reduce(((e,t)=>Tc(e,t))),a=r.map((e=>e.shape)),o=ca().getBool("WEBGL_PACK")?new $P(r[0].shape,a):new HP(r[0].shape,a);return s.runWebGLProgram(o,r,i)}};const XP={kernelName:va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=Vi(i,r.shape);let u=l;const c=fm(u,o);let h=r;null!=c&&(h=RP({inputs:{x:r},backend:n,attrs:{perm:c}}),u=gm(u.length,o)),pm("all",u,o);const[d,p]=hm(h.shape,u),f=xP({inputs:{x:h},backend:n,attrs:{shape:[-1,Di(p)]}}),m=_P(f,f.dtype,"all",n);let g;if(a){g=xP({inputs:{x:m},backend:n,attrs:{shape:dm(d,l)}})}else g=xP({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};const ZP={kernelName:Aa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=Vi(i,r.shape);let u=l;const c=fm(u,o);let h=r;null!=c&&(h=RP({inputs:{x:r},backend:n,attrs:{perm:c}}),u=gm(u.length,o)),pm("any",u,o);const[d,p]=hm(h.shape,u),f=xP({inputs:{x:h},backend:n,attrs:{shape:[-1,Di(p)]}}),m=_P(f,f.dtype,"any",n);let g;if(a){g=xP({inputs:{x:m},backend:n,attrs:{shape:dm(d,l)}})}else g=xP({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};class YP{constructor(e,t,n){this.variableNames=["A"];const{windowSize:s,batchSize:r,outSize:i}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,i];const a="max"===t?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${s};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${s}; i++) {\n int inIdx = ${o};\n float candidate = getA(batch, inIdx);\n if (candidate ${a} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}class QP{constructor(e,t,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,Ni(e.length>2,(()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`));const r=e[e.length-1],i=Math.ceil(r/t);this.outputShape=e.slice(0,-1),i>1&&this.outputShape.push(i),s||this.variableNames.push("bestIndicesA");const a=this.outputShape,o=a.length,l=sz(o),u=SL("coords",o);let c,h;if(1===i){h=o+1;const e=sz(h);c=`\n ${e} sourceLocR = ${e}(${u.join()}, 0);\n ++${u[o-1]};\n ${e} sourceLocG = ${e}(${u.join()}, 0);\n ++${u[o-2]};\n ${e} sourceLocA = ${e}(${u.join()}, 0);\n --${u[o-1]};\n ${e} sourceLocB = ${e}(${u.join()}, 0);\n --${u[o-2]};`}else h=o,c=`\n ${l} sourceLocR = coords;\n ++${u[o-1]};\n ${l} sourceLocG = coords;\n ++${u[o-2]};\n ${l} sourceLocA = coords;\n --${u[o-1]};\n ${l} sourceLocB = coords;\n --${u[o-2]};`;const d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],f=d.map((e=>"int "+e)),m=SL("sourceLocR",h-1).concat("inIdx.r"),g=SL("sourceLocG",h-1).concat("inIdx.g"),y=SL("sourceLocB",h-1).concat("inIdx.b"),b=SL("sourceLocA",h-1).concat("inIdx.a"),w="max"===n?"greaterThan":"lessThan",v=s?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${y.join()}),\n getBestIndicesAChannel(${b.join()})));`,A=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${y.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,x=s?"":`\n float getBestIndicesAChannel(${f.join()}) {\n return getChannel(getBestIndicesA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${f.join()}) {\n return getChannel(getA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }\n ${x}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${u[o-1]} < ${a[o-1]-1};\n bool hasNextRow = ${u[o-2]} < ${a[o-2]-1};\n ${c}\n ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p},\n sourceLocB${p}, sourceLocA${p}) * ${t};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${A};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${v}\n vec4 candidate = ${A};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${w}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}}function JP(e,t,n,s=null){let r=t.shape[0],i=t.shape[1];null!=s&&(r=s.shape[0],i=s.shape[1]);const a=ww(i),o={windowSize:a,inSize:i,batchSize:r,outSize:Math.ceil(i/a)},l=new YP(o,n,null==s),u=[t];null!=s&&u.push(s);const c=e.runWebGLProgram(l,u,"int32");if(1===c.shape[1])return c;const h=JP(e,t,n,c);return e.disposeIntermediateTensorInfo(c),h}function eV(e,t,n,s=null){const r=null!=s?s.shape:t.shape,i=ww(r[r.length-1]),a=new QP(r,i,n,null==s),o=null==s?[t]:[t,s],l=e.runWebGLProgram(a,o,"int32");if(l.shape.length===t.shape.length){const s=eV(e,t,n,l);return e.disposeIntermediateTensorInfo(l),s}return l}function tV(e,t,n,s){const r=[n];if(pm("arg"+s.charAt(0).toUpperCase()+s.slice(1),r,t.shape.length),!ca().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],i=e.texData.get(t.dataId);let a=t;null!==i&&i.isPacked&&(a=e.unpackTensor(t),n.push(a));const[o,l]=hm(a.shape,r),u=Di(l),c=xP({inputs:{x:a},backend:e,attrs:{shape:[-1,u]}});n.push(c);const h=JP(e,c,s);n.push(h);const d=xP({inputs:{x:h},backend:e,attrs:{shape:o}});return n.forEach((t=>e.disposeIntermediateTensorInfo(t))),d}return eV(e,t,s)}const nV={kernelName:xa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=Vi(i,r.shape);const o=fm(a,r.shape.length);let l=r;const u=[];null!=o&&(l=RP({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),a=gm(a.length,l.shape.length)),pm("argMax",[a[0]],l.shape.length);const c=tV(n,l,a[0],"max");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}};const sV={kernelName:Ca,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=Vi(i,r.shape);const o=fm(a,r.shape.length);let l=r;const u=[];null!=o&&(l=RP({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),a=gm(a.length,l.shape.length)),pm("argMin",[a[0]],l.shape.length);const c=tV(n,l,a[0],"min");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}},rV=pP({opSnippet:DL+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),iV={kernelName:ka,backendName:"webgl",kernelFunc:rV},aV=pP({opSnippet:DL+"return log(x + sqrt(x * x + 1.0));"}),oV={kernelName:Sa,backendName:"webgl",kernelFunc:aV},lV=pP({opSnippet:DL+"\n return atan(x);\n"}),uV={kernelName:_a,backendName:"webgl",kernelFunc:lV},cV=fP({opSnippet:QL+"\n return atan(a, b);\n",packedOpSnippet:"\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n "+eP+"\n return result;\n"}),hV={kernelName:Ia,backendName:"webgl",kernelFunc:cV},dV=pP({opSnippet:DL+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),pV={kernelName:Ea,backendName:"webgl",kernelFunc:dV};class fV{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,a=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;const f="avg"===t,m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let y="0.0";if(f||(y="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${a}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h};\n wC += ${u}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?m:g:`wR * ${h} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");const w=4*Math.floor(i/4),v=i%4,A=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${a}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n const float initializationValue = ${y};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${y});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${w}; wC += 4) {\n int xC = xCCorner + wC * ${u};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n getValue(batch, xR, xC + 3 * ${u}, d)\n );\n\n ${A}\n }\n\n int xC = xCCorner + ${w};\n if (${1===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${A}\n } else if (${2===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${A}\n } else if (${3===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n initializationValue\n );\n\n ${A}\n }\n }\n setOutput(${b});\n }\n `}}class mV{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,a=e.strideDepth,o=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,c=e.dilationHeight,h=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,f=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;const b="avg"===t;let w="0.0";if(b||(w="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${a}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${f};\n wC += ${h}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${f} +\n wR * ${f} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let v=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(v="avgValue / max(count, 1.0)");const A=4*Math.floor(i/4),x=i%4,C=`\n if (${b}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${a}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n const float initializationValue = ${w};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${w});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${A}; wC += 4) {\n int xC = xCCorner + wC * ${h};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n getValue(batch, xD, xR, xC + 3 * ${h}, ch)\n );\n\n ${C}\n }\n\n int xC = xCCorner + ${A};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${C}\n } else if (${2===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n initializationValue,\n initializationValue\n );\n\n ${C}\n } else if (${3===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n initializationValue\n );\n\n ${C}\n }\n }\n }\n setOutput(${v});\n }\n `}}const gV={kernelName:Ta,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;LB(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;Ni(hf(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))return nP({inputs:{x:r},backend:n});const c=new fV(u,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}};const yV={kernelName:Oa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:u}=s,c=tf(r.shape,i,a,[1,1,1],o,l,u),h=new mV(c,"avg",!1);return n.runWebGLProgram(h,[r],"float32")}};class bV{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=o-1-e.padInfo.top,c=l-1-e.padInfo.left,h=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${h});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${o};\n wR += ${i}) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC+= ${a}) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}}class wV{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=c-1-e.padInfo.front,f=h-1-e.padInfo.top,m=d-1-e.padInfo.left,g=1/(t*n*s);this.userCode=`\n const ivec3 pads = ivec3(${p}, ${f}, ${m});\n const float avgMultiplier = float(${g});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${o}) {\n float dyD = float(dyDCorner + wD) / ${r}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${h};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${d};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${a}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const vV={kernelName:Ra,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=tf(a.shape,o,l,[1,1,1],u,c),d=new wV(h);return n.runWebGLProgram(d,[r],a.dtype)}};const AV={kernelName:Na,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;LB([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=ef(a.shape,o,l,1,u),h=new bV(c);return n.runWebGLProgram(h,[r],a.dtype)}};const xV={kernelName:Da,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;return FP({a:r,b:i,transposeA:a,transposeB:o,backend:n})}};class CV{constructor(e,t,n,s,r,i){this.outputShape=[],this.variableNames=["x","mean","variance"],Gd(e,t),Gd(e,n);let a="0.0";null!=s&&(Gd(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="1.0";null!=r&&(Gd(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${a};\n float scale = ${o};\n float inv = scale * inversesqrt(variance + float(${i}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}class kV{constructor(e,t,n,s,r,i){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Gd(e,t),Gd(e,n);let a="vec4(0.0)";null!=s&&(Gd(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="vec4(1.0)";null!=r&&(Gd(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${a};\n vec4 scale = ${o};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${i}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}const SV={kernelName:_o,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,mean:r,variance:i,offset:a,scale:o}=e;Ni(r.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),Ni(null==a||r.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),Ni(null==o||r.shape.length===o.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[s,r,i];let c=null;null!=a&&(c=a.shape,u.push(a));let h=null;null!=o&&(h=o.shape,u.push(o));const d=ca().getBool("WEBGL_PACK_NORMALIZATION")?new kV(s.shape,r.shape,i.shape,c,h,l):new CV(s.shape,r.shape,i.shape,c,h,l);return t.runWebGLProgram(d,u,u[0].dtype)}};class _V{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=sz(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return EV.slice(0,e).map((e=>"sourceLoc."+e)).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let s;s=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${e.map(((e,t)=>`sourceLoc.${EV[t]} = start[${t}] + coords.${EV[t]};`)).join("\n")}\n `,this.userCode=`\n void main() {\n ${s}\n setOutput(getSource(${n}));\n }\n `}}const EV=["x","y","z","w","u","v"];class IV{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=sz(this.rank),n=SL("coords",this.rank),s=SL("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${s.slice(-2).join()})`,i=`getChannel(getSource(${s.join()}), ${r})`,a=`\n result.x = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.y = ${i};\n --${s[this.rank-1]};\n }\n `,o=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n ++${s[this.rank-2]};\n result.z = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.w = ${i};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map(((e,t)=>`start[${t}]`)).join()});`:e.map(((e,t)=>`${s[t]} = ${n[t]} + start[${t}];`)).join("\n");this.userCode=`\n void main() {\n ${t} coords = getOutputCoords();\n ${t} sourceLoc;\n ${l}\n vec4 result = vec4(0.);\n ${a}\n ${o}\n setOutput(result);\n }\n `}}function TV(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s,[o,l]=Lp(r,i,a);if(kp(r,o,l),0===Di(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=uL(e.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:u}=n.texData.get(r.dataId),c=Bp(r.shape,o,l);if(u||!c){const e=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new IV(l):new _V(l),t=[o];return n.runWebGLProgram(e,[r],r.dtype,t)}return n.uploadToGPU(r.dataId),function(e,t,n,s){const r=s.texData.get(e.dataId),i=s.makeTensorInfo(n,e.dtype),a=s.texData.get(i.dataId);Object.assign(a,r),a.refCount=1,a.shape=n,a.dtype=e.dtype;let o=zp(t,Yi(e.shape));r.slice&&(o+=r.slice.flatOffset),a.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=s.dataRefCount.get(a.slice.origDataId)||1;return s.dataRefCount.set(a.slice.origDataId,l+1),i}(r,o,l,n)}const NV={kernelName:Wl,backendName:"webgl",kernelFunc:TV},OV={kernelName:Ma,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;Ni(r.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=Aw(r.shape,i,o),u=xw(l.length,i.length),c=Cw(r.shape,i,o),h=kw(a,i.length),d=Sw(c,a,i.length),p=[],f=xP({inputs:{x:r},backend:n,attrs:{shape:l}}),m=RP({inputs:{x:f},backend:n,attrs:{perm:u}}),g=xP({inputs:{x:m},backend:n,attrs:{shape:c}}),y=TV({inputs:{x:g},backend:n,attrs:{begin:h,size:d}});return p.push(f),p.push(m),p.push(g),p.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}};const RV={kernelName:Fa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=n.readSync(r.dataId),l=n.readSync(i.dataId),u=Nz(o,l,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,u)}};const DV={kernelName:Ba,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:s,b:r}=t,i=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS"),a=ca().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([s,r])||1===a){const e=n.texData.get(s.dataId).values,t=n.texData.get(r.dataId).values,[i,a]=Rz(s.shape,r.shape,e,t,s.dtype),o=n.makeTensorInfo(a,s.dtype);return n.texData.get(o.dataId).values=i,o}let o;return o=i?new tP("\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n",s.shape,r.shape,!1):new JL("\n return float(int(a.r) & int(b.r));\n",s.shape,r.shape),n.runWebGLProgram(o,[s,r],s.dtype)}};const MV={kernelName:za,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.readSync(s.dataId),a=n.readSync(r.dataId),o=Gd(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},FV=fP({opSnippet:"return float(a != b);",cpuKernelImpl:Jz,dtype:"bool"}),BV={kernelName:ul,backendName:"webgl",kernelFunc:FV};function zV(e){const{inputs:t,backend:n}=e,{input:s}=t;return nP({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.real},backend:n})}const LV={kernelName:kl,backendName:"webgl",kernelFunc:zV},PV="return float(int(x));";const VV={kernelName:La,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s,attrs:r}=t,{x:i}=n,{dtype:a}=r;if("complex64"===a){if("complex64"===i.dtype)return nP({inputs:{x:i},backend:s});const t=ig(i.shape),n=e({inputs:{x:i},backend:s,attrs:{dtype:"float32"}}),r=rP({inputs:{real:n,imag:t},backend:s});return t.dispose(),s.disposeIntermediateTensorInfo(n),r}if("complex64"===i.dtype){const t=zV({inputs:{input:i},backend:s}),n=e({inputs:{x:t},backend:s,attrs:{dtype:a}});return s.disposeIntermediateTensorInfo(t),n}if(!qi(i.dtype,a)){const e=nP({inputs:{x:i},backend:s});return{dataId:e.dataId,shape:e.shape,dtype:a}}if(s.shouldExecuteOnCPU([i])){const e=s.texData.get(i.dataId).values,[t,n,r]=Dz(e,i.shape,i.dtype,a);return s.makeTensorInfo(t,n,r)}if("int32"===a)return function(e,t){const n=new RL(e.shape,PV),s=t.runWebGLProgram(n,[e],"int32");return{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}(i,s);if("bool"===a){const e=s.makeTensorInfo([],"bool",Gi("bool",1)),t=FV({inputs:{a:i,b:e},backend:s});return s.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${a}`)}},WV="return ceil(x);",GV=pP({opSnippet:WV,packedOpSnippet:WV,cpuKernelImpl:Mz}),UV={kernelName:Pa,backendName:"webgl",kernelFunc:GV};class qV{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}}class jV{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}}const HV={kernelName:Va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{clipValueMin:i,clipValueMax:a}=s;let o;o=ca().getBool("WEBGL_PACK_CLIP")?new jV(r.shape):new qV(r.shape);const l=[[i],[a]];return n.runWebGLProgram(o,[r],r.dtype,l)}};class $V{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}}function KV(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const XV={kernelName:Ga,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=n.texData.get(s.dataId),i=new $V(s.shape),a=[KV(s,r.complexTensorInfos.real),KV(s,r.complexTensorInfos.imag)];return n.runWebGLProgram(i,a,a[0].dtype)}};class ZV{constructor(e){this.outputShape=[],this.outputShape=dw(e,1),this.variableNames=e.map(((e,t)=>`T${t}`));const t=new Array(e.length-1);t[0]=e[0][1];for(let n=1;n`T${t}`));const o=new Array(e.length-1);o[0]=e[0][t];for(let n=1;n= ${o[e-1]}) {\n return getChannel(\n getT${e}(${QV(a,l,t)}),\n vec2(${QV(u,l,t)}));\n }`}const d=o.length,p=o[o.length-1];h+=`\n return getChannel(\n getT${d}(${QV(a,l,p)}),\n vec2(${QV(u,l,p)}));`,this.userCode=`\n float getValue(${a.map((e=>"int "+e))}) {\n ${h}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${i}), 0., 0., 0.);\n\n ${i[s-1]} = ${i[s-1]} + 1;\n if (${i[s-1]} < ${n[s-1]}) {\n result.g = getValue(${i});\n }\n\n ${i[s-2]} = ${i[s-2]} + 1;\n if (${i[s-2]} < ${n[s-2]}) {\n result.a = getValue(${i});\n }\n\n ${i[s-1]} = ${i[s-1]} - 1;\n if (${i[s-2]} < ${n[s-2]} &&\n ${i[s-1]} < ${n[s-1]}) {\n result.b = getValue(${i});\n }\n setOutput(result);\n }\n `}}function QV(e,t,n){const s=e.indexOf(t);return e.map(((e,t)=>t===s?`${e} - ${n}`:e)).join()}function JV(e){const{inputs:t,backend:n}=e,{input:s}=t;return nP({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.imag},backend:n})}const eW={kernelName:Do,backendName:"webgl",kernelFunc:JV};function tW(e,t,n){const s=e[0].dtype;if("complex64"===s){const s=e.map((e=>zV({inputs:{input:e},backend:n}))),r=e.map((e=>JV({inputs:{input:e},backend:n}))),i=tW(s,t,n),a=tW(r,t,n),o=rP({inputs:{real:i,imag:a},backend:n});return s.forEach((e=>n.disposeIntermediateTensorInfo(e))),r.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(a),o}let r=n.shouldExecuteOnCPU(e);if("string"===s&&(r=!0),r){const r=e.map((e=>{const s=Di(e.shape.slice(t));return xP({inputs:{x:e},backend:n,attrs:{shape:[-1,s]}})})),i=r.map((e=>({vals:n.readSync(e.dataId),shape:e.shape}))),a=dw(r.map((e=>e.shape)),1),o=1===r[0].shape[0],l=Fz(i,a,s,o),u=dw(e.map((e=>e.shape)),t),c=n.makeTensorInfo(u,s,l);return r.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}const i=e.filter((e=>Di(e.shape)>0)),a=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&i[0].shape.length>1;if(1===i.length){const t=a?new RL(e[0].shape,PL):new HL(e[0].shape,PL);return n.runWebGLProgram(t,e,s)}const o=ca().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(i.length>o){const e=[];for(let s=0;se.shape)),t);return n.runWebGLProgram(e,i,s)}const{tensors2D:l,outShape:u}=function(e,t,n){const s=dw(e.map((e=>e.shape)),t),r=e.map((e=>xP({inputs:{x:e},attrs:{shape:[-1,Di(e.shape.slice(t))]},backend:n})));return{tensors2D:r,outShape:s}}(i,t,n),c=new ZV(l.map((e=>e.shape))),h=n.runWebGLProgram(c,l,s);l.forEach((e=>n.disposeIntermediateTensorInfo(e)));const d=xP({inputs:{x:h},attrs:{shape:u},backend:n});return n.disposeIntermediateTensorInfo(h),d}function nW(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s,i=Vi(r,t[0].shape)[0];hw(t.map((e=>e.shape)),i);const a=dw(t.map((e=>e.shape)),i);if(0===Di(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Di(e.shape)>0));return 1===o.length?nP({inputs:{x:o[0]},backend:n}):tW(o,i,n)}const sW={kernelName:Ua,backendName:"webgl",kernelFunc:nW};class rW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const i=e.padInfo.top,a=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,y=m?2:3,b=m?3:1;let w="",v="";n&&(w=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,v="result = activation(result);");const A=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${w}\n\n const ivec2 strides = ivec2(${o}, ${l});\n const ivec2 pads = ivec2(${i}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${b}];\n\n ivec2 xRCCorner =\n ivec2(coords[${g}], coords[${y}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${m}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${1===f}) {\n\n if (${m}) {\n dotProd +=\n getX(batch, xR, xC, ${p}) *\n getW(wR, wC, ${p}, d2);\n } else {\n dotProd +=\n getX(batch, ${p}, xR, xC) *\n getW(wR, wC, ${p}, d2);\n }\n\n } else if (${2===f}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2)\n );\n\n if (${m}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${3===f}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2),\n getW(wR, wC, ${p} + 2, d2)\n );\n\n if (${m}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1),\n getX(batch, xR, xC, ${p} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC),\n getX(batch, ${p} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${A}\n ${v}\n setOutput(result);\n }\n `}}class iW{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,s=e.padInfo.left,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.filterDepth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${r}, ${i}, ${a});\n const ivec3 pads = ivec3(${t}, ${n}, ${s});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${o};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${u};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${1===f}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${p}) *\n getW(wF, wR, wC, ${p}, d2);\n } else if (${2===f}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${3===f}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1),\n getX(batch, xF, xR, xC, ${p} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2),\n getW(wF, wR, wC, ${p} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class aW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=cz(this.outputShape.length);const i=e.padInfo.left,a=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,c=u;let h="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let t=0;t<(c+1)/2;t++){const n=2*t;if(h+=`\n xC = xCCorner + ${n*o};\n `,1===a){if(n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n `,h+=1===o&&n>0?`\n xC${n} = vec4(xTexelC${n-2}.zw, xTexelC${n}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${n} = vec4(previous.zw, xTexelC${n}.xy);\n } else {\n xC${n} = vec4(0.0, 0.0, xTexelC${n}.xy);\n }\n `):h+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xC${n} = xTexelC${n};\n `,n+1= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n `,h+=o>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${n+1} = vec4(previous.zw, xTexelC${n+1}.xy);\n } else {\n xC${n+1} = vec4(0.0, 0.0, xTexelC${n+1}.xy);\n }\n `:`\n xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.xy);\n `):h+=1===e?`\n xC${n+1} = xTexelC${n};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n+1} = xTexelC${n+1};\n `}}else n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n `,n+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n `)):(h+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(\n xTexelC${n}.xy, xTexelC${n+1}.xy);\n `,n+1= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${a}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${r}) {\n innerDims = vec2(d1, ch);\n result[${2*e+t}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${l}\n\n ${s.output} = result;\n }\n `}}function lW(e,t){const n=e.length;return n>=3?t?[...e.slice(0,-3),e[n-3]*e[n-2],e[n-1]]:[...e.slice(0,-3),e[n-3],e[n-2]*e[n-1]]:!t&&1===n&&e[0]>1?[e[0],1]:null}function uW({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const l=e.shape,u=s.texData.get(e.dataId),c=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=i){const e=lW(i.shape,p);null!=e&&(i=xP({inputs:{x:i},backend:s,attrs:{shape:e}}),g.push(i))}if(null!=r){const e=lW(r.shape,p);null!=e&&(r=xP({inputs:{x:r},backend:s,attrs:{shape:e}}),g.push(r))}if(!((1===h||1===d)&&c>MP)&&u.isPacked&&p&&null!=u.texture&&l[2]%2!=0&&Mi(u.shape.slice(-3),l.slice(-3))){const c=l[0]*l[1]*(l[2]+1),h={dataId:e.dataId,shape:[1,c,n.inChannels],dtype:e.dtype},d=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,Ni(OB(u.shape,h.shape),(()=>`packed reshape ${u.shape} to ${h.shape} isn't free`));const p=xP({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const y=FP({a:h,b:p,backend:s,transposeA:false,transposeB:f,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a}),b=s.texData.get(y.dataId);Ni(b.isPacked,(()=>"batchMatMul result is expected to be packed")),u.shape=d,b.shape=n.outShape,m=nP({inputs:{x:y},backend:s}),m.shape=n.outShape,g.push(y)}else{const l=n.outHeight*n.outWidth,u=xP({inputs:{x:e},backend:s,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),c=xP({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}}),h=FP({a:p?u:c,b:p?c:u,transposeA:!p,transposeB:f,backend:s,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a});m=xP({inputs:{x:h},backend:s,attrs:{shape:n.outShape}}),g.push(u),g.push(c),g.push(h)}for(const e of g)s.disposeIntermediateTensorInfo(e);return m}function cW({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const{filterWidth:l,filterHeight:u,inChannels:c,outWidth:h,outHeight:d,dataFormat:p}=n,f="channelsLast"===p,m=l*u*c,g=d*h,y=[n.batchSize,m,g],b=[];if(null!=i){const e=lW(i.shape,f);null!=e&&(i=xP({inputs:{x:i},backend:s,attrs:{shape:e}}),b.push(i))}if(null!=r){const e=lW(r.shape,f);null!=e&&(r=xP({inputs:{x:r},backend:s,attrs:{shape:e}}),b.push(r))}const w=xP({inputs:{x:t},backend:s,attrs:{shape:[1,m,Di(t.shape)/m]}});b.push(w);const v=new oW(y,n),A=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],x=s.runWebGLProgram(v,[e],"float32",A),C=xP({inputs:{x},backend:s,attrs:{shape:y}});b.push(x),b.push(C);const k=null!=r,S=null!=i,_="leakyrelu"===o,E=o?mP(o,!0):null,I=new gP(f?C.shape:w.shape,f?w.shape:C.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,k,E,S,_),T=f?[C,w]:[w,C];if(r&&T.push(r),S&&T.push(i),_){const e=s.makeTensorInfo([],"float32",Qu(a,"float32"));T.push(e),b.push(e)}const N=s.runWebGLProgram(I,T,"float32"),O=xP({inputs:{x:N},backend:s,attrs:{shape:n.outShape}});b.push(N);for(const e of b)s.disposeIntermediateTensorInfo(e);return O}const hW={kernelName:qa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s,h=pf(l),d=nf(r.shape,i.shape,a,u,o,c,!1,h);let p;if(1!==d.filterHeight||1!==d.filterWidth||1!==d.dilationHeight||1!==d.dilationWidth||1!==d.strideHeight||1!==d.strideWidth||"SAME"!==d.padInfo.type&&"VALID"!==d.padInfo.type)if(d.strideWidth<=2&&"channelsLast"===h&&ca().getBool("WEBGL_EXP_CONV")){const e=new aW(d),t=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];p=n.runWebGLProgram(e,[r,i],"float32",t)}else if(ca().getBool("WEBGL_CONV_IM2COL"))p=cW({x:r,filter:i,convInfo:d,backend:n});else{const e=new rW(d);p=n.runWebGLProgram(e,[r,i],"float32")}else p=uW({x:r,filter:i,convInfo:d,backend:n});const f=xP({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),f}};class dW{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,i="channelsLast"===e.dataFormat;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${i?"float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);":"float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);"}\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class pW{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i="channelsLast"===e.dataFormat,a=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=i?1:2,u=i?2:3,c=i?3:1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n if (${i}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class fW{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.padInfo.front,i=e.padInfo.top,a=e.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yF = 0; yF < ${e.outDepth}; yF++) {\n int xF = wF + yF * ${t} - ${r};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${n} - ${i};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${s} - ${a};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class mW{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=s-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${o}, ${l}, ${u});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${t}; wF++) {\n float dyF = float(dyFCorner + wF) / ${r}.0;\n\n if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${t} - 1 - wF;\n\n for (int wR = 0; wR < ${n}; wR++) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${n} - 1 - wR;\n\n for (int wC = 0; wC < ${s}; wC++) {\n float dyC = float(dyCCorner + wC) / ${a}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${s} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const gW={kernelName:ja,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:c}=s,h=pf(l),d=nf(r.shape,c,a,1,o,u,!1,h),p=new dW(d);return n.runWebGLProgram(p,[r,i],"float32")}};class yW{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=cz(this.outputShape.length);const t=e.filterHeight,n=e.filterWidth,s=t-1-e.padInfo.top,r=n-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${r});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n int wCPerm = ${n} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}}const bW={kernelName:Ha,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{inputShape:a,strides:o,pad:l,dataFormat:u,dimRoundingMode:c}=s,h=pf(u),d=nf(a,i.shape,o,1,l,c,!1,h);if(ca().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===h){const e=[[d.strideHeight,d.strideWidth]],t=new yW(d);return n.runWebGLProgram(t,[r,i],"float32",e)}{const e=new pW(d);return n.runWebGLProgram(e,[r,i],"float32")}}};const wW={kernelName:$a,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,u=sf(r.shape,i.shape,a,l,o),c=new iW(u);return n.runWebGLProgram(c,[r,i],"float32")}};const vW={kernelName:Ka,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,filterShape:l}=s,u=sf(r.shape,l,a,1,o),c=new fW(u);return n.runWebGLProgram(c,[r,i],"float32")}};const AW={kernelName:Xa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{pad:a,strides:o,inputShape:l}=s,u=sf(l,i.shape,o,1,a),c=new mW(u);return n.runWebGLProgram(c,[r,i],"float32")}},xW=pP({opSnippet:dP+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${eP}\n return result;\n`}),CW={kernelName:Za,backendName:"webgl",kernelFunc:xW},kW=pP({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),SW={kernelName:Ya,backendName:"webgl",kernelFunc:kW};class _W{constructor(e,t,n,s,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[i,a,o,l]=e,[u]=t,[c,h]=n;this.outputShape=[u,c,h,l];const d="bilinear"===s?1:0,[p,f]=[a-1+".0",o-1+".0"],[m,g,y]=c>1?[""+(a-1)/(c-1),"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[b,w,v]=h>1?[""+(o-1)/(h-1),"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n const float height_ratio = float(${m});\n const float width_ratio = float(${b});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${i}) {\n return;\n }\n\n float height_scale = ${g};\n float width_scale = ${w};\n\n float in_y = ${y};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${r}));\n return;\n }\n float in_x = ${v};\n if( in_x < 0.0 || in_x > ${f} ) {\n setOutput(float(${r}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${d} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}}const EW={kernelName:eo,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:u}=s,c=new _W(r.shape,i.shape,o,l,u);return n.runWebGLProgram(c,[r,i,a],"float32")}};var IW;!function(e){e.Prod="*",e.Sum="+"}(IW||(IW={}));class TW{constructor(e,t,n,s){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const r=this.outputShape.length,i=this.op===IW.Prod?"1.0":"0.0",a=n?i:`getX(${NW(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1];let l="",u="";n?(l=s?"end != "+(o-1):"end != 0",u=s?"end + 1":"end - 1"):(l=s?`end + pow2 < ${o}`:"end >= pow2",u=s?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${sz(r)} coords = getOutputCoords();\n int end = ${OW(r,"coords",this.op)};\n float val = ${a};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${u};\n ${OW(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${NW(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function NW(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function OW(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function RW(e,t,n,s,r,i){const a=t.shape.length,o=fm([s],a);let l=t;null!=o&&(l=RP({inputs:{x:t},backend:n,attrs:{perm:o}}));const u=gm(1,a)[0];if(u!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${s}`);const c=l.shape[u];let h=nP({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(c))-1;t++){const s=new TW(e,l.shape,!1,i),r=[[t]],a=h;h=n.runWebGLProgram(s,[h],h.dtype,r),n.disposeIntermediateTensorInfo(a)}if(r){const t=new TW(e,l.shape,r,i),s=h;h=n.runWebGLProgram(t,[h],h.dtype),n.disposeIntermediateTensorInfo(s)}if(null!=o){const e=RP({inputs:{x:h},backend:n,attrs:{perm:mm(o)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(l),e}return h}const DW={kernelName:Qa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return RW(IW.Prod,r,n,i,a,o)}};const MW={kernelName:Ja,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return RW(IW.Sum,r,n,i,a,o)}};const FW={kernelName:to,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a,binaryOutput:o}=s;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(i.dataId),s=Nz(e,t,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,s)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(i),s=Oz(e,t,a,o);return n.makeTensorInfo(s.shape,i.dtype,s.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};class BW{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${t};\n int offset_h = imod(h, ${t});\n int in_w = w / ${t};\n int offset_w = imod(w, ${t});\n int offset_d = (offset_h * ${t} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const zW={kernelName:no,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockSize:i,dataFormat:a}=s,o=r.shape[0],l=("NHWC"===a?r.shape[1]:r.shape[2])*i,u=("NHWC"===a?r.shape[2]:r.shape[3])*i,c=("NHWC"===a?r.shape[3]:r.shape[1])/(i*i),h=new BW("NHWC"===a?[o,l,u,c]:[o,c,l,u],i,a);return n.runWebGLProgram(h,[r],r.dtype)}};class LW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=cz(this.outputShape.length);const i=e.filterHeight,a=e.filterWidth,o=e.outChannels/e.inChannels;let l="",u="";n&&(l=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,u="result = activation(result);");const c=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${l}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${o};\n int q = d2 - d1 * ${o};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${i}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${a}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${u}\n setOutput(result);\n }\n `}}class PW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=cz(this.outputShape.length);const i=e.outChannels/e.inChannels,a=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,c=e.filterWidth,h=c;let d="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let e=0;e<(h+1)/2;e++){const t=2*e;if(d+=`\n xC = xCCorner + ${t*l};\n `,1===o){if(t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n `,d+=1===l&&t>0?`\n xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${t} = vec4(previous.zw, xTexelC${t}.xy);\n } else {\n xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xC${t} = xTexelC${t};\n `,t+1= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n `,d+=l>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${t+1} = vec4(previous.zw, xTexelC${t+1}.xy);\n } else {\n xC${t+1} = vec4(0.0, 0.0, xTexelC${t+1}.xy);\n }\n `:`\n xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy);\n `):d+=1===e?`\n xC${t+1} = xTexelC${t};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t+1} = xTexelC${t+1};\n `}}else t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n `,t+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(\n xTexelC${t}.xy, xTexelC${t+1}.xy);\n `,t+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${c}'`));const h=nf(r.shape,i.shape,a,c,o,u,!0);let d;d=ca().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?new PW(h):new LW(h);const p=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];return n.runWebGLProgram(d,[r,i],"float32",p)}};class WW{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,i=e.outChannels/e.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${i} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class GW{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=t-1-e.padInfo.top,a=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${o}; dm++) {\n int d2 = d1 * ${o} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const UW={kernelName:ro,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:u,filterShape:c}=s,h=nf(r.shape,c,a,o,l,u,!0),d=new WW(h);return n.runWebGLProgram(d,[r,i],"float32")}};const qW={kernelName:io,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:u,inputShape:c}=s,h=nf(c,i.shape,a,o,l,u,!0),d=new GW(h);return n.runWebGLProgram(d,[r,i],"float32")}};class jW{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}}const HW={kernelName:ao,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=[...s.shape,...s.shape],i=Di(s.shape),a=xP({inputs:{x:s},backend:n,attrs:{shape:[i]}}),o=new jW(i),l=n.runWebGLProgram(o,[a],a.dtype),u=xP({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(l),u}};class $W{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:s,strideHeight:r,strideWidth:i,filterHeight:a,filterWidth:o,dilationHeight:l,dilationWidth:u}=e,{top:c,left:h}=s;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${i});\n const ivec2 pads = ivec2(${c}, ${h});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${a}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${o}; w++) {\n int wIn = wBeg + w * ${u};\n\n if (wIn >= 0 && wIn < ${n}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}}const KW={kernelName:oo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,u=Jp(r.shape,i.shape,a,o,"NHWC",l);let c;const h=new $W(u);c=n.runWebGLProgram(h,[r,i],"float32");const d=xP({inputs:{x:c},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(c),d}};const XW={kernelName:po,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{equation:r}=s,i=t,{allDims:a,summedDims:o,idDims:l}=$w(r,i.length);Xw(a.length,l,i);const{path:u,steps:c}=Zw(o,l),h=c.length;let d=null,p=a.length;const f=[];for(let e=0;e=0&&(d=NP({inputs:{x:d},backend:n,attrs:{axis:u[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},ZW=pP({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),YW={kernelName:fo,backendName:"webgl",kernelFunc:ZW},QW={kernelName:mo,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:s,y:r}=t,i=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new tP("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",s.shape,r.shape):new JL("return (b >= 0.0) ? a : a * (b + 1.0);",s.shape,r.shape);return n.runWebGLProgram(i,[s,r],s.dtype)}},JW=fP({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:Bz}),eG={kernelName:yo,backendName:"webgl",kernelFunc:JW},tG=pP({opSnippet:`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ${Tw};\n float a1 = ${Nw};\n float a2 = ${Ow};\n float a3 = ${Rw};\n float a4 = ${Dw};\n float a5 = ${Mw};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),nG={kernelName:go,backendName:"webgl",kernelFunc:tG},sG=pP({opSnippet:dP+"\n return exp(x);\n",packedOpSnippet:"\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:zz,dtype:"float32"}),rG={kernelName:bo,backendName:"webgl",kernelFunc:sG};function iG(e){const{inputs:t,attrs:n,backend:s}=e,{dim:r}=n,{input:i}=t,a=i.shape.length,o=i.shape.slice();let l=r;return r<0&&(Ni(-(a+1)<=r,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+r+1),o.splice(l,0,1),xP({inputs:{x:i},backend:s,attrs:{shape:o}})}const aG={kernelName:wo,backendName:"webgl",kernelFunc:iG},oG="return exp(x) - 1.0;",lG=pP({opSnippet:oG,packedOpSnippet:oG,cpuKernelImpl:Lz}),uG={kernelName:vo,backendName:"webgl",kernelFunc:lG};class cG{constructor(e,t,n){this.variableNames=["real","imag"];const s=t[1];this.outputShape=t;const r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,i=n?`${s}.0`:"1.0";let a;if("real"===e)a="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);a="return real * expI + imag * expR;"}this.userCode=`\n const float exponentMultiplier = ${r};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${a}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${s});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${s}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${i};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}function hG(e,t,n){const s=n.texData.get(e.dataId),r=Di(e.shape),i=e.shape[e.shape.length-1],a=xP({inputs:{x:e},backend:n,attrs:{shape:[r/i,i]}}),o=a.shape,l=new cG("real",o,t),u=new cG("imag",o,t),c=[{dataId:s.complexTensorInfos.real.dataId,dtype:s.complexTensorInfos.real.dtype,shape:o},{dataId:s.complexTensorInfos.imag.dataId,dtype:s.complexTensorInfos.imag.dtype,shape:o}],h=n.runWebGLProgram(l,c,"float32"),d=n.runWebGLProgram(u,c,"float32"),p=rP({inputs:{real:h,imag:d},backend:n});n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d);const f=xP({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(p),f}const dG={kernelName:Ao,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return hG(s,!1,n)}};class pG{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}}function fG(e){const{backend:t,attrs:n}=e,{shape:s,value:r}=n;let{dtype:i}=n;if(i=i||Ki(r),"string"===i){const e=Ui(i,Di(s));return e.fill(r),t.makeTensorInfo(s,i,e)}{const e=new pG(s,r),n=[[r]];return t.runWebGLProgram(e,[],i,n)}}const mG={kernelName:xo,backendName:"webgl",kernelFunc:fG};class gG{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${t} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${t}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const yG={kernelName:Co,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,s=t,r=new gG(n.shape);return s.runWebGLProgram(r,[n],n.dtype)}},bG="return floor(x);",wG=pP({opSnippet:bG,packedOpSnippet:bG,cpuKernelImpl:Pz}),vG={kernelName:ko,backendName:"webgl",kernelFunc:wG},AG=fP({opSnippet:"\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",packedOpSnippet:"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n",dtype:"int32"}),xG={kernelName:So,backendName:"webgl",kernelFunc:AG};class CG{constructor(e){this.variableNames=["A"];const t=VB(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${s}.0, ${n}.0);\n\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}}class kG{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=VB(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${s}.0, ${n}.0);\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${t.output} = result;\n }\n `}}const SG={kernelName:xu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e;let{pixels:r}=t;const{numChannels:i}=s,a="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,o="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,u]=a?[r.videoWidth,r.videoHeight]:[r.width,r.height],c=[u,l],h=[u,l,i];if(o||a){const e=ca().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=_G&&e===EG||(EG=e,_G=document.createElement("canvas").getContext("2d",{willReadFrequently:EG})),_G.canvas.width=l,_G.canvas.height=u,_G.drawImage(r,0,0,l,u),r=_G.canvas}const d=n.makeTensorInfo(c,"int32");n.texData.get(d.dataId).usage=lB.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),r);const p=ca().getBool("WEBGL_PACK")?new kG(h):new CG(h),f=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),f}};let _G,EG=ca().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const IG={kernelName:Su,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s,m=pf(c),g=nf(r.shape,i.shape,l,h,u,d,!1,m);let y;const b=[],w=null!=a,v=null!=o,A="leakyrelu"===p,x=()=>{const e=[r,i],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=xP({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return b.push(t),t}return e};if(w&&e.push(t(a,c)),v&&e.push(t(o,c)),A){const t=n.makeTensorInfo([],"float32",Qu(f,"float32"));e.push(t),b.push(t)}return e};if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(g.strideWidth<=2&&"channelsLast"===m&&ca().getBool("WEBGL_EXP_CONV")){const e=p?mP(p,!0):null,t=new aW(g,w,e,v,A),s=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=x();y=n.runWebGLProgram(t,r,"float32",s)}else if(ca().getBool("WEBGL_CONV_IM2COL"))y=cW({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});else{const e=p?mP(p,!1):null,t=new rW(g,w,e,v,A),s=x();y=n.runWebGLProgram(t,s,"float32")}else y=uW({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});const C=xP({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return b.push(y),b.forEach((e=>n.disposeIntermediateTensorInfo(e))),C}};const TG={kernelName:_u,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:c,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=s,f=[];let m=c;null==m&&(m=[1,1]),Ni(hf(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=nf(r.shape,i.shape,l,m,u,h,!0),y=ca().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,b=d?mP(d,y):null,w=[r,i],v=null!=a,A=null!=o,x="leakyrelu"===d;if(v&&w.push(a),A&&w.push(o),x){const e=n.makeTensorInfo([],"float32",Qu(p,"float32"));w.push(e),f.push(e)}let C;C=y?new PW(g,v,b,A,x):new LW(g,v,b,A,x);const k=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],S=n.runWebGLProgram(C,w,"float32",k);return f.forEach((e=>n.disposeIntermediateTensorInfo(e))),S}};class NG{constructor(e,t,n,s){this.sliceDim=e,this.strides=t,this.paramsShape=s,this.variableNames=["x","indices"],this.outputShape=n;const r=sz(n.length);let i="\n int index;";for(let e=0;e= ${this.paramsShape[e]};\n flattenIndex += index * ${this.strides[e]};`;this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${i}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const OG={kernelName:Io,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:s,indices:r}=t,i=r.shape,a=i[i.length-1],o=Di(s.shape),[l,u,c,h]=_w(s,r),d=xP({inputs:{x:r},backend:n,attrs:{shape:[u,a]}}),p=xP({inputs:{x:s},backend:n,attrs:{shape:[Di(s.shape)/c,c]}});if(n.shouldExecuteOnCPU([s,r])||"string"===s.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(s),i=Vz(e,t,s.dtype,u,a,c,h,s.shape,o);return n.makeTensorInfo(l,s.dtype,i.values)}const f=new NG(a,h,[u,c],s.shape),m=n.runWebGLProgram(f,[p,d],p.dtype),g=xP({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}};class RG{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=sz(this.rank),s=function(e,t){const n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[];for(let t=0;t= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${s}));\n }\n `}}function DG(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,indices:i}=t,{axis:a,batchDims:o}=s,l=Vi(a,r.shape)[0];if(ca().get("DEBUG")){const e=n.readSync(i.dataId),t=r.shape[l];for(let n=0;n=0,(()=>`GatherV2: the index value ${s} is not in [0, ${t-1}]`))}}const u=fv(r,i,l,o),c=Di(i.shape),h=[],d=xP({inputs:{x:r},backend:n,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),p=xP({inputs:{x:i},backend:n,attrs:{shape:[u.batchSize,c/u.batchSize]}});h.push(d),h.push(p);const f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(n.shouldExecuteOnCPU([r,i])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(d),s=Wz(t,e,f);return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u.outputShape,s.dtype,s.values)}const m=new RG(d.shape,f),g=n.runWebGLProgram(m,[d,p],d.dtype);h.push(g);const y=xP({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}const MG={kernelName:Eo,backendName:"webgl",kernelFunc:DG},FG=fP({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:Gz,dtype:"bool"}),BG={kernelName:To,backendName:"webgl",kernelFunc:FG},zG=fP({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:Uz}),LG={kernelName:No,backendName:"webgl",kernelFunc:zG};const PG={kernelName:Ro,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return hG(s,!0,n)}},VG=pP({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),WG={kernelName:Mo,backendName:"webgl",kernelFunc:VG},GG=pP({opSnippet:"return float(isinf(x));",dtype:"bool"}),UG={kernelName:Fo,backendName:"webgl",kernelFunc:GG},qG=pP({opSnippet:"return float(isnan(x));",dtype:"bool"}),jG={kernelName:Bo,backendName:"webgl",kernelFunc:qG},HG=fP({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:qz,dtype:"bool"}),$G={kernelName:Lo,backendName:"webgl",kernelFunc:HG},KG=fP({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:jz,dtype:"bool"}),XG={kernelName:Po,backendName:"webgl",kernelFunc:KG};const ZG={kernelName:Vo,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:s,stop:r,num:i}=n,a=Hz(s,r,i);return t.makeTensorInfo([a.length],"float32",a)}},YG=pP({opSnippet:dP+"\n return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n",cpuKernelImpl:$z}),QG={kernelName:Wo,backendName:"webgl",kernelFunc:YG},JG=pP({opSnippet:dP+"\n return log(1.0 + x);\n"}),eU={kernelName:Go,backendName:"webgl",kernelFunc:JG},tU=fP({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),nU={kernelName:Uo,backendName:"webgl",kernelFunc:tU},sU=pP({opSnippet:"return float(!(x >= 1.0));"}),rU={kernelName:qo,backendName:"webgl",kernelFunc:sU},iU=fP({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),aU={kernelName:jo,backendName:"webgl",kernelFunc:iU};class oU{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[];const i=t,a=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${i}; j <= ${i}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${a}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${o};\n setOutput(val);\n }\n `}}class lU{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const i=t,a=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${i};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${i}; j <= ${i}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${a}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${o};\n setOutput(result);\n }\n `}}const uU={kernelName:Ho,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s,u=ca().getBool("WEBGL_PACK_NORMALIZATION")?new lU(r.shape,i,a,o,l):new oU(r.shape,i,a,o,l);return n.runWebGLProgram(u,[r],r.dtype)}};class cU{constructor(e,t,n,s,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=s,this.beta=r,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${t})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${t} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${s}) * norm + float(${n});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${s})\n * float(${r})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${r});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}}const hU={kernelName:$o,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r,y:i,dy:a}=t,{depthRadius:o,bias:l,alpha:u,beta:c}=s,h=new cU(r.shape,o,l,u,c);return n.runWebGLProgram(h,[r,i,a],r.dtype)}};function dU(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=r.shape.length,l=Vi(i,r.shape);let u=l;const c=fm(u,o),h=null!=c,d=n.shouldExecuteOnCPU([r]);let p=r;if(h){if(d){const e=n.texData.get(p.dataId).values,t=new Array(o);for(let e=0;e`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))return nP({inputs:{x:r},backend:n});const c=new fV(u,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}};const yU={kernelName:Qo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dataFormat:l,dimRoundingMode:u}=s,c=tf(r.shape,i,a,[1,1,1],o,u,l),h=new mV(c,"max",!1);return n.runWebGLProgram(h,[r],r.dtype)}};class bU{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,s=e.dilationHeight,r=e.effectiveFilterHeight,i=e.effectiveFilterWidth,a=r-1-e.padInfo.top,o=i-1-e.padInfo.left,l=r*i-1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${r};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${t}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${i}; wC++) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${i} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class wU{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.dilationDepth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=u-1-e.padInfo.left,p=o*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${h}, ${d});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${o};\n wD += ${r}) {\n float dyD = float(dyDCorner + wD) / ${t}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${l};\n wR += ${i}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC += ${a}) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${p} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${l} * ${u} +\n wR * ${u} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const vU={kernelName:Jo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=tf(a.shape,o,l,[1,1,1],u,c),d=new mV(h,"max",!0),p=n.runWebGLProgram(d,[a],a.dtype),f=new wU(h),m=n.runWebGLProgram(f,[r,p],a.dtype);return n.disposeIntermediateTensorInfo(p),m}};const AU={kernelName:Yo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;LB([i,a],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=ef(o.shape,l,u,1,c,h),p=new fV(d,"max",!0),f=n.runWebGLProgram(p,[o],o.dtype),m=new bU(d),g=n.runWebGLProgram(m,[r,f],o.dtype);return n.disposeIntermediateTensorInfo(f),g}};const xU={kernelName:el,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;Ni(4===s.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${s.shape.length}.`));const u=[1,1];Ni(hf(i,u),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`));const c=ef(s.shape,r,i,u,a),[h,d]=function(e,t,n,s){let r=new fV(n,"max",!1);const i=s.runWebGLProgram(r,[e],"float32");return r=new fV(n,"max",!0,!0,t),[i,s.runWebGLProgram(r,[e],"float32")]}(s,o,c,l);return[h,d]}};const CU={kernelName:tl,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{keepDims:r,axis:i}=t,a=n,o=s.shape.length,l=Vi(i,s.shape);let u=l;const c=fm(u,o),h=null!=c,d=a.shouldExecuteOnCPU([s]),p=[];let f=s;if(h){if(d){const e=a.texData.get(f.dataId).values,t=new Array(o);for(let e=0;et[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s),l="reflect"===n?0:1;this.userCode=1!==s?`\n ${r} start = ${r}(${i});\n ${r} end = ${r}(${a});\n\n void main() {\n ${r} outC = getOutputCoords();\n for (int i = 0; i < ${s}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${l};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n }\n }\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n `:`\n int start = ${i};\n int end = ${a};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${l};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${l};\n }\n setOutput(getX(outC - start));\n }\n `}}class IU{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=SL("rc",s),l=SL("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h="reflect"===n?0:1;let d="";if(1===s){const e=`\n ${r} source = rc;\n if (source < start) {\n source = start * 2 - source - ${h};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${h};\n }\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n `}else{const e=`\n ${r} source = rc;\n ${r} lt = ${r}(lessThan(source, start));\n ${r} gte = ${r}(greaterThanEqual(source, end));\n ${r} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${h}) +\n gte * ((end - 1) * 2 - source + ${h});\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {\n ${e}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${i});\n const ${r} end = ${r}(${a});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}}const TU={kernelName:rl,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s}=e,{paddings:r,mode:i}=n,a=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new IU(s.shape,r,i):new EU(s.shape,r,i);return t.runWebGLProgram(a,[s],s.dtype)}},NU=fP({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n "+eP+"\n return result;\n"}),OU={kernelName:il,backendName:"webgl",kernelFunc:NU};class RU{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,n],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${t-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${t-1}));\n }\n `}}const DU=fP({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),MU={kernelName:ho,backendName:"webgl",kernelFunc:DU},FU="return a - b;",BU=fP({opSnippet:FU,packedOpSnippet:FU,supportsComplex:!0,cpuKernelImpl:wL}),zU={kernelName:cu,backendName:"webgl",kernelFunc:BU};function LU(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=Vi([i],r.shape),o=dU({inputs:{x:r},backend:n,attrs:{reductionIndices:a,keepDims:!1}}),l=dm(o.shape,a),u=xP({inputs:{x:o},backend:n,attrs:{shape:l}}),c=BU({inputs:{a:r,b:u},backend:n}),h=sG({inputs:{x:c},backend:n}),d=NP({inputs:{x:h},backend:n,attrs:{axis:a,keepDims:!1}}),p=xP({inputs:{x:d},backend:n,attrs:{shape:l}}),f=DU({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),f}const PU={kernelName:Yl,backendName:"webgl",kernelFunc:LU};const VU={kernelName:al,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s,l=o?r:LU({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],c=l.shape[1],h=new RU(u,c,i),d=[[a]],p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}},WU=DL+"\n return -x;\n";const GU={kernelName:ll,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])){const e=n.texData.get(s.dataId),[t,r]=Qz(e.values,s.shape,s.dtype);return n.makeTensorInfo(r,s.dtype,t)}let r;return r=ca().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new HL(s.shape,"\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"):new RL(s.shape,WU),n.runWebGLProgram(r,[s],s.dtype)}},UU=yb;const qU={kernelName:cl,backendName:"webgl",kernelFunc:function(e){Eu();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=s,u=n.readSync(r.dataId),c=n.readSync(i.dataId),{selectedIndices:h}=UU(u,c,a,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}},jU=bb;const HU={kernelName:hl,backendName:"webgl",kernelFunc:function(e){Eu();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:u}=s,c=n.readSync(r.dataId),h=n.readSync(i.dataId),{selectedIndices:d,validOutputs:p}=jU(c,h,a,o,l,u);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},$U=wb;const KU={kernelName:dl,backendName:"webgl",kernelFunc:function(e){Eu();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=s,c=n.readSync(r.dataId),h=n.readSync(i.dataId),d=a,p=o,f=l,m=u,{selectedIndices:g,selectedScores:y}=$U(c,h,d,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class XU{constructor(e,t,n,s){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${s}), float(${n}),\n float(index == coords.y)));\n }\n `}}const ZU={kernelName:fl,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s,u=Di(r.shape),c=new XU(u,a,o,l),h=xP({inputs:{x:r},backend:n,attrs:{shape:[u]}}),d=n.runWebGLProgram(c,[h],i);n.disposeIntermediateTensorInfo(h);const p=xP({inputs:{x:d},backend:n,attrs:{shape:[...r.shape,a]}});return n.disposeIntermediateTensorInfo(d),p}};function YU(e){const{inputs:t,backend:n}=e,{x:s}=t;if("complex64"===s.dtype){const e=zV({inputs:{input:s},backend:n}),t=YU({inputs:{x:e},backend:n}),r=JV({inputs:{input:s},backend:n}),i=YU({inputs:{x:r},backend:n}),a=rP({inputs:{real:t,imag:i},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(i),a}return fG({attrs:{shape:s.shape,dtype:s.dtype,value:"string"===s.dtype?"":0},backend:n})}const QU={kernelName:vu,backendName:"webgl",kernelFunc:YU};const JU={kernelName:pl,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===r.dtype){const t=zV({inputs:{input:r},backend:s}),n=e({inputs:{x:t},backend:s}),i=JV({inputs:{input:r},backend:s}),a=YU({inputs:{x:i},backend:s}),o=rP({inputs:{real:n,imag:a},backend:s});return s.disposeIntermediateTensorInfo(t),s.disposeIntermediateTensorInfo(n),s.disposeIntermediateTensorInfo(i),s.disposeIntermediateTensorInfo(a),o}return fG({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:s})}};const eq={kernelName:ml,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s;if(1===t.length)return iG({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const i=t[0].shape,a=t[0].dtype;t.forEach((e=>{Oi(i,e.shape,"All tensors passed to stack must have matching shapes"),Ni(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=nW({inputs:t.map((e=>{const t=iG({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}};class tq{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s);this.userCode=1!==s?`\n ${r} start = ${r}(${i});\n ${r} end = ${r}(${a});\n\n void main() {\n ${r} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n }\n `:`\n int start = ${i};\n int end = ${a};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `}}class nq{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=SL("rc",s),l=SL("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h=[`${r} rc = outputLoc;`,`${o[s-1]} += 1;\n if(${u}) {\n `,1===s?"":`}\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {`,1===s?"":` ${o[s-1]} += 1;\n if(${u}) {`],d=1===s?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let e=0,t=1===s?2:4;e{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,constantValue:a}=s;if(0===Di(r.shape)){const e=i.map(((e,t)=>e[0]+r.shape[t]+e[1]));return fG({backend:n,attrs:{shape:e,value:a,dtype:r.dtype}})}const o=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new nq(r.shape,i,a):new tq(r.shape,i,a),l=[[a]];return n.runWebGLProgram(o,[r],r.dtype,l)},rq={kernelName:gl,backendName:"webgl",kernelFunc:sq},iq=fP({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n "+eP+"\n return result;\n"}),aq={kernelName:yl,backendName:"webgl",kernelFunc:iq};const oq={kernelName:wl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=[],u=Vi(i,r.shape);let c=u;const h=fm(c,o);let d,p=r;if(null!=h&&(p=RP({inputs:{x:r},backend:n,attrs:{perm:h}}),c=gm(c.length,o),l.push(p)),pm("prod",c,o),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:s,outDtype:r}=eL(p.shape,p.dtype,e,c);d=n.makeTensorInfo(s,r,t)}else{const[e,t]=hm(p.shape,c),s=Di(t),i=xP({inputs:{x:p},backend:n,attrs:{shape:[-1,s]}}),a=_P(i,Nc(r.dtype),"prod",n);d=xP({inputs:{x:a},backend:n,attrs:{shape:e}}),l.push(i),l.push(a)}if(a){l.push(d);const e=dm(d.shape,u);d=xP({inputs:{x:d},backend:n,attrs:{shape:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),d}};const lq={kernelName:vl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.readSync(e.dataId))),u=r.map((e=>e.shape)),c=n.readSync(i.dataId),h=n.readSync(a.dataId),[d,p,f]=tL(l,u,c,i.shape,i.dtype,h,a.shape,o),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}};const uq={kernelName:Al,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{starts:s,limits:r,deltas:i}=t,a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[u,c]=nL(a,s.shape,s.dtype,o,r.shape,l,i.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],s.dtype,c)]}};const cq={kernelName:xl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.readSync(r.dataId),c=n.readSync(i.dataId),h=n.readSync(a.dataId),d=o.map((e=>n.readSync(e.dataId))),p=o.map((e=>e.shape)),[f,m]=sL(u,r.shape,c,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}},hq=e=>{const{backend:t,attrs:n}=e,{start:s,stop:r,step:i,dtype:a}=n,o=rL(s,r,i,a);return t.makeTensorInfo([o.length],a,o)},dq={kernelName:Cl,backendName:"webgl",kernelFunc:hq},pq=pP({opSnippet:"return 1.0 / x;"}),fq={kernelName:Sl,backendName:"webgl",kernelFunc:pq},mq=pP({opSnippet:DL+"\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),gq={kernelName:_l,backendName:"webgl",kernelFunc:mq},yq=pP({opSnippet:DL+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),bq={kernelName:Rl,backendName:"webgl",kernelFunc:yq};class wq{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${a}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}}class vq{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${a}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}}const Aq={kernelName:Nl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,u]=o,c=ca().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new vq(r.shape,l,u,i,a):new wq(r.shape,l,u,i,a);return n.runWebGLProgram(c,[r],"float32")}};class xq{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${i}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${a}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${s-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const Cq={kernelName:Ol,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new xq(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class kq{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${a}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}}class Sq{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${a}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}}const _q={kernelName:Il,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,u]=o,c=ca().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Sq(r.shape,l,u,i,a):new kq(r.shape,l,u,i,a);return n.runWebGLProgram(c,[r],r.dtype)}};class Eq{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${i}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${a}) {\n continue;\n }\n\n float sourceFracRow =\n float(${o[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${o[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${s}) - 1),\n ${n} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${r}) - 1),\n ${n} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const Iq={kernelName:Tl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new Eq(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class Tq{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,1===n)return void(this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${e[0]} - coord - 1));\n }\n `);const s=e.map(((n,s)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(s))).join(","),r=sz(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}}class Nq{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;const s=SL("rc",n),r=`${s[n-1]} + 1 < ${this.outputShape[n-1]}`,i=`${s[n-2]} + 1 < ${this.outputShape[n-2]}`,a=sz(n);function o(n){const s=e.map(((s,r)=>function(n,s){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${s[n]} - 1`:`${s[n]}`}(r,n)));return`getChannel(getX(${s.join(",")}), vec2(${s.slice(-2).join(",")}))`}this.userCode=1===n?`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${e[0]} - rc - 1),\n ${e[0]} - rc - 1);\n if(${r}){\n result.g = getChannel(getX(${e[0]} - (rc + 1) - 1),\n ${e[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:`\n void main() {\n ${a} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(e){return o(e)}(s.slice())};\n if(${r}){\n result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",o(e)}(s.slice())};\n }\n if(${i}) {\n result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n if(${r}) {\n result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n }\n }\n setOutput(result);\n }\n `}}const Oq={kernelName:Dl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s,a=r.shape.length,o=Vi(i,r.shape);if(0===a)return nP({inputs:{x:r},backend:n});const l=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Nq(r.shape,o):new Tq(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}};class Rq{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],s=e[2];this.outputShape=e;let r="";r="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n vec3 fill = vec3(${t.join(",")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${r}\n if(coordX >= 0 && coordX < ${s} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const Dq={kernelName:Cu,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=new Rq(s.shape,i),[u,c]=vw(a,s.shape[1],s.shape[2]),h=[[u,c,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[s],s.dtype,h)}},Mq=pP({opSnippet:"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"}),Fq={kernelName:Ml,backendName:"webgl",kernelFunc:Mq},Bq=pP({opSnippet:"return inversesqrt(x);",cpuKernelImpl:iL}),zq={kernelName:Fl,backendName:"webgl",kernelFunc:Bq};class Lq{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=i;const l=sz(r.length),u=sz(i.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${e}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${t}; j++) {\n int index = round(${h});\n flattenedIndex += index * ${g};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${p};\n found = true;\n }\n }\n setOutput(mix(${m}, sum, float(found)));\n }\n `}}class Pq{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=i;const l=sz(r.length),u=sz(i.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides",y=t>1?"strides[j + 1]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${e}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${t}; j+=2) {\n ivec4 index = round(${h});\n flattenedIndex += index.xz * ${g};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${y};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${p};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${m}, sum, found));\n }\n `}}const Vq={kernelName:Bl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r,updates:i}=t,{shape:a}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Ey(0,r,a),d=[h/u,u];if(0===h)return n.makeTensorInfo(a,r.dtype);const p=xP({inputs:{x:r},backend:n,attrs:{shape:[l,o]}}),f=xP({inputs:{x:i},backend:n,attrs:{shape:[l,u]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=ca().getBool("WEBGL_PACK")?new Pq(l,o,p.shape.length,f.shape.length,c,d):new Lq(l,o,p.shape.length,f.shape.length,c,d);const y=n.runWebGLProgram(g,[f,p,m],f.dtype),b=xP({inputs:{x:y},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(m),b}};class Wq{constructor(e,t,n,s){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,n];const r=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,i=2===ca().getNumber("WEBGL_VERSION")?"while (left < right) {":r,a="left"===s?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${i}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${a} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}}const Gq={kernelName:Ll,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sortedSequence:r,values:i}=t,{side:a}=s,o=new Wq(r.shape[0],r.shape[1],i.shape[1],a),l=[[r.shape[1]]];return n.runWebGLProgram(o,[r,i],"int32",l)}};class Uq{constructor(e,t,n){let s,r;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)r="resRC",s="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],a=[];for(let s=0;s= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const qq={kernelName:Pl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:s,t:r,e:i}=t,a=new Uq(s.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(a,[s,r,i],Tc(r.dtype,i.dtype))}},jq=pP({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${Ew};\n float scale = ${Iw};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),Hq={kernelName:Vl,backendName:"webgl",kernelFunc:jq},$q=pP({opSnippet:dP+"\n return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:oL}),Kq={kernelName:jl,backendName:"webgl",kernelFunc:$q},Xq=pP({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),Zq={kernelName:ql,backendName:"webgl",kernelFunc:Xq},Yq=pP({opSnippet:dP+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${eP}\n return result;\n`}),Qq={kernelName:Gl,backendName:"webgl",kernelFunc:Yq},Jq=pP({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),ej={kernelName:Ul,backendName:"webgl",kernelFunc:Jq},tj=pP({opSnippet:"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"}),nj={kernelName:Hl,backendName:"webgl",kernelFunc:tj},sj={kernelName:Xl,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,paddings:a}=s;Ni(r.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=[[0,0]];l.push(...a);for(let e=1+i.length;en.disposeIntermediateTensorInfo(e))),g}};const rj={kernelName:Ql,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:s,values:r,denseShape:i,defaultValue:a}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${i.shape}`);if(2!==s.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${s.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==a.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${a.shape}`);const o=n.readSync(s.dataId),l=n.readSync(r.dataId),u=n.readSync(i.dataId),c=n.readSync(a.dataId)[0],[h,d,p,f,m]=cL(o,s.shape,s.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(d,s.dtype,h),n.makeTensorInfo([d[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map((e=>Number(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};const ij={kernelName:Jl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:s,inputShape:r,newShape:i}=t;if(2!==s.shape.length)throw new Error(`Input indices should be a matrix but received shape ${s.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(1!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const a=Array.from(n.readSync(r.dataId)),o=n.readSync(s.dataId),l=Array.from(n.readSync(i.dataId)),[u,c,h]=hL(o,s.shape,s.dtype,a,l);return[n.makeTensorInfo(c,s.dtype,u),n.makeTensorInfo([h.length],i.dtype,new Int32Array(h))]}};const aj={kernelName:eu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[u,c]=dL(a,s.shape,s.dtype,o,l,!0);return n.makeTensorInfo(c,s.dtype,u)}};const oj={kernelName:tu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[u,c]=dL(a,s.shape,s.dtype,o,l);return n.makeTensorInfo(c,s.dtype,u)}};const lj={kernelName:nu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sparseIndices:r,sparseValues:i,defaultValue:a}=t,{outputShape:o}=s,{sliceRank:l,numUpdates:u,sliceSize:c,strides:h,outputSize:d}=Ey(0,r,o),p=!1;if("string"===i.dtype){const e=n.bufferSync(r),t=n.bufferSync(i),s=nc(n.readSync(a.dataId)[0]),f=aL(e,t,o,d,c,u,l,h,s,p);return n.makeTensorInfo(o,f.dtype,f.values)}const f=new Lq(u,l,r.shape.length,i.shape.length,h,[d,1],p),m=n.runWebGLProgram(f,[i,r,a],i.dtype),g=xP({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),g}};const uj={kernelName:Zl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{numOrSizeSplits:i,axis:a}=s,o=Vi(a,r.shape)[0],l=Jw(r,i,o),u=r.shape.length,c=new Array(u).fill(0),h=r.shape.slice();return l.map((e=>{const t=[...h];t[o]=e;const s=TV({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[o]+=e,s}))}},cj="return sqrt(x);",hj=pP({opSnippet:cj,packedOpSnippet:cj,cpuKernelImpl:pL}),dj={kernelName:$l,backendName:"webgl",kernelFunc:hj},pj={kernelName:ru,backendName:"webgl",kernelFunc:pP({opSnippet:"return x * x;"})},fj="return (a - b) * (a - b);",mj=fP({opSnippet:fj,packedOpSnippet:fj}),gj={kernelName:su,backendName:"webgl",kernelFunc:mj};const yj={kernelName:iu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;if("string"!==r.dtype)throw new Error("Input must be of datatype string");const i=mv(n.readSync(r.dataId)),a=fL(i,"string",s);return n.makeTensorInfo(r.shape,"string",a)}};const bj={kernelName:Au,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:n}){const{x:s}=e,r=DL+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,i=new RL(s.shape,r);return n.runWebGLProgram(i,[s],s.dtype)}};class wj{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const s=n.length,r=sz(n.length),i=sz(n.length);let a="";if(1===s)a="coords * strides + begin";else{let e=0;a=n.map(((t,s)=>(e++,1===n.length?`coords * strides[${s}] + begin[${s}]`:`coords[${e-1}] * strides[${s}] + begin[${s}]`))).join(",")}this.userCode=`\n ${r} begin = ${r}(${e});\n ${r} strides = ${r}(${t});\n\n void main() {\n ${i} coords = getOutputCoords();\n setOutput(getX(${a}));\n }\n `}}const vj={kernelName:au,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,end:a,strides:o,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:h,shrinkAxisMask:d}=s,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:b,end:w,strides:v}=Pp(r.shape,i,a,o,l,u,c,h,d);let A;if(m)A=xP({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||y){Ni(r.shape.length>=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=_p(b,w,v),t=TV({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=xP({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=fd(r.shape,r.dtype,e),s=mL(p,t,v,b);A=n.makeTensorInfo(f,r.dtype,s.values)}else{const e=new wj(b,v,p);A=n.runWebGLProgram(e,[r],r.dtype)}}const x=xP({inputs:{x:A},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(A),x}};const Aj={kernelName:ou,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.readSync(c.dataId),p=n.readSync(h.dataId),[f,m]=gL(d,p,r,i,a,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};const xj={kernelName:lu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{skipEmpty:r}=s,{input:i,delimiter:a}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==a.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);const o=n.readSync(i.dataId),l=n.readSync(a.dataId)[0],[u,c,h]=yL(o,l,r),d=c.length;return[n.makeTensorInfo([d,2],"int32",u),n.makeTensorInfo([d],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(h))]}};const Cj={kernelName:uu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{numBuckets:r}=s,{input:i}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const a=n.readSync(i.dataId),o=bL(a,r);return n.makeTensorInfo(i.shape,"int32",o)}},kj=pP({opSnippet:"return tan(x);"}),Sj={kernelName:hu,backendName:"webgl",kernelFunc:kj},_j=pP({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),Ej={kernelName:du,backendName:"webgl",kernelFunc:_j};const Ij={kernelName:zl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{tensor:r,indices:i,updates:a}=t,{}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Ey(0,i,r.shape),d=[h/u,u];if(0===h)return n.makeTensorInfo(r.shape,i.dtype);const p=xP({inputs:{x:i},backend:n,attrs:{shape:[l,o]}}),f=xP({inputs:{x:a},backend:n,attrs:{shape:[l,u]}}),m=xP({inputs:{x:r},backend:n,attrs:{shape:d}}),g=new Lq(l,o,p.shape.length,f.shape.length,c,d,!1,!0),y=n.runWebGLProgram(g,[f,p,m],m.dtype),b=xP({inputs:{x:y},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),b}};class Tj{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let s=0;s5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],s=[];for(let t=0;t5){const e=n.readSync(r.dataId),t="string"===r.dtype?e.map((e=>nc(e))):e,s=fd(r.shape,r.dtype,t),a=vL(s,i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}const a=new Tj(r.shape,i);return n.runWebGLProgram(a,[r],r.dtype)}const Oj={kernelName:pu,backendName:"webgl",kernelFunc:Nj};class Rj{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "}}class Dj{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "}}function Mj(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function Fj(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,s]=AL(e,u,r.dtype,i,a);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(s.shape,s.dtype,s.values)]}if(0===i)return u[u.length-1]=0,[n.makeTensorInfo(u,r.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===c)return[r,fG({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const h=n.texData.get(r.dataId),d=null!==h&&h.isPacked,p=d?n.unpackTensor(r):r,f=Di(u)/c,m=xP({inputs:{x:p},attrs:{shape:[f,c]},backend:n});d&&Mj(n,p);const g=Fj(i),y=Fj(c);let b=null;const w=()=>null===b?[m,m]:[m,b],v=(e,t,s)=>{const r=w(),i=new Rj(s),a=[[c],[null===b?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],o=b;b=n.runWebGLProgram(i,r,"int32",a),Mj(n,o)};for(let e=1;e=1;n/=2)v(t,n,[f,y])}for(let e=y;e>g;e/=2){const t=w(),s=new Dj([f,e/2]),r=[[c],[null===b?1:0],[g]],i=b;b=n.runWebGLProgram(s,t,"int32",r),Mj(n,i);const a=g/2,o=2*a;for(let e=a;e>=1;e/=2)v(o,e,b.shape)}let A=b;b=TV({inputs:{x:b},backend:n,attrs:{begin:0,size:[f,i]}}),Mj(n,A);let x=DG({inputs:{x:m,indices:b},backend:n,attrs:{axis:1,batchDims:1}});Mj(n,m);const C=u.slice(0,-1);C.push(i),A=b,b=xP({inputs:{x:b},attrs:{shape:C},backend:n}),Mj(n,A);const k=x;return x=xP({inputs:{x},attrs:{shape:C},backend:n}),Mj(n,k),[x,b]}};class zj{constructor(e,t,n,s,r,i){this.variableNames=["Image","Transforms"],this.outputShape=i;const a="nearest"===n?1:2;let o;switch(s){case"constant":default:o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${o} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${r});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${r});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${t}));\n float mapY = mapCoord(inY, float(${e}));\n\n if (${a} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}}const Lj={kernelName:mu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,transforms:i}=t,{interpolation:a,fillMode:o,fillValue:l,outputShape:u}=s,[c,h,d,p]=r.shape,[f,m]=null!=u?u:[h,d],g=new zj(h,d,a,o,l,[c,f,m,p]);return n.runWebGLProgram(g,[r,i],"float32")}};const Pj={kernelName:yu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{axis:r}=n,{x:i}=t;LB(i,"unique");const a=s.readSync(i.dataId),{outputValues:o,outputShape:l,indices:u}=CL(a,r,i.shape,i.dtype);return[s.makeTensorInfo(l,i.dtype,o),s.makeTensorInfo([u.length],"int32",u)]}};const Vj={kernelName:bu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{value:r}=t;let{axis:i}=s;i<0&&(i+=r.shape.length);const a=r,o=a.shape.length,l=r.shape[i],u=new Array(o-1);let c=0;for(let e=0;en.disposeIntermediateTensorInfo(e))),f}};class Wj{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,s=e.batchSize,r=e.inSize,i=e.numSegments,a=i*Math.ceil(r/n);this.outputShape=[s,a];const o=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ";let c="";r%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `);let h="";r%n>0&&(h=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${h}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${i})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${i})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${o}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${o};\n if (${1===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}const Gj={kernelName:wu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,segmentIds:i}=t,{numSegments:a}=s,o=r.shape.length,l=[];let u=0;const c=fm([u],o);let h=r;null!=c&&(h=RP({inputs:{x:r},backend:n,attrs:{perm:c}}),l.push(h),u=gm(1,o)[0]);const d=pv(h.shape,u,a),p=Di([h.shape[u]]),f=xP({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=Nc(r.dtype),g=(e,t,s,r,i)=>{const a=e.shape[0],o=e.shape[1],u=dv(o,i),c=new Wj({windowSize:u,inSize:o,batchSize:a,numSegments:i},t),h=n.compileAndRun(c,[e,s],r);if(l.push(h),h.shape[1]===i)return h;const d=hq({backend:n,attrs:{start:0,stop:i,step:1,dtype:"float32"}}),p=Nj({inputs:{x:d},backend:n,attrs:{reps:[o/u]}});l.push(d),l.push(p);return g(h,t,p,r,i)},y=xP({inputs:{x:g(f,"unsortedSegmentSum",i,m,a)},backend:n,attrs:{shape:d}});let b=y;if(null!=c){l.push(y);const e=mm(c);b=RP({inputs:{x:b},backend:n,attrs:{perm:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),b}},Uj=[BP,LP,VP,GP,jP,KP,XP,ZP,nV,sV,iV,oV,uV,hV,pV,gV,yV,vV,AV,xV,SV,OV,RV,DV,MV,VV,UV,HV,iP,XV,sW,hW,gW,bW,wW,vW,AW,CW,SW,EW,DW,MW,FW,zW,VW,UW,qW,HW,KW,XW,YW,QW,eG,nG,rG,aG,uG,dG,mG,yG,vG,xG,SG,IG,TG,OG,MG,BG,LG,sP,PG,eW,WG,UG,jG,lP,$G,XG,ZG,QG,eU,nU,rU,aU,uU,hU,pU,mU,gU,yU,vU,AU,xU,CU,kU,_U,TU,OU,VU,AP,GU,qU,HU,KU,BV,ZU,JU,eq,rq,aq,hP,oq,lq,uq,cq,dq,LV,MU,fq,gq,bq,CP,Aq,Cq,_q,Iq,Oq,Dq,Fq,zq,Vq,Gq,qq,Hq,Kq,Zq,Qq,ej,NV,PU,nj,sj,rj,ij,aj,oj,lj,uj,dj,pj,gj,yj,bj,vj,Aj,xj,Cj,zU,OP,Sj,Ej,Ij,Oj,Bj,Lj,DP,Pj,Vj,Gj,QU];for(const e of Uj)Mu(e);__webpack_require__(9464);const qj={moveTickSize:50,videoContainerId:"webgazerVideoContainer",videoElementId:"webgazerVideoFeed",videoElementCanvasId:"webgazerVideoCanvas",faceOverlayId:"webgazerFaceOverlay",faceFeedbackBoxId:"webgazerFaceFeedbackBox",gazeDotId:"webgazerGazeDot",videoViewerWidth:320,videoViewerHeight:240,faceFeedbackBoxRatio:.66,showVideo:!0,mirrorVideo:!0,showFaceOverlay:!0,showFaceFeedbackBox:!0,showGazeDot:!0,camConstraints:{video:{width:{min:320,ideal:640,max:1920},height:{min:240,ideal:480,max:1080},facingMode:"user"}},dataTimestep:50,showVideoPreview:!0,applyKalmanFilter:!0,saveDataAcrossSessions:!0,storingPoints:!1,videoIsOn:!1,trackEye:"both"};__webpack_require__(6003);var jj=__webpack_require__(7350),Hj=__webpack_require__.n(jj),$j=__webpack_require__(8990),Kj=function(){return Kj=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]>>0)+"_",r=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(s+(n||"")+"_"+r++,n)}})),r("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a(t=t||0)&&(t=Math.max(t+s,0));t>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=u+a+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function F(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<6&192|o))}}(e,(function(e){s[r++]=e})),r!==n?s.subarray(0,r):s}function B(){if(!D){D={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));R[n]=s;for(var r=0;re.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function K(e){var t=e.h,n=t[e.g],s=127&n;if(128>n)return e.g+=1,$(e),s;if(s|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,$(e),s;if(s|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,$(e),s;if(s|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,$(e),s;if(n=t[e.g+4],e.g+=5,s|=(15&n)<<28,128>n)return $(e),s;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw q();return $(e),s}j.prototype.reset=function(){this.g=this.j};var X=[];function Z(){this.g=[]}function Y(e,t){for(;127>>=7;e.g.push(t)}function Q(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,X.length?(n=X.pop(),t&&(n.v=t.v),e&&H(n,e),e=n):e=new j(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function J(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=K(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw U(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function ee(e){switch(e.h){case 0:if(0!=e.h)ee(e);else e:{for(var t=(e=e.g).g,n=t+10;t>>0,(e=e.g).g+=t,$(e));break;case 5:(e=e.g).g+=4,$(e);break;case 3:for(t=e.i;;){if(!J(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}ee(e)}break;default:throw U(e.h,e.j)}}Z.prototype.length=function(){return this.g.length},Z.prototype.end=function(){var e=this.g;return this.g=[],e},Q.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var te=[];function ne(){this.i=[],this.h=0,this.g=new Z}function se(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var re="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ie(e,t){Object.isFrozen(e)||(re?e[re]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ae(e){var t;return null==(t=re?e[re]:e.N)?0:t}function oe(e){return ie(e,1),e}function le(e){return!!Array.isArray(e)&&!!(2&ae(e))}function ue(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ie(e,2)}function ce(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var he=Object.freeze(oe([]));function de(e){if(le(e.m))throw Error("Cannot mutate an immutable Message")}var pe,fe="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function me(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function ge(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,s){s=void 0!==s&&s,de(e),tte.length&&te.push(e)}}function tt(e,t,n){for(var s=n.length,r=1==s%2,i=r?1:0;i>>0)>>31)+1,s=r>>>23&255,r&=8388607,ye(t,n,255==s?r?NaN:1/0*e:0==s?e*Math.pow(2,-149)*r:e*Math.pow(2,s-150)*(r+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){Y(e.g,8*n+5),e=e.g;var s=t;0===(s=(n=0>s?1:0)?-s:s)?G=0<1/s?0:2147483648:isNaN(s)?G=2147483647:34028234663852886e22>>0:11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),G=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,G=(n<<31|t+127<<23|8388607&s)>>>0),n=G,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),it=st((function(e,t,n){if(0!==e.h)return!1;for(var s=e.g,r=128,i=0,a=e=0;4>a&&128<=r;a++)r=s.h[s.g++],$(s),i|=(127&r)<<7*a;if(128<=r&&(r=s.h[s.g++],$(s),i|=(127&r)<<28,e|=(127&r)>>4),128<=r)for(a=0;5>a&&128<=r;a++)r=s.h[s.g++],$(s),e|=(127&r)<<7*a+3;if(!(128>r))throw q();return s=i>>>0,(e=2147483648&(r=e>>>0))&&(r=~r>>>0,0==(s=1+~s>>>0)&&(r=r+1>>>0)),s=4294967296*r+(s>>>0),ye(t,n,e?-s:s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t){Y(e.g,8*n),e=e.g;var s=t;for(n=0>s,t=(s=Math.abs(s))>>>0,s=Math.floor((s-t)/4294967296),s>>>=0,n&&(s=~s>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++s&&(s=0))),n=G=t,t=s;0>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),at=st((function(e,t,n){return 0===e.h&&(ye(t,n,K(e.g)),!0)}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t)if(Y(e.g,8*n),e=e.g,0<=(n=t))Y(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ot=st((function(e,t,n){if(2!==e.h)return!1;var s,r=K(e.g)>>>0,i=(e=e.g).g;if(e.g+=r,$(e),e=e.h,N)(s=I)||(s=I=new TextDecoder("utf-8",{fatal:!0})),s=s.decode(e.subarray(i,i+r));else{r=i+r;for(var a,o,l,u=[],c=null;i(a=e[i++])?u.push(a):224>a?i>=r?_():(o=e[i++],194>a||128!=(192&o)?(i--,_()):u.push((31&a)<<6|63&o)):240>a?i>=r-1?_():128!=(192&(o=e[i++]))||224===a&&160>o||237===a&&160<=o||128!=(192&(s=e[i++]))?(i--,_()):u.push((15&a)<<12|(63&o)<<6|63&s):244>=a?i>=r-2?_():128!=(192&(o=e[i++]))||o-144+(a<<28)>>30||128!=(192&(s=e[i++]))||128!=(192&(l=e[i++]))?(i--,_()):(a=(7&a)<<18|(63&o)<<12|(63&s)<<6|63&l,a-=65536,u.push(55296+(a>>10&1023),56320+(1023&a))):_(),8192<=u.length&&(c=E(c,u),u.length=0);s=E(c,u)}return ye(t,n,s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){var s=!1;if(s=void 0!==s&&s,O){if(s&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(T||(T=new TextEncoder)).encode(t)}else{for(var r=0,i=new Uint8Array(3*t.length),a=0;ao)i[r++]=o;else{if(2048>o)i[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&a=l){o=1024*(o-55296)+l-56320+65536,i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=63&o|128;continue}a--}if(s)throw Error("Found an unpaired surrogate");o=65533}i[r++]=o>>12|224,i[r++]=o>>6&63|128}i[r++]=63&o|128}}t=i.subarray(0,r)}Y(e.g,8*n+2),Y(e.g,t.length),se(e,e.g.end()),se(e,t)}})),lt=st((function(e,t,n,s,r){if(2!==e.h)return!1;t=Ae(t,n,s),n=e.g.i,s=K(e.g)>>>0;var i=e.g.g+s,a=i-n;if(0>=a&&(e.g.i=i,r(t,e),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+s+" bytes, instead read "+(s-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.i=n,!0}),(function(e,t,n,s,r){if(null!=(t=ve(t,s,n)))for(s=0;s>>=7,a.h++;i.push(o),a.h++}}));function ut(){Ne.apply(this,arguments)}if(p(ut,Ne),fe){var ct={};Object.defineProperties(ut,(ct[Symbol.hasInstance]=me(Object[Symbol.hasInstance]),ct))}function ht(e){ut.call(this,e)}function dt(){return[1,at,2,rt,3,ot,4,ot]}function pt(e){ut.call(this,e,-1,mt)}function ft(){return[1,lt,ht,dt]}p(ht,ut),p(pt,ut),pt.prototype.addClassification=function(e,t){return Ae(this,1,ht,e,t),this};var mt=[1];function gt(e){ut.call(this,e)}function yt(){return[1,rt,2,rt,3,rt,4,rt,5,rt]}function bt(e){ut.call(this,e,-1,vt)}function wt(){return[1,lt,gt,yt]}p(gt,ut),p(bt,ut);var vt=[1];function At(e){ut.call(this,e)}function xt(){return[1,rt,2,rt,3,rt,4,rt,5,rt,6,it]}p(At,ut);var Ct=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],kt=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],St=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],_t=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Et=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],It=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Tt=[].concat(o(Ct),o(kt),o(St),o(_t),o(Et),o(It));function Nt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Ot(e){return ve(e,ht,1).map((function(e){return{index:xe(e,1),ga:we(e,2),label:null!=ge(e,3)?Ce(e,3):void 0,displayName:null!=ge(e,4)?Ce(e,4):void 0}}))}function Rt(e){return{x:we(e,1),y:we(e,2),z:we(e,3),visibility:null!=ge(e,4)?we(e,4):void 0}}function Dt(e,t){this.h=e,this.g=t,this.l=0}function Mt(e,t,n){return function(e,t){var n=e.g;if(void 0===e.o){var s=Nt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),r=Nt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),i=n.createProgram();if(n.attachShader(i,s),n.attachShader(i,r),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(i));s=e.o=i,n.useProgram(s),r=n.getUniformLocation(s,"sampler0"),e.j={K:n.getAttribLocation(s,"aVertex"),J:n.getAttribLocation(s,"aTex"),ma:r},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(r,0)}s=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(s.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(s.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(s.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(s.K),n.disableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Ft(e){this.g=e}var Bt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function zt(e,t){return t+e}function Lt(e,t){window[e]=t}function Pt(e){if(this.g=e,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=e&&e.locateFile||zt,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=t,e.options)for(var n=(t=a(Object.keys(e.options))).next();!n.done;n=t.next()){n=n.value;var s=e.options[n].default;void 0!==s&&(this.j[n]="function"==typeof s?s():s)}}function Vt(e,t){var n,s;return x((function(r){return t in e.H?r.return(e.H[t]):(n=e.locateFile(t,""),s=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=s,r.return(s))}))}function Wt(e,t,n){var s,r,i,o,l,u,c,h,d,p,f,m,g,b;return x((function(w){switch(w.g){case 1:if(!n)return w.return(t);for(s={},r=0,i=a(Object.keys(n)),o=i.next();!o.done;o=i.next())l=o.value,"string"!=typeof(u=n[l])&&"texture"===u.type&&void 0!==t[u.stream]&&++r;10&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0){var c=o===e.strides.length-1?1:wH(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(l*c)),i.push(e.interpolatedScaleAspectRatio)}}o++}for(var h=0;h0)p=e.featureMapHeight[n],f=e.featureMapWidth[n];else{var m=e.strides[n];p=Math.ceil(e.inputSizeHeight/m),f=Math.ceil(e.inputSizeWidth/m)}for(var g=0;g-1})),lh([s,r,i]),[2,o]}}))}))}function xH(e,t,n){return uH(this,void 0,void 0,(function(){var s,r,i,a,o;return cH(this,(function(l){switch(l.label){case 0:return s=e[0],r=e[1],i=function(e,t,n){return oh((function(){var s,r,i,a;n.reverseOutputOrder?(r=my(Af(e,[0,n.boxCoordOffset+0],[-1,1])),s=my(Af(e,[0,n.boxCoordOffset+1],[-1,1])),a=my(Af(e,[0,n.boxCoordOffset+2],[-1,1])),i=my(Af(e,[0,n.boxCoordOffset+3],[-1,1]))):(s=my(Af(e,[0,n.boxCoordOffset+0],[-1,1])),r=my(Af(e,[0,n.boxCoordOffset+1],[-1,1])),i=my(Af(e,[0,n.boxCoordOffset+2],[-1,1])),a=my(Af(e,[0,n.boxCoordOffset+3],[-1,1]))),r=bd(Ad(vd(r,n.xScale),t.w),t.x),s=bd(Ad(vd(s,n.yScale),t.h),t.y),n.applyExponentialOnBoxSize?(i=Ad(Cm(vd(i,n.hScale)),t.h),a=Ad(Cm(vd(a,n.wScale)),t.w)):(i=Ad(vd(i,n.hScale),t.h),a=Ad(vd(a,n.wScale),t.h));var o=zd(s,vd(i,2)),l=zd(r,vd(a,2)),u=bd(s,vd(i,2)),c=bd(r,vd(a,2)),h=bf([mf(o,[n.numBoxes,1]),mf(l,[n.numBoxes,1]),mf(u,[n.numBoxes,1]),mf(c,[n.numBoxes,1])],1);if(n.numKeypoints)for(var d=0;d0)for((c=l.locationData).relativeKeypoints=[],h=n.numKeypoints*n.numValuesPerKeypoint,d=0;dl?(i=e.width,a=e.width*o,c=(1-l/o)/2):(i=e.height/o,a=e.height,u=(1-o/l)/2),e.width=i,e.height=a,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,i=e.height,a=Math.cos(e.rotation),o=Math.sin(e.rotation),l=e.xCenter,u=e.yCenter,c=1/t,h=1/n,d=new Array(16);return d[0]=r*a*1*c,d[1]=-i*o*c,d[2]=0,d[3]=(-.5*r*a*1+.5*i*o+l)*c,d[4]=r*o*1*h,d[5]=i*a*h,d[6]=0,d[7]=(-.5*i*a-.5*r*o*1+u)*h,d[8]=0,d[9]=0,d[10]=r*c,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(d)}(l,o.width,o.height),h=oh((function(){var t=gH(e),n=Ay(function(e,t,n){return yH(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=sw.transform(km(md(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return oh((function(){return bd(Ad(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}(n,this.imageToTensorConfig),r=s.imageTensor,i=s.transformationMatrix,a=this.detectorModel.execute(r,"Identity:0"),o=function(e){return oh((function(){var t=function(e){return oh((function(){return[Af(e,[0,0,0],[1,-1,1]),Af(e,[0,0,1],[1,-1,-1])]}))}(e),n=t[0],s=t[1];return{boxes:my(s),logits:my(n)}}))}(a),l=o.boxes,[4,xH([u=o.logits,l],this.anchorTensor,this.tensorsToDetectionConfig)]);case 1:return 0===(c=p.sent()).length?(lh([n,r,a,u,l]),[2,c]):[4,AH(c,this.maxFaces,.3)];case 2:return h=p.sent(),d=function(e,t){void 0===e&&(e=[]);var n,s=(n=t,[].concat.apply([],n));return e.forEach((function(e){var t=e.locationData;t.relativeKeypoints.forEach((function(e){var t=vH(s,[e.x,e.y]),n=t[0],r=t[1];e.x=n,e.y=r}));var n=t.relativeBoundingBox,r=Number.MAX_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,o=Number.MIN_VALUE;[[n.xMin,n.yMin],[n.xMin+n.width,n.yMin],[n.xMin+n.width,n.yMin+n.height],[n.xMin,n.yMin+n.height]].forEach((function(e){var t=vH(s,e),n=t[0],l=t[1];r=Math.min(r,n),a=Math.max(a,n),i=Math.min(i,l),o=Math.max(o,l)})),t.relativeBoundingBox={xMin:r,xMax:a,yMin:i,yMax:o,width:a-r,height:o-i}})),e}(h,i),lh([n,r,a,u,l]),[2,d]}}))}))},e.prototype.estimateFaces=function(e,t){return uH(this,void 0,void 0,(function(){var n,s;return cH(this,(function(r){return n=mH(e),s=!!t&&t.flipHorizontal,[2,this.detectFaces(e,s).then((function(e){return e.map((function(e){for(var t=e.locationData.relativeKeypoints.map((function(e,t){return lH(lH({},e),{x:e.x*n.width,y:e.y*n.height,name:hH[t]})})),s=e.locationData.relativeBoundingBox,r=0,i=["width","xMax","xMin"];r-1,[4,HI(t.detectorModelUrl,{fromTFHub:n})];case 1:return s=r.sent(),[2,new DH(t.modelType,s,t.maxFaces)]}}))}))}function FH(e,t){return uH(this,void 0,void 0,(function(){var n,s;return cH(this,(function(r){if(e===SH.MediaPipeFaceDetector){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,MH(n)];if("mediapipe"===n.runtime)return[2,fH(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}function BH(e){return e.width*e.height}function zH(e){var t=e.xCenter-e.width/2,n=t+e.width,s=e.yCenter-e.height/2;return{xMin:t,xMax:n,yMin:s,yMax:s+e.height,width:e.width,height:e.height}}function LH(e){return e instanceof vc?{height:e.shape[0],width:e.shape[1]}:{height:e.height,width:e.width}}function PH(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function VH(e){return e instanceof vc?e:Ap(e)}function WH(e,t){Ni(0!==e.width,(function(){return t+" width cannot be 0."})),Ni(0!==e.height,(function(){return t+" height cannot be 0."}))}function GH(e,t,n){var s=t.outputTensorSize,r=t.keepAspectRatio,i=t.borderMode,a=t.outputTensorFloatRange,o=LH(e),l=function(e,t){return t?{xCenter:t.xCenter*e.width,yCenter:t.yCenter*e.height,width:t.width*e.width,height:t.height*e.height,rotation:t.rotation}:{xCenter:.5*e.width,yCenter:.5*e.height,width:e.width,height:e.height,rotation:0}}(o,n),u=function(e,t,n){if(void 0===n&&(n=!1),!n)return{top:0,left:0,right:0,bottom:0};var s=t.height,r=t.width;WH(t,"targetSize"),WH(e,"roi");var i,a,o=s/r,l=e.height/e.width,u=0,c=0;return o>l?(i=e.width,a=e.width*o,c=(1-l/o)/2):(i=e.height/o,a=e.height,u=(1-o/l)/2),e.width=i,e.height=a,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,i=e.height,a=s?-1:1,o=Math.cos(e.rotation),l=Math.sin(e.rotation),u=e.xCenter,c=e.yCenter,h=1/t,d=1/n,p=new Array(16);return p[0]=r*o*a*h,p[1]=-i*l*h,p[2]=0,p[3]=(-.5*r*o*a+.5*i*l+u)*h,p[4]=r*l*a*d,p[5]=i*o*d,p[6]=0,p[7]=(-.5*i*o-.5*r*l*a+c)*d,p[8]=0,p[9]=0,p[10]=r*h,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(p)}(l,o.width,o.height,!1),h=oh((function(){var t=VH(e),n=Ay(function(e,t,n){return WH(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=sw.transform(km(md(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return oh((function(){return bd(Ad(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}function UH(e){return{xCenter:e.xMin+e.width/2,yCenter:e.yMin+e.height/2,width:e.width,height:e.height}}function qH(e){var t=e.relativeKeypoints;if(t.length<=1)throw new Error("2 or more keypoints required to calculate a rect.");var n=Number.MAX_VALUE,s=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MIN_VALUE;return t.forEach((function(e){n=Math.min(n,e.x),r=Math.max(r,e.x),s=Math.min(s,e.y),i=Math.max(i,e.y)})),{xCenter:(n+r)/2,yCenter:(s+i)/2,width:r-n,height:i-s}}function jH(e,t,n,s,r){var i="rect"===n?function(e,t,n){var s,r=e.locationData;if("boundingbox"===t)s=UH(r.boundingBox);else{s=qH(r);var i=n.width,a=n.height;s.xCenter=Math.round(s.xCenter*i),s.yCenter=Math.round(s.yCenter*a),s.width=Math.round(s.width*i),s.height=Math.round(s.height*a)}return s}(e,t,s):function(e,t){var n=e.locationData;return"boundingbox"===t?UH(n.relativeBoundingBox):qH(n)}(e,t);return r&&(i.rotation=function(e,t,n){var s,r=e.locationData,i=n.rotationVectorStartKeypointIndex,a=n.rotationVectorEndKeypointIndex;s=n.rotationVectorTargetAngle?n.rotationVectorTargetAngle:Math.PI*n.rotationVectorTargetAngleDegree/180;var o=r.relativeKeypoints[i].x*t.width,l=r.relativeKeypoints[i].y*t.height,u=r.relativeKeypoints[a].x*t.width,c=r.relativeKeypoints[a].y*t.height;return PH(s-Math.atan2(-(c-l),u-o))}(e,s,r)),i}function HH(e,t,n){for(var s=0;s1&&(h.y=s?t.inputImageHeight-a[u+1]:a[u+1]),i>2&&(h.z=a[u+2]),i>3&&(h.score=ZH(t.visibilityActivation,a[u+3])),o.push(h);for(c=0;c0?r/i:0}(e,t)<=.5}))).push(e)}))})),l=y,[4,Promise.all(l.map((function(e){return m.faceLandmark(e,r)})))];case 4:for(u=g.sent(),c=[],this.prevFaceRectsFromLandmarks=[],h=0;h-1,[4,HI(t.landmarkModelUrl,{fromTFHub:n})];case 1:return s=i.sent(),[4,FH(SH.MediaPipeFaceDetector,{modelType:"short",maxFaces:t.maxFaces,detectorModelUrl:t.detectorModelUrl,runtime:t.runtime})];case 2:return r=i.sent(),[2,new f$(r,s,t.maxFaces,t.refineLandmarks)]}}))}))}(JH||(JH={})).MediaPipeFaceMesh="MediaPipeFaceMesh";Object.freeze({__proto__:null,getKeypointIndexByContour:function(e){if(e===JH.MediaPipeFaceMesh)return Qj;throw new Error("Model "+e+" is not supported.")},getAdjacentPairs:function(e){if(e===JH.MediaPipeFaceMesh)return Jj;throw new Error("Model "+e+" is not supported.")}});const g$=(e,t,n,s)=>1===s?.5*(e+t):e+(t-e)*n/(s-1),y$={applyExponentialOnBoxSize:!1,flipVertically:!1,ignoreClasses:[],numClasses:1,numBoxes:2304,numCoords:16,boxCoordOffset:0,keypointCoordOffset:4,numKeypoints:6,numValuesPerKeypoint:2,sigmoidScore:!0,scoreClippingThresh:100,reverseOutputOrder:!0,xScale:192,yScale:192,hScale:192,wScale:192,minScoreThresh:.6},b$={reduceBoxesInLowestLayer:!1,interpolatedScaleAspectRatio:0,featureMapHeight:[],featureMapWidth:[],numLayers:1,minScale:.1484375,maxScale:.75,inputSizeHeight:192,inputSizeWidth:192,anchorOffsetX:.5,anchorOffsetY:.5,strides:[4],aspectRatios:[1],fixedAnchorSize:!0},w$={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},v$=e=>{e.detector.imageToTensorConfig=w$,e.detector.tensorsToDetectionConfig=y$,e.detector.anchors=(e=>{null===e.reduceBoxesInLowestLayer&&(e.reduceBoxesInLowestLayer=!1),null===e.interpolatedScaleAspectRatio&&(e.interpolatedScaleAspectRatio=1),null===e.fixedAnchorSize&&(e.fixedAnchorSize=!1);const t=[];let n=0;for(;n0){const n=o===e.strides.length-1?1:g$(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(t*n)),i.push(e.interpolatedScaleAspectRatio)}}o++}for(let e=0;e0)l=e.featureMapHeight[n],u=e.featureMapWidth[n];else{const t=e.strides[n];l=Math.ceil(e.inputSizeHeight/t),u=Math.ceil(e.inputSizeWidth/t)}for(let n=0;ne.width))),n=vy(e.detector.anchors.map((e=>e.height))),s=vy(e.detector.anchors.map((e=>e.xCenter))),r=vy(e.detector.anchors.map((e=>e.yCenter)));e.detector.anchorTensor={x:s,y:r,w:t,h:n}},A$=function(){this.model=function(e,t){return Xj(this,void 0,void 0,(function(){var n,s;return Zj(this,(function(r){if(e===JH.MediaPipeFaceMesh){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,m$(n)];if("mediapipe"===n.runtime)return[2,iH(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}(JH.MediaPipeFaceMesh,{runtime:"tfjs",detectorModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/face_detection/full/1"}),this.predictionReady=!1,this.modelLoaded=!1},x$={current:!1,resolves:[]};A$.prototype.loadModel=async function(){if(!this.modelLoaded){if(x$.current){const e=new Promise((e=>{x$.resolves.push(e)}));return await e}x$.current=!0;try{this.model=await this.model,v$(this.model),this.modelLoaded=!0,x$.resolves.forEach((e=>e()))}finally{x$.current=!1,x$.resolves=[]}}},A$.prototype.positionsArray=null,A$.prototype.getEyePatches=async function(e,t,n,s){if(0===t.width)return null;const r=this.model,i=await r.estimateFaces(t,{flipHorizontal:!1});if(0===i.length)return!1;this.positionsArray=i[0].keypoints;const a=i[0],[o,l]=[{eyeTopArc:[466,388,387,386,385,384,398].map((e=>a.keypoints[e])),eyeBottomArc:[263,249,390,373,374,380,381,382,362].map((e=>a.keypoints[e]))},{eyeTopArc:[246,161,160,159,158,157,173].map((e=>a.keypoints[e])),eyeBottomArc:[33,7,163,144,145,153,154,155,133].map((e=>a.keypoints[e]))}].map((({eyeTopArc:e,eyeBottomArc:t})=>{const n={x:Math.round(Math.min(...e.map((e=>e.x)))),y:Math.round(Math.min(...e.map((e=>e.y))))},s=Math.round(Math.max(...t.map((e=>e.x)))),r=Math.round(Math.max(...t.map((e=>e.y))));return{origin:n,width:s-n.x,height:r-n.y}}));var u=o.origin.x,c=o.origin.y,h=o.width,d=o.height,p=l.origin.x,f=l.origin.y,m=l.width,g=l.height;if(0===h||0===m)return null;if(0===d||0===g)return null;var y={},b=t.getContext("2d").getImageData(u,c,h,d);y.left={patch:b,imagex:u,imagey:c,width:h,height:d};var w=t.getContext("2d").getImageData(p,f,m,g);return y.right={patch:w,imagex:p,imagey:f,width:m,height:g},this.predictionReady=!0,y},A$.prototype.getPositions=function(){return this.positionsArray},A$.prototype.reset=function(){},A$.prototype.drawFaceOverlay=function(e,t){if(t){e.fillStyle="#32EEDB",e.strokeStyle="#32EEDB",e.lineWidth=.5;for(let n=0;nn?n:e}k$.Eye=function(e,t,n,s,r){this.patch=e,this.imagex=t,this.imagey=n,this.width=s,this.height=r},k$.getEyeFeats=function(e){var t=this.resizeEye(e.left,10,6),n=this.resizeEye(e.right,10,6),s=this.grayscale(t.data,t.width,t.height),r=this.grayscale(n.data,n.width,n.height),i=[];this.equalizeHistogram(s,5,i);var a=[];return this.equalizeHistogram(r,5,a),i.concat(a)},k$.DataWindow=function(e,t){this.data=[],this.windowSize=e,this.index=0,this.length=0,t&&(this.data=t.slice(t.length-e,t.length),this.length=this.data.length)},k$.DataWindow.prototype.push=function(e){return this.data.length>2),r=0,i=0,a=0;at?255:0;return e},k$.correlation=function(e,t){const n=Math.min(e.length,t.length);let s=0;for(let r=0;rE$(e,t,((e,t)=>e+t)),sub:(e,t)=>E$(e,t,((e,t)=>e-t)),inv:e=>I$.solve(e,I$.identity(e.length,e[0].length)),identity(e,t=e){const n=new Array(e);for(let s=0;se.length===e[0].length?I$.LUDecomposition(e,t):I$.QRDecomposition(e,t),LUDecomposition(e,t){for(var n=new Array(e.length),s=0;sMath.abs(c[f])&&(f=s);if(f!=r){for(p=0;p=0;p--){for(r=0;r=0;u--){for(r=0;r=0;n--){var s=this.screenXTrailArray.get(n),r=this.screenYTrailArray.get(n);if(Math.sqrt(Math.pow(s-e,2)+Math.pow(r-t,2))>72)return n+1}return n},N$.addData=function(e,t,n){e&&("click"===n?(this.screenXClicksArray.push([t[0]]),this.screenYClicksArray.push([t[1]]),this.eyeFeaturesClicks.push(_$.getEyeFeats(e)),this.dataClicks.push({eyes:e,screenPos:t,type:n})):"move"===n&&(this.screenXTrailArray.push([t[0]]),this.screenYTrailArray.push([t[1]]),this.eyeFeaturesTrail.push(_$.getEyeFeats(e)),this.trailTimes.push(performance.now()),this.dataTrail.push({eyes:e,screenPos:t,type:n})))};const O$=N$,R$={RidgeReg:function(){this.init()}};R$.RidgeReg.prototype.init=O$.InitRegression,R$.RidgeReg.prototype.addData=O$.addData,R$.RidgeReg.prototype.predict=function(e){if(!e||0===this.eyeFeaturesClicks.length)return null;for(var t=performance.now()-this.trailTime,n=[],s=[],r=[],i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.screenXClicksArray.data.concat(n),o=this.screenYClicksArray.data.concat(s),l=this.eyeFeaturesClicks.data.concat(r),u=O$.ridge(a,l,this.ridgeParameter),c=O$.ridge(o,l,this.ridgeParameter),h=_$.getEyeFeats(e),d=0;for(i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.eyeFeaturesClicks.data.length,o=Array(a),l=Array(a),u=Array(a);for(i=0;isetTimeout(t,e)))}function W$(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const G$={tracker:{}};G$.tracker.TFFaceMesh=C$,G$.reg=D$,G$.reg.RidgeWeightedReg=F$.RidgeWeightedReg,G$.reg.RidgeRegThreaded=P$.RidgeRegThreaded,G$.util=_$,G$.params=qj;var U$=null,q$=null,j$=null,H$=null,$$=null,K$=null,X$=null,Z$=!1,Y$=new Array(50),Q$=new Array(50),J$=(performance.now(),null),eK=null;G$.params.paused=!1,G$.params.greedyLearner=!1,G$.params.framerate=60,G$.params.showGazeDot=!1,G$.params.getLatestVideoFrameTimestamp=()=>{},G$.params.activeCamera={label:"",id:""};let tK=[];var nK=function(e){},sK=nK,rK=["click","move"],iK=performance.now(),aK=new G$.tracker.TFFaceMesh,oK=[new G$.reg.RidgeReg],lK={TFFacemesh:function(){return new G$.tracker.TFFaceMesh}},uK={ridge:function(){return new G$.reg.RidgeReg},weightedRidge:function(){return new G$.reg.RidgeWeightedReg},threadedRidge:function(){return new G$.reg.RidgeRegThreaded}},cK="webgazerGlobalData",hK="webgazerGlobalSettings",dK={},pK=[];let fK,mK,gK,yK,bK,wK,vK,AK,xK,CK,kK,SK;G$.computeValidationBoxSize=function(){var e=j$.videoWidth,t=j$.videoHeight,n=parseInt(j$.style.width),s=parseInt(j$.style.height),r=Math.min(e,t),i=e==Math.max(e,t)?n/e:s/t,a=r*G$.params.faceFeedbackBoxRatio*i;return[(s-a)/2,(n-a)/2,a,a]};let _K=!1,EK=!1;function IK(){null!==K$&&J$?(_K||EK||(EK=!0,setTimeout((()=>{fK=j$.videoWidth,mK=j$.videoHeight,gK=Math.min(fK,mK),yK=gK*G$.params.faceFeedbackBoxRatio,bK=(mK-yK)/2,wK=(fK-yK)/2,vK=wK+yK,AK=bK+yK,_K=!0,EK=!1}),500)),xK=fK-J$.left.imagex,kK=fK-J$.right.imagex,CK=J$.left.imagey,SK=J$.right.imagey,K$.style.border=_K&&xK>wK&&xKwK&&kKbK&&CKbK&&SK=1e3/G$.params.framerate&&(FK=MK,eK=OK(),eK=await eK,sK(eK),BK=!0,eK)){RK.push(eK);var e=0,t=0,n=RK.length;for(var s in RK.data)e+=RK.get(s).x,t+=RK.get(s).y;var r=_$.bound({x:e/n,y:t/n});G$.params.storingPoints&&(G$.storePoints(r.x,r.y,DK),50==++DK&&(DK=0)),X$.style.opacity="",X$.style.left=`${r.x}px`,X$.style.top=`${r.y}px`}requestAnimationFrame(LK)}var PK=function(e,t,n){if(!G$.params.paused){if(0===oK.length)return null;for(var s in oK)J$&&oK[s].addData(J$,[e,t],n)}},VK=async function(e){PK(e.clientX,e.clientY,rK[0]),G$.params.saveDataAcrossSessions&&await async function(){var e=oK[0].getData()||pK;Hj().setItem(hK,dK),Hj().setItem(cK,e)}()},WK=function(e){if(!G$.params.paused){var t=performance.now();tG$.params.activeCamera.id?{video:{...e.video,deviceId:G$.params.activeCamera.id}}:e;function HK(e){navigator.vendor&&navigator.vendor.indexOf("Apple")>-1?(e.style.opacity=G$.params.showVideo?"1":"0",e.style.display="block"):e.style.display=G$.params.showVideo?"block":"none"}G$._begin=function(e,t){if(!G$.params.videoIsOn)return void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(e){var t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise((function(n,s){t.call(navigator,e,n,s)})):Promise.reject(new Error("Unfortunately, your browser does not support access to the webcam through the getUserMedia API. Try to use the latest version of Google Chrome, Mozilla Firefox, Opera, or Microsoft Edge instead."))}),new Promise((async(n,s)=>{let r;try{if(void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.enumerateDevices){const s=await navigator.mediaDevices.enumerateDevices();if((e=>{let t,n;tK=[],e.forEach((e=>{"videoinput"===e.kind&&tK.push(e),e.label.includes("FaceTime")&&(t=e.label,n=e.deviceId)})),tK.length&&(G$.params.activeCamera.label=t||tK[0].label,G$.params.activeCamera.id=n||tK[0].deviceId)})(s),0===tK.length)throw t(tK),JSON.stringify({message:"We can't find any video input devices.",devices:s});try{r=await navigator.mediaDevices.getUserMedia(jK(G$.params.camConstraints))}catch(e){throw t(tK),e}qK(e?"video":"all",r).then((()=>{tK.length>1&&(e=>{const t=q$,n=document.createElement("select");n.className=n.id="webgazer-videoinput-select",n.name="videoinput",e.forEach(((e,t)=>{var s;n.innerHTML+=``})),n.onchange=e=>{const[t,s]=n.value.split("%");G$.params.activeCamera.label=s,G$.params.activeCamera.id=t,G$.setCameraConstraints(jK(G$.params.camConstraints))},t.appendChild(n)})(tK)})),G$.params.videoIsOn=!0,e||n(G$)}else t([])}catch(e){throw j$=null,r=null,t([]),s(e),JSON.stringify({error:e,devices:await navigator.mediaDevices.enumerateDevices()})}}));qK("gaze")},G$.isReady=function(){return null!==H$&&H$.width>0},G$.pause=function(){return G$.params.paused=!0,G$},G$.stopLearning=function(e){return UK(e),G$},G$.startLearning=function(e){return GK(e),G$},G$.resume=async function(){return G$.params.paused?(G$.params.paused=!1,BK=!0,$K.current&&(clearInterval($K.current),$K.current=void 0,Z$=!1,X$.style.backgroundColor="",X$.style.opacity=""),await LK(),G$):G$},G$.end=function(e=!1){return e&&(RK=new _$.DataWindow(4),DK=0,MK=null,FK=-1,_K=!1,G$.params.videoIsOn=!1,setTimeout((()=>{G$.stopVideo(),q$.remove()}),500)),G$},G$.stopVideo=function(){return U$.getTracks()[0].stop(),G$},G$.detectCompatibility=function(){return void 0!==(navigator.mediaDevices.getUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia)},G$.showVideoPreview=function(e){return G$.params.showVideoPreview=e,G$.showVideo(e&&G$.params.showVideo),G$.showFaceOverlay(e&&G$.params.showFaceOverlay),G$.showFaceFeedbackBox(e&&G$.params.showFaceFeedbackBox),G$},G$.showVideo=function(e,t=.8){return G$.params.showVideo=e,j$&&HK(j$),q$&&HK(q$),G$},G$.showFaceOverlay=function(e){return G$.params.showFaceOverlay=e,$$&&($$.style.display=e?"block":"none"),G$},G$.showFaceFeedbackBox=function(e){return G$.params.showFaceFeedbackBox=e,K$&&(K$.style.display=e?"block":"none"),G$},G$.showPredictionPoints=function(e){return G$.params.showGazeDot=e,X$&&(X$.style.display=e?"block":"none"),G$};const $K={current:void 0};function KK(e,t){H$&&(H$.width=e,H$.height=t),$$&&($$.width=e,$$.height=t)}G$.popPredictionPoints=function(){return $K.current&&(clearInterval($K.current),$K.current=void 0,Z$=!1),X$&&G$.params.showGazeDot&&(Z$=!0,X$.style.backgroundColor="red",X$.style.opacity=1,$K.current=setInterval((()=>{X$.style.opacity-=.02,X$.style.opacity<=.02&&(clearInterval($K.current),$K.current=void 0,Z$=!1,X$.style.backgroundColor="",X$.style.opacity="")}),50)),G$},G$.saveDataAcrossSessions=function(e){return G$.params.saveDataAcrossSessions=e,G$},G$.applyKalmanFilter=function(e){return G$.params.applyKalmanFilter=e,G$},G$.setCameraConstraints=async function(e){if(G$.params.camConstraints=e,U$){G$.pause();try{U$.getVideoTracks().forEach((e=>{e.stop()}));const e=await navigator.mediaDevices.getUserMedia(G$.params.camConstraints);setTimeout((()=>{const t=e.getVideoTracks()[0].getSettings();U$=e,j$.srcObject=e,KK(t.width,t.height)}),1500)}catch(e){return}await G$.resume()}},G$.setStaticVideo=function(e){return e,G$},G$.setVideoViewerSize=function(e,t){G$.params.videoViewerWidth=e,G$.params.videoViewerHeight=t,j$.style.width=e+"px",j$.style.height=t+"px",q$.style.width=e+"px",q$.style.height=t+"px",$$.style.width=e+"px",$$.style.height=t+"px";var n=G$.computeValidationBoxSize();K$.style.top=n[0]+"px",K$.style.left=n[1]+"px",K$.style.width=n[2]+"px",K$.style.height=n[3]+"px"},G$.addMouseEventListeners=function(){return GK(),G$},G$.removeMouseEventListeners=function(){return UK(),G$},G$.recordScreenPosition=function(e,t,n){return PK(e,t,n||rK[0]),G$},G$.storePoints=function(e,t,n){Y$[n]=e,Q$[n]=t},G$.setTracker=function(e){if(void 0===lK[e]){for(var t in lK);return G$}return aK=lK[e](),G$},G$.setRegression=function(e){if(void 0===uK[e]){for(var t in uK);return G$}return pK=oK[0].getData(),(oK=[uK[e]()])[0].setData(pK),G$},G$.addTrackerModule=function(e,t){lK[e]=function(){return new t}},G$.addRegressionModule=function(e,t){uK[e]=function(){return new t}},G$.addRegression=function(e){var t=uK[e]();return pK=oK[0].getData(),t.setData(pK),oK.push(t),G$},G$.setGazeListener=function(e){return sK=e,G$},G$.clearGazeListener=function(){return sK=nK,G$},G$.setVideoElementCanvas=function(e){return H$=e},G$.clearData=async function(){!function(){for(var e in Hj().clear(),oK)oK[e].init()}()},G$.getTracker=function(){return aK},G$.getRegression=function(){return oK},G$.getCurrentPrediction=async function(e=0,t=150,n=5){let s=0;const r=[],i=[];for(let e=0;et.x>=0&&t.x<=window.innerWidth?e+t.x:e),0)/i.length),l=Math.round(i.reduce(((e,t)=>t.y>=0&&t.y<=window.innerHeight?e+t.y:e),0)/i.length);return X$&&(X$.style.left=`${o}px`,X$.style.top=`${l}px`),{x:o,y:l,raw:i.map((e=>({x:W$(e.x,0),y:W$(e.y,0)})))}},G$.params.getEventTypes=function(){return rK.slice()},G$.getVideoElementCanvas=function(){return H$},G$.getVideoPreviewToCameraResolutionRatio=function(){return[G$.params.videoViewerWidth/j$.videoWidth,G$.params.videoViewerHeight/j$.videoHeight]},G$.getStoredPoints=function(){return[Y$,Q$]};const XK=G$;class ZK{constructor(e){this.calibrator=e,this.webgazer=XK,this.defaultGazeCallback=null,this.defaultDistanceTrackCallback=null,this._initialized={distance:!1,gaze:!1},this._learning=!0,this._running={distance:!1,gaze:!1},this._runningVideo=!1,this._toFixedN=1}begin({pipWidthPx:e},t){this.checkInitialized("gaze",!0)&&(this._running.gaze||(this.webgazer.begin(this.videoFailed.bind(this)),this._running.gaze=!0,this._runningVideo=!0),br(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}beginVideo({pipWidthPx:e},t){this.checkInitialized("distance",!0)&&(this._runningVideo||(this.webgazer.beginVideo(this.videoFailed.bind(this)),this._runningVideo=!0),br(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}videoFailed(e){const t=qs(this.calibrator,{showIcon:!0});zs.fire({...t,icon:"error",iconColor:this.calibrator._CONST.COLOR.DARK_RED,showConfirmButton:!1,html:e.length?G.H.RC_errorCameraUseDenied[this.calibrator.L]:G.H.RC_errorNoCamera[this.calibrator.L]})}attachNewCallback(e){this.checkInitialized("gaze",!0)&&this.webgazer.setGazeListener((t=>{if(t){const n=this.getData(t);this.calibrator.newGazePositionData=n,(0,E.nB)(e,n)}}))}async getGazeNow(e={},t=void 0){const n=Object.assign({wait:0,frames:5},e),s=this.getData(await this.webgazer.getCurrentPrediction(0,n.wait,n.frames));return this.calibrator.newGazePositionData=s,this.webgazer.popPredictionPoints(),(0,E.nB)(t,s),s}end(){this.webgazer.end()}}ZK.prototype._init=function({greedyLearner:e,framerate:t,toFixedN:n,showVideo:s,showFaceOverlay:r,showGazer:i},a){this.checkInitialized(a)||("gaze"===a&&(this.webgazer.params.greedyLearner=e,this.webgazer.params.framerate=t,this.webgazer.params.getLatestVideoFrameTimestamp=this._getLatestVideoTimestamp.bind(this),this.showGazer(i)),this._toFixedN=n,this.showVideo(s),this.showFaceOverlay(r),this._initialized[a]=!0)},ZK.prototype.checkInitialized=function(e,t=!1){return!!(""===e?this._initialized.gaze||this._initialized.distance:this._initialized[e])},ZK.prototype.getData=function(e){const t=performance.now();return{value:{x:(0,E.Nh)(e.x,this._toFixedN),y:(0,E.Nh)(e.y,this._toFixedN),latencyMs:t-this.calibrator._trackingVideoFrameTimestamps.gaze},timestamp:t,raw:e.raw?e.raw:void 0}},ZK.prototype.pause=function(){this.webgazer.pause()},ZK.prototype.resume=function(){this.webgazer.resume()},ZK.prototype.end=function(e,t=!1){if(!this.checkInitialized(e,!0))return;const n=t||!this._initialized.gaze||!this._initialized.distance;"gaze"===e?(this._endGaze(),n&&this.checkInitialized("distance")&&this.calibrator.endDistance(!1,!1),this.calibrator._trackingVideoFrameTimestamps.gaze=0):(this.defaultDistanceTrackCallback=null,n&&this.checkInitialized("gaze")&&this._endGaze()),n?(this._initialized={distance:!1,gaze:!1},this._running={distance:!1,gaze:!1},this.webgazer.end(!0),this._runningVideo=!1):(this._initialized[e]=!1,this._running[e]=!1)},ZK.prototype._endGaze=function(){this.webgazer.params.paused=!0,this._learning=!0,this.defaultGazeCallback=null,this.webgazer.clearData(),this.webgazer.params.greedyLearner=!1,this.webgazer.params.framerate=60,this.webgazer.params.getLatestVideoFrameTimestamp=()=>{}},ZK.prototype._getLatestVideoTimestamp=function(e){this.calibrator._trackingVideoFrameTimestamps.gaze=e},ZK.prototype.startStoringPoints=function(){this.webgazer.params.storingPoints=!0},ZK.prototype.stopStoringPoints=function(){this.webgazer.params.storingPoints=!1},ZK.prototype.startLearning=function(e){this._learning||(this.webgazer.startLearning(e),this._learning=!0)},ZK.prototype.stopLearning=function(e){this._learning&&(this.webgazer.stopLearning(e),this._learning=!1)},ZK.prototype.showGazer=function(e){this.webgazer.showPredictionPoints(e)},ZK.prototype.showVideo=function(e){this.webgazer.showVideo(e,this.calibrator._params.videoOpacity)},ZK.prototype.showFaceOverlay=function(e){this.webgazer.showFaceOverlay(e)},_.A.prototype.performanceCompute=async function(e,t=!1){if(!this.checkInitialized())return;const n=performance.now(),s={_useless:void 0,time:0,randomTime:0};for(;performance.now()-n<500;)s._useless=Array(5e3).fill(Math.floor(10*Math.random())),s.time++;const r=performance.now();for(s._useless=0;performance.now()-r<500;)s._useless+=Math.random(),s.randomTime++;const i={value:{computeArrayFillMHz:(0,E.Nh)(2*s.time/1e6,3),computeRandomMHz:(0,E.Nh)(2*s.randomTime/1e6,3),idealFps:void 0,stressFps:void 0},timestamp:performance.now()};return t||(this.newPerformanceData=i),(0,E.nB)(e,i),i},_.A.prototype.performance=async function(e={},t=void 0){if(!this.checkInitialized())return;const n=Object.assign({testComputation:!0,testFrameCount:180,testObjectCount:1e4,headline:`🚀 ${G.H.RC_performanceTitle[this.L]}`,description:G.H.RC_performanceIntro[this.L]},e);this._addBackground(),this._addBackgroundText(n.headline,n.description),await(0,E.yy)(200);const s=n.testComputation?await this.performanceCompute(null,!0):{value:{computeArrayFillMHz:void 0,computeRandomMHz:void 0}},r=document.createElement("canvas"),i=r.getContext("2d");r.width=window.innerWidth,r.height=window.innerHeight,this.background.appendChild(r);const a=await YK(i),o=await QK(i,n.testFrameCount,n.testObjectCount),l={value:{computeArrayFillMHz:s.value.computeArrayFillMHz,computeRandomMHz:s.value.computeRandomMHz,idealFps:Math.round(6e4/(a.end-a.start)),stressFps:Math.round(1e3*n.testFrameCount/(o.end-o.start))},timestamp:performance.now()};return this.newPerformanceData=l,this._removeBackground(),(0,E.nB)(t,l),l};const YK=()=>{let e=60;const t=performance.now();return new Promise((n=>{const s=()=>{e--,e>0?requestAnimationFrame(s):n({start:t,end:performance.now()})};requestAnimationFrame(s)}))},QK=async(e,t,n)=>{let s=t;const r=[],i=["#000000","#333333","#999999"];for(let e=0;e{const n=()=>{e.clearRect(0,0,window.innerWidth,window.innerHeight),e.beginPath();for(const t of r)t.move(),t.draw(e);s--,s>0?requestAnimationFrame(n):t({start:a,end:performance.now()})};requestAnimationFrame(n)}))};class JK{constructor(e){this.w=(0,E.Av)(20,70),this.h=(0,E.Av)(30,70),this.x=-this.w+Math.random()*window.innerWidth,this.y=-this.h/2+Math.random()*(window.innerHeight+this.h/2),this.speed=(0,E.Av)(1,5),this.stroke=e[Math.floor(Math.random()*e.length)]}move(){this.x+=this.speed+.5*Math.random(),this.x>window.innerWidth&&(this.x=-this.w)}draw(e){e.strokeStyle=this.stroke,e.fillRect(this.x,this.y,this.w,this.h),e.strokeRect(this.x,this.y,this.w,this.h)}}_.A.prototype.getEquipment=async function(e,t=!1){if(this.equipment&&!t)return(0,E.nB)(e);this._replaceBackground();const{CM:n,IN_D:s,IN_F:r}=this._CONST.UNITS,i={};i[n]="centimeter",i[s]="inch (decimal, e.g. 11.5 in)",i[r]="inch (fractional, e.g. 12 3/8 in)";const{value:a}=await zs.fire({...qs(this,{showIcon:!1}),title:"Do you have a ruler or tape measure?",html:"Ideally, it should be long enough to measure your viewing distance, but even a 6 inch (15 cm) ruler can be useful. Please select the units you'll use, or indicate that no ruler or tape measure is available.",input:"select",inputOptions:{...i,none:"No ruler or tape measure is available"},inputPlaceholder:"Select an option",inputValidator:e=>new Promise((t=>{e.length||t("Please select an option.");const n="none"!==e;this.newEquipmentData={value:{has:n,unit:n?e:null,equipment:n?"":null},timestamp:performance.now()},t()}))});return a?(0,E.nB)(e):void 0};var eX=__webpack_require__(2016),tX=__webpack_require__(980),nX=__webpack_require__.n(tX),sX=__webpack_require__(3890),rX=__webpack_require__.n(sX);_.A.prototype._checkScreenSize=async function(e,t,n){await this.getEquipment((()=>{iX(this,e,t,n)}))};const iX=async(e,t,n,s)=>{if(e.equipment?.value?.has){e._replaceBackground((0,E.$O)("📏 Measure the Length of the Arrow",'Use your ruler (or tape measure) to measure the length of the arrow. Type your numerical answer into the box. Just digits, period, decimal comma, and / (forward slash) for fractional inches. Then click OK or hit RETURN.'));const t=t=>[()=>{const n=document.createElement("div");e.background.appendChild(n),n.outerHTML=t},()=>{for(const t of e.background.getElementsByClassName("arrow-two-sided-svg"))t.remove()},{callback:()=>{},content:"Ruler is too short"}],n=await(0,eX.K)(e,...t(nX())),r=await(0,eX.K)(e,...t(rX())),i={};if(n){const t=n.value,s=e.windowWidthPx.value,r=(0,E.Nh)(2.54*s/e.screenPpi.value,1);i.horizontal={...t,calibratorArrowWidthCm:r,arrowWidthPx:s}}if(r){const t=r.value,n=e.windowHeightPx.value,s=(0,E.Nh)(2.54*n/e.screenPpi.value,1);i.vertical={...t,calibratorArrowHeightCm:s,arrowHeightPx:n}}if(i.vertical||i.horizontal){const t={value:i,timestamp:n?n.timestamp:r.timestamp,measure:"screenSize"};e.newCheckData=t,(0,E.nB)(s,t)}}e._removeBackground(),(0,E.nB)(t,n)};_.A.prototype._checkDistance=async function(e,t,n,s){await this.getEquipment((()=>aX(this,e,t,n,s)))};const aX=async(e,t,n,s,r)=>{const i="trackDistance"===s,a=()=>{e._removeBackground(),i||(0,E.nB)(t,n)};if(i&&(0,E.nB)(t,n),e.equipment?.value?.has){e._addBackground(),e._replaceBackground((0,E.$O)("📏 Hold Still and Measure Viewing Distance with Ruler",'Hold still so that your viewing distance from the screen stays unchanged from the last measurement. Please measure the distance from the middle of your screen to one of your eyes using your ruler (or measuring tape). If your ruler is not long enough, then select "Ruler is too short" below. Type your numerical answer into the box, then click OK or hit RETURN.'));const t=await(0,eX.K)(e,null,null,{callback:()=>{},content:"Ruler is too short"});if(t){const n={value:{...t.value,calibratorCm:e.viewingDistanceCm.value,calibratorMethod:e.viewingDistanceCm.method},timestamp:t.timestamp,measure:s};return e.newCheckData=n,a(),void(0,E.nB)(r,n)}}a()};var oX=__webpack_require__(7790),lX=__webpack_require__(627),uX=__webpack_require__.n(lX),cX=__webpack_require__(8110),hX=__webpack_require__.n(cX),dX=__webpack_require__(5072),pX=__webpack_require__.n(dX),fX=__webpack_require__(7825),mX=__webpack_require__.n(fX),gX=__webpack_require__(7659),yX=__webpack_require__.n(gX),bX=__webpack_require__(5056),wX=__webpack_require__.n(bX),vX=__webpack_require__(540),AX=__webpack_require__.n(vX),xX=__webpack_require__(1113),CX=__webpack_require__.n(xX),kX=__webpack_require__(4636),SX={};SX.styleTagTransform=CX(),SX.setAttributes=wX(),SX.insert=yX().bind(null,"head"),SX.domAPI=mX(),SX.insertStyleElement=AX();pX()(kX.A,SX);kX.A&&kX.A.locals&&kX.A.locals;_.A.prototype.removePanel=function(){return!!this._panelStatus.hasPanel&&(this._panel.panelObserver.unobserve(this._panel.panel),this._panel.panel.remove(),this._panel.panel=null,this._panel.panelObserver=null,this._panel.panelTasks=[],this._panel.panelParent=null,this._panel.panelOptions={},this._panel.panelCallback=null,this._panel.panelResolve=null,this._panelStatus.hasPanel=!1,this._panelStatus.panelFinished=!1,BX(this),!0)},_.A.prototype.resetPanel=function(e=null,t=null,n=null,s=null,r=null){if(!this._panelStatus.hasPanel)return!1;const i=e||[...this._panel.panelTasks],a=n||{...this._panel.panelOptions},o=s&&"function"==typeof s?s:this._panel.panelCallback,l=r||this._panel.panelResolve;return null!==t&&t!==this._panel.panelParent?(this.removePanel(),this.panel(i,t,a,o,l)):(BX(this),this.panel(i,this._panel.panelParent,a,o,l,!0))},_.A.prototype.panel=async function(e,t,n={},s=null,r=null,i=!1){if(this._panelStatus.hasPanel^i)return!1;if(!IX(e))return!1;const a=document.querySelector(t);if(!a)return!1;const o=Object.assign({headline:G.H.RC_panelTitle[this.L],description:G.H.RC_panelIntro[this.L],showNextButton:!1,nextHeadline:G.H.RC_panelTitleNext[this.L],nextDescription:G.H.RC_panelIntroNext[this.L],nextButton:G.H.RC_panelButton[this.L],color:"#3490de",debug:!1,i18n:!0,_demoActivateAll:!1},n),l=Tr(o.color).darken(20).toString();document.documentElement.style.setProperty("--rc-panel-theme-color",o.color),document.documentElement.style.setProperty("--rc-panel-darken-color",l),document.documentElement.style.setProperty("--rc-panel-theme-color-semi",`${o.color}66`),document.documentElement.style.setProperty("--rc-panel-darken-color-semi",`${l}88`);const u=document.createElement("div");u.className=u.id="rc-panel",this.LD===this._CONST.RTL?u.className+=" rc-lang-rtl":u.className+=" rc-lang-ltr",o.i18n&&(u.innerHTML+='
      '),u.innerHTML+=`

      ${o.headline}

      `,u.innerHTML+=`

      ${o.description}

      `,u.innerHTML+='
      ',i?a.replaceChild(u,this._panel.panel):a.appendChild(u);const c=u.querySelector("#rc-panel-steps"),h=new ResizeObserver((()=>{OX(c,u.offsetWidth,this.LD)}));if(h.observe(u),OX(c,u.offsetWidth,this.LD),0===e.length)c.className+=" rc-panel-no-steps";else for(const t in e){const n=TX(this,t,e[t],o);c.appendChild(n)}(o.showNextButton||o._demoActivateAll)&&c.appendChild(NX(e.length,o));RX(this,{index:0,finished:[]},e,o,s),this._panel.panel=u,this._panel.panelObserver=h,this._panel.panelTasks=e,this._panel.panelParent=t;const d={...o};return o.headline===G.H.RC_panelTitle[this.L]&&(d.headline=void 0),o.description===G.H.RC_panelIntro[this.L]&&(d.description=void 0),o.nextHeadline===G.H.RC_panelTitleNext[this.L]&&(d.nextHeadline=void 0),o.nextDescription===G.H.RC_panelIntroNext[this.L]&&(d.nextDescription=void 0),o.nextButton===G.H.RC_panelButton[this.L]&&(d.nextButton=void 0),this._panel.panelOptions=d,this._panel.panelCallback=s,this._panel.panelResolve=r,this._panelStatus.hasPanel=!0,this._panelStatus.panelFinished=!1,o.i18n&&zX(this,document.querySelector("#rc-panel-language-parent"),l),o.debug&&(0,oX.K)(this,u,e,s),null===r&&(r=!0),new Promise((e=>{const t=setInterval((()=>{this._panelStatus.panelFinished&&(clearInterval(t),e(r))}),100);this._panelStatus.panelResolveIntervals.push(t)}))};const _X={screenSize:{use:1,name:G.H.RC_screenSize["en-US"],phraseHandle:"RC_screenSize"},measureDistance:{use:1,name:G.H.RC_viewingDistance["en-US"],phraseHandle:"RC_viewingDistance"},trackDistance:{use:2,name:G.H.RC_distanceTracking["en-US"],phraseHandle:"RC_distanceTracking"},trackGaze:{use:2,name:G.H.RC_gazeTracking["en-US"],phraseHandle:"RC_gazeTracking"},performance:{use:1,name:G.H.RC_performance["en-US"],phraseHandle:"RC_performance"}},EX=Object.keys(_X),IX=e=>{if(!Array.isArray(e))return!1;for(const t of e){if("object"==typeof t&&(null===t||!EX.includes(t.name)))return!1;if("string"==typeof t&&!EX.includes(t))return!1}return!0},TX=(e,t,n,s)=>{let r,i;switch(_X[MX(n)].use){case 0:case 1:default:r="",i="";break;case 2:r=uX(),i=G.H.RC_panelUsesWebcam[e.L];break;case 3:r=uX()+hX(),i=G.H.RC_panelUsesWebcamPhone[e.L]}const a=document.createElement("button");return a.className="rc-panel-step rc-panel-step-todo"+(s._demoActivateAll?" rc-panel-step-active":" rc-panel-step-inactive"),a.dataset.index=t,a.innerHTML=`${r.length?`

      ${r}

      `:""}

      ${Number(t)+1}  ${G.H[_X[MX(n)].phraseHandle][e.L]}

      ${r.length?`

      ${r} ${i}

      `:""}`,a},NX=(e,t)=>{const n=document.createElement("button");return n.className="rc-panel-step rc-panel-next-button rc-panel-step-inactive",n.dataset.index=e,n.innerHTML=`

      ${t.nextButton}

      `,n},OX=(e,t,n)=>{if(t<640){e.classList.add("rc-panel-steps-s"),e.classList.remove("rc-panel-steps-l");for(const t of e.childNodes)t.classList.add(`rc-lang-${n.toLowerCase()}`)}else{e.classList.add("rc-panel-steps-l"),e.classList.remove("rc-panel-steps-s");for(const t of e.childNodes)t.classList.remove("rc-lang-ltr"),t.classList.remove("rc-lang-rtl")}},RX=(e,t,n,s,r)=>{document.querySelectorAll(".rc-panel-step").forEach(((i,a)=>{const o=Number(i.dataset.index);if(s._demoActivateAll)i.onclick=()=>{e[MX(n[a])](...FX(n[a])),DX(a),t.finished.push(MX(n[a]));for(const e of n)if(!t.finished.includes(MX(e)))return;const s=document.querySelector(".rc-panel-next-button");s.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),s.onclick=()=>{e._panelStatus.panelFinished=!0,(0,E.nB)(r,{timestamp:performance.now()})}};else if(o===t.index)if(i.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),i.focus(),o!==n.length)o!==n.length-1||s.showNextButton?i.onclick=()=>{e[MX(n[t.index])](...FX(n[t.index],(()=>{DX(t.index),t.index++,RX(e,t,n,s,r)})))}:i.onclick=()=>{e[MX(n[t.index])](...FX(n[t.index],(()=>{DX(t.index)}),r,(()=>{e._panelStatus.panelFinished=!0})))};else if(o===n.length&&s.showNextButton){const{headline:t,nextHeadline:n,description:a,nextDescription:o}=s;t!==n&&(document.querySelector("#rc-panel-title").innerHTML=n),a!==o&&(document.querySelector("#rc-panel-description").innerHTML=o),i.onclick=()=>{e._panelStatus.panelFinished=!0,(0,E.nB)(r,{timestamp:performance.now()})}}}))},DX=e=>{const t=document.querySelectorAll(".rc-panel-step");for(const n of t)Number(n.dataset.index)===e&&(n.classList.replace("rc-panel-step-todo","rc-panel-step-finished"),n.classList.replace("rc-panel-step-active","rc-panel-step-inactive"))},MX=e=>"string"==typeof e?e:e.name,FX=(e,t,n=null,s=null)=>{"string"==typeof e&&(e={name:e});const r=()=>{(0,E.nB)(t),(0,E.nB)(n,{timestamp:performance.now()}),(0,E.nB)(s)};return["screenSize","measureDistance","performance"].includes(e.name)?[e.options||{},t=>{(0,E.nB)(e.callback,t),r()}]:"trackGaze"===e.name?[e.options||{},t=>{(0,E.nB)(e.callbackOnCalibrationEnd,t),r()},e.callbackTrack||null]:"trackDistance"===e.name?[e.options||{},t=>{(0,E.nB)(e.callbackStatic,t),r()},e.callbackTrack||null]:void 0},BX=e=>{e._panelStatus.panelResolveIntervals.map((e=>clearInterval(e))),e._panelStatus.panelResolveIntervals=[]},zX=(e,t,n)=>{let s=`",t.innerHTML=s,document.querySelector("#rc-panel-lang-picker").onchange=()=>{e.newLanguage(document.querySelector("#rc-panel-lang-picker").value),e.resetPanel()}};_.A.prototype.backgroundColor=function(e=null){if(!this.checkInitialized())return null;null!==e&&/^#([0-9A-F]{3}){1,2}$/i.test(e)?this._params.backgroundColor=e:this._params.backgroundColor="#eee";const t=document.querySelector("#calibration-background");return t&&(t.style.background=this.params.backgroundColor),this.params.backgroundColor},_.A.prototype.videoOpacity=function(e=null){if(!this.checkInitialized())return null;null===e||Number(e)!==e||Number(e)>1||Number(e)<0?this._params.videoOpacity=.8:this._params.videoOpacity=e;const t=document.querySelector("#webgazerVideoContainer");return t&&(t.style.opacity=this.params.videoOpacity),this.params.videoOpacity},_.A.prototype.showCancelButton=function(e=!0){return this.checkInitialized()?(this._params.showCancelButton=!!e,this.params.showCancelButton):null};var LX=__webpack_require__(9725),PX={};PX.styleTagTransform=CX(),PX.setAttributes=wX(),PX.insert=yX().bind(null,"head"),PX.domAPI=mX(),PX.insertStyleElement=AX();pX()(LX.A,PX);LX.A&&LX.A.locals&&LX.A.locals;var VX=__webpack_require__(5151),WX={};WX.styleTagTransform=CX(),WX.setAttributes=wX(),WX.insert=yX().bind(null,"head"),WX.domAPI=mX(),WX.insertStyleElement=AX();pX()(VX.A,WX);VX.A&&VX.A.locals&&VX.A.locals;var GX=__webpack_require__(2945),UX={};UX.styleTagTransform=CX(),UX.setAttributes=wX(),UX.insert=yX().bind(null,"head"),UX.domAPI=mX(),UX.insertStyleElement=AX();pX()(GX.A,UX);GX.A&&GX.A.locals&&GX.A.locals;var qX=__webpack_require__(9057),jX={};jX.styleTagTransform=CX(),jX.setAttributes=wX(),jX.insert=yX().bind(null,"head"),jX.domAPI=mX(),jX.insertStyleElement=AX();pX()(qX.A,jX);qX.A&&qX.A.locals&&qX.A.locals;var HX=__webpack_require__(4889),$X={};$X.styleTagTransform=CX(),$X.setAttributes=wX(),$X.insert=yX().bind(null,"head"),$X.domAPI=mX(),$X.insertStyleElement=AX();pX()(HX.A,$X);HX.A&&HX.A.locals&&HX.A.locals;var KX=__webpack_require__(2636),XX={};XX.styleTagTransform=CX(),XX.setAttributes=wX(),XX.insert=yX().bind(null,"head"),XX.domAPI=mX(),XX.insertStyleElement=AX();pX()(KX.A,XX);KX.A&&KX.A.locals&&KX.A.locals;var ZX=__webpack_require__(2921),YX={};YX.styleTagTransform=CX(),YX.setAttributes=wX(),YX.insert=yX().bind(null,"head"),YX.domAPI=mX(),YX.insertStyleElement=AX();pX()(ZX.A,YX);ZX.A&&ZX.A.locals&&ZX.A.locals;var QX=__webpack_require__(7271),JX={};JX.styleTagTransform=CX(),JX.setAttributes=wX(),JX.insert=yX().bind(null,"head"),JX.domAPI=mX(),JX.insertStyleElement=AX();pX()(QX.A,JX);QX.A&&QX.A.locals&&QX.A.locals;var eZ=__webpack_require__(2551),tZ={};tZ.styleTagTransform=CX(),tZ.setAttributes=wX(),tZ.insert=yX().bind(null,"head"),tZ.domAPI=mX(),tZ.insertStyleElement=AX();pX()(eZ.A,tZ);eZ.A&&eZ.A.locals&&eZ.A.locals;var nZ=__webpack_require__(8470),sZ={};sZ.styleTagTransform=CX(),sZ.setAttributes=wX(),sZ.insert=yX().bind(null,"head"),sZ.domAPI=mX(),sZ.insertStyleElement=AX();pX()(nZ.A,sZ);nZ.A&&nZ.A.locals&&nZ.A.locals;var rZ=__webpack_require__(2535),iZ={};iZ.styleTagTransform=CX(),iZ.setAttributes=wX(),iZ.insert=yX().bind(null,"head"),iZ.domAPI=mX(),iZ.insertStyleElement=AX();pX()(rZ.A,iZ);rZ.A&&rZ.A.locals&&rZ.A.locals;var aZ=__webpack_require__(663),oZ={};oZ.styleTagTransform=CX(),oZ.setAttributes=wX(),oZ.insert=yX().bind(null,"head"),oZ.domAPI=mX(),oZ.insertStyleElement=AX();pX()(aZ.A,oZ);aZ.A&&aZ.A.locals&&aZ.A.locals;var lZ=__webpack_require__(5319),uZ={};uZ.styleTagTransform=CX(),uZ.setAttributes=wX(),uZ.insert=yX().bind(null,"head"),uZ.domAPI=mX(),uZ.insertStyleElement=AX();pX()(lZ.A,uZ);lZ.A&&lZ.A.locals&&lZ.A.locals;var cZ=__webpack_require__(290),hZ={};hZ.styleTagTransform=CX(),hZ.setAttributes=wX(),hZ.insert=yX().bind(null,"head"),hZ.domAPI=mX(),hZ.insertStyleElement=AX();pX()(cZ.A,hZ);cZ.A&&cZ.A.locals&&cZ.A.locals;const dZ=new _.A;dZ.gazeTracker=new ZK(dZ);const pZ=dZ})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RemoteCalibrator=t():e.RemoteCalibrator=t()}(self,(()=>(()=>{var __webpack_modules__={6003:()=>{window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){return window.setTimeout(e,1e3/60)},window.cancelRequestAnimFrame=window.cancelCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.clearTimeout},359:(e,t,n)=>{"use strict";n.d(t,{F:()=>r,a:()=>i});var s=n(9199);const r=(e,t,{go:n,cancel:r,custom:i},a,o=!0)=>{const l=document.createElement("div");let u,c,h;if(l.className="rc-buttons"+(o?" rc-absolute-buttons":""),l.id="rc-buttons",n&&(u=document.createElement("button"),u.className="rc-button rc-go-button",u.onclick=n,u.innerHTML=s.H.RC_ok[e],l.appendChild(u)),r&&a&&(c=document.createElement("button"),c.className="rc-button rc-cancel-button",c.onclick=r,c.innerHTML=s.H.RC_cancel[e],l.appendChild(c)),i){const{callback:e,content:t}=i;h=document.createElement("button"),h.className="rc-button rc-custom-button",h.onclick=e,h.innerHTML=t,l.appendChild(h)}return t.appendChild(l),[l,u,c,h]},i=e=>{e.querySelector("#rc-buttons").remove()}},2016:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>takeInput});var _buttons__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(359),_keyBinder__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9853),_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9043);const takeInput=async(RC,extraFunction=null,extraFunctionOut=null,customButtonConfig=null)=>{const unit=RC.equipment.value.unit,unitDisplay=unit===RC._CONST.UNITS.CM?"cm":"in",unitIsFraction=unit===RC._CONST.UNITS.IN_F,formItem=`
      \n
      \n ${unitIsFraction?`${unitDisplay}`:`${unitDisplay}`}\n
      \n
      `,instruction=RC.background.querySelector(".calibration-instruction");instruction.innerHTML+=formItem;const formElement=instruction.querySelector(".rc-form"),formInputElement=instruction.querySelector(".rc-form-input"),formInputElementFInteger=instruction.querySelector(".rc-form-input-f-integer"),formInputElementFFraction=instruction.querySelector(".rc-form-input-f-fraction");unitIsFraction?formInputElementFInteger.focus():formInputElement.focus();const addedButtons=(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.F)(RC.L,formElement,{go:()=>{},custom:customButtonConfig||void 0},!0,!1),goButton=addedButtons[1],customButton=addedButtons[3];goButton.disabled=!0;const eleOkay=e=>{e.classList.remove("rc-input-error"),goButton.disabled=!1},eleError=e=>{isAcceptedSingleInput(e.value.slice(-1))?(e.classList.add("rc-input-error"),goButton.disabled=!0):e.value=e.value.substring(0,e.value.length-1)},setupEleOninput=(e,t)=>{e.oninput=()=>{t(e.value)?eleOkay(e):eleError(e)}},_validationForFraction=()=>{let e=!0;return validInputInteger(formInputElementFInteger.value)?eleOkay(formInputElementFInteger):(eleError(formInputElementFInteger),e=!1),validInputFraction(formInputElementFFraction.value)?eleOkay(formInputElementFFraction):(eleError(formInputElementFFraction),e=!1),e};return unitIsFraction?(formInputElementFInteger.oninput=_validationForFraction,formInputElementFFraction.oninput=_validationForFraction):setupEleOninput(formInputElement,validInput),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(extraFunction),new Promise((resolve=>{const bFunction=()=>{removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve(null)},fFunction=()=>{let valid=!1,numericalValue,inputValue;unitIsFraction&&validInputInteger(formInputElementFInteger.value)&&validInputFraction(formInputElementFFraction.value)?(valid=!0,numericalValue=Number.parseInt(formInputElementFInteger.value)+eval(formInputElementFFraction.value),inputValue=`${formInputElementFInteger.value} ${formInputElementFFraction.value}`):!unitIsFraction&&validInput(formInputElement.value)&&(valid=!0,numericalValue=Number(formInputElement.value)||Number(formInputElement.value.replace(",",".")),inputValue=formInputElement.value),valid&&(removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve({value:{numerical:numericalValue,input:inputValue,unit},timestamp:performance.now()}))};goButton.onclick=fFunction,customButton.onclick=bFunction;const bindKeysFunction=(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.m)({Enter:fFunction,Escape:bFunction})}))},removeInputElements=(e,t)=>{(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.a)(e);for(const t of e.children)t.remove();e.remove(),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(t)},validInput=e=>e.length>0&&!e.includes(" ")&&(!Number.isNaN(e)||!Number.isNaN(e.replace(",","."))),validInputInteger=e=>!!validInput(e)&&(Number.parseInt(e)===Number(e)&&Number(e)>0),validInputFraction=text=>{if("0"===text)return!0;if(!text.includes("/")||text.match(/\//g).length>1)return!1;const numbers=text.split("/");return validInputInteger(numbers[0])&&validInputInteger(numbers[1])&&(0,_utils__WEBPACK_IMPORTED_MODULE_2__.DW)(numbers[1])&&eval(text)<1},isAcceptedSingleInput=e=>/[0-9]/.test(e)||[".","/",","].includes(e)},9853:(e,t,n)=>{"use strict";n.d(t,{l:()=>i,m:()=>r});var s=n(9043);function r(e,t="keydown"){const n=t=>{t.key in e&&(t.preventDefault(),(0,s.nB)(e[t.key],t))};return document.body.addEventListener(t,n),n}function i(e,t="keydown"){document.body.removeEventListener(t,e)}},2646:(e,t,n)=>{"use strict";n.d(t,{G:()=>a,t:()=>r});var s=n(9199);function r(e){const t=Object.keys(s.H.EE_languageNameNative);if(t.includes(e))return i(e);const n=[];t.map((e=>{n.push(e.split("-")[0])}));const r=e.split("-")[0].toLowerCase();return n.includes(r)?i(t[n.indexOf(r)]):i("en-US")}function i(e){return{value:{language:e,languageNameEnglish:s.H.EE_languageNameEnglish[e],languageNameNative:s.H.EE_languageNameNative[e],languageDirection:s.H.EE_languageDirection[e],languagePhraseSource:s.H.EE_phraseSource[e]},timestamp:performance.now()}}function a(e){return"1"===s.H.EE_languageUseSpace[e]?" ":""}},477:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});const s="mocha"===n(7786)._;let r,i;if(!s){const e=n(9171);r=e.Synth,i=e.Volume}class a{triggerAttackRelease(){}}const o=s?new a:new r({oscillator:{type:"sine"},envelope:{attack:.001,decay:.001,sustain:1,release:.001}}).connect(new i(-17).toDestination()),l=s?new a:new r({oscillator:{type:"sine"}}).connect(new i(-5).toDestination()),u=(e=0)=>{switch(e){case 0:default:return void o.triggerAttackRelease(2e3,.05);case 1:return void o.triggerAttackRelease(500,.5);case 2:return void o.triggerAttackRelease(200,.6);case 3:return void l.triggerAttackRelease(200,.2)}}},9043:(e,t,n)=>{"use strict";function s(e,...t){if(e&&"function"==typeof e)return t.length?e(...t):e()}n.d(t,{$O:()=>l,$k:()=>w,AU:()=>u,Av:()=>y,DW:()=>d,Ew:()=>c,G8:()=>g,JZ:()=>m,KY:()=>v,Md:()=>r,Nh:()=>f,Sf:()=>a,aS:()=>o,k4:()=>p,ll:()=>h,ln:()=>b,nB:()=>s,yy:()=>i}),function(){let e=0;const t=["ms","moz","webkit","o"];for(let e=0;e{};function i(e){return new Promise((t=>setTimeout(t,e)))}function a(){if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled){const e=document.documentElement;return e.requestFullscreen?(e.requestFullscreen(),!0):e.mozRequestFullScreen?(e.mozRequestFullScreen(),!0):e.webkitRequestFullscreen?(e.webkitRequestFullscreen(),!0):!!e.msRequestFullscreen&&(e.msRequestFullscreen(),!0)}return!1}function o(){return Math.abs(window.innerHeight-screen.height)<5&&Math.abs(window.innerWidth-screen.width)<5&&window.screenX<5&&window.screenY<5}function l(e,t=null,n=!1,s=""){return`

      ${e}

      ${t?`

      ${t}

      `:""}`}function u(e,t,n){return en?n:e}function c(e,t,n,s,r){return s+1*(e-t)/(n-t)*(r-s)}function h(e,t,n,s){return Math.sqrt((e-n)**2+(t-s)**2)}function d(e){return e&&!(e&e-1)}function p(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function f(e,t){const n=10**t;return Math.round(e*n)/n}const m=e=>{const t=Math.floor(e.length/2),n=[...e].sort(((e,t)=>e-t));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},g=e=>e.reduce(((e,t)=>e+t))/e.length;function y(e,t,n=1){let s=0,r=0;for(;0===s;)s=Math.random();for(;0===r;)r=Math.random();let i=Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*r);return i=i/10+.5,i>1||i<0?i=y(e,t,n):(i=i**n,i*=t-e,i+=e),i}const b=e=>JSON.parse(JSON.stringify(e));function w(){"activeElement"in document&&document.activeElement.blur()}const v=e=>{if("touchstart"===e.type||"touchmove"===e.type){const t=e.touches[0];return{x:t.clientX,y:t.clientY}}return{x:e.clientX,y:e.clientY}}},7786:(e,t,n)=>{"use strict";n.d(t,{A:()=>w,_:()=>y});var s=n(7503),r=n.n(s),i=n(115),a=n.n(i);const o=["tall","short","up","down","fancy","busy","loud","crazy","kind","nice","real","speedy","handy","active","alert","bold","brave","bright","calm","clever","cool","free","grand","great","happy","jolly","lucky","spicy","sunny","super","wise"],l=["bat","bear","bird","cat","cow","deer","dog","dove","dragon","duck","eagle","fish","fox","frog","goose","lion","mouse","owl","pig","rat","seal","shark","sheep","snake","spider","tiger","turkey","viper","whale","wolf","onion","carrot","pear","bean","corn","bread","apple","banana","fig","grape","lemon","lime","orange","peach","plum","dumpling","cake","pasta","pot","sushi"],u=["blue","bronze","fire","forest","gold","gray","green","navy","purple","red","silver","sky","yellow","neon","black","white","brown","aqua"];function c(e){return e[Math.floor(Math.random()*e.length)]}function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(){const e=`000${(new Date).getMilliseconds().toString()}`;return h(c(o))+h(c(u))+h(c(l))+e.substring(e.length-3)}var p=n(782),f=n(9043),m=n(2646),g=n(9199);const y="production";class b{constructor(){window.console.log(`%c\nEasyEyes Remote Calibrator ${this.version.value}\n`,`color: ${this._CONST.COLOR.ORANGE}`),this._initialized=!1,this._initializing=!1,this._id=null,this._lang=null,this._langData=[],this._panelStatus={hasPanel:!1,panelFinished:!1,panelResolveIntervals:[]},this._panel={panel:null,panelObserver:null,panelTasks:[],panelParent:null,panelOptions:{},panelCallback:null,panelResolve:null},this._participantCheckEquipment={has:null,equipment:null,unit:null},this._trackingSetupFinishedStatus={gaze:!0,distance:!0},this._trackingPaused={gaze:!1,distance:!1},this._trackingVideoFrameTimestamps={gaze:0,distance:0},this._distanceTrackNudging={distanceCorrecting:null,distanceCorrectEnabled:!1,distanceDesired:null,distanceAllowedRatio:null,needEasyEyesKeypadBeyondCm:null},this._gazeTrackNudging={isCorrectingGaze:!1},this._environmentData=[],this._displayData=[],this._screenData=[],this._viewingDistanceData=[],this._nearPointData=[],this._PDData=[],this._gazePositionData=[],this._gazeAccuracyData=[],this._performanceData=[],this._fullscreenData=[],this._equipmentData=[],this._checkData=[],this._background={element:null,instructionElement:null},this._nudger={element:null,gazeElement:null},this._params={backgroundColor:"#eee",videoOpacity:.8,showCancelButton:!0}}get background(){return this._background.element}get instructionElement(){return this._background.instructionElement}get nudger(){return this._nudger.element}get params(){return this._params}get id(){return this._id?{value:this._id.value,timestamp:this._id.timestamp,date:this._id.date}:null}_helper_get(e,t){if(!e.length)return null;const n=e[e.length-1];return t?{value:n.value[t],timestamp:n.timestamp}:n}get version(){return{value:"0.7.16"}}get supportedLanguages(){const e=[];for(const t in g.H.EE_languageNameEnglish)e.push({language:t,languageNameEnglish:g.H.EE_languageNameEnglish[t],languageNameNative:g.H.EE_languageNameNative[t]});return e}get L(){return this._lang}get LD(){return this.languageDirection.value}get language(){return this._helper_get(this._langData,"language")}get languageNameEnglish(){return this._helper_get(this._langData,"languageNameEnglish")}get languageNameNative(){return this._helper_get(this._langData,"languageNameNative")}get languageDirection(){return this._helper_get(this._langData,"languageDirection")}get languagePhraseSource(){return this._helper_get(this._langData,"languagePhraseSource")}get computeArrayFillMHz(){return this._helper_get(this._performanceData,"computeArrayFillMHz")}get computeRandomMHz(){return this._helper_get(this._performanceData,"computeRandomMHz")}get idealFps(){return this._helper_get(this._performanceData,"idealFps")}get stressFps(){return this._helper_get(this._performanceData,"stressFps")}get isFullscreen(){return this.fullscreenData.length&&a()((0,f.aS)(),this._helper_get(this._fullscreenData).value)||(this.newFullscreenData={value:(0,f.aS)(),timestamp:performance.now()}),this._helper_get(this._fullscreenData)}get concurrency(){return this._helper_get(this._environmentData,"concurrency")}get browser(){return this._helper_get(this._environmentData,"browser")}get browserVersion(){return this._helper_get(this._environmentData,"browserVersion")}get deviceType(){return this._helper_get(this._environmentData,"deviceType")}get isMobile(){const e=this._helper_get(this._environmentData,"deviceType");return{value:"desktop"!==e.value,timestamp:e.timestamp}}get model(){return this._helper_get(this._environmentData,"model")}get manufacturer(){return this._helper_get(this._environmentData,"manufacturer")}get engine(){return this._helper_get(this._environmentData,"engine")}get system(){return this._helper_get(this._environmentData,"system")}get systemFamily(){return this._helper_get(this._environmentData,"systemFamily")}get description(){return this._helper_get(this._environmentData,"description")}get fullDescription(){return this._helper_get(this._environmentData,"fullDescription")}get userLanguage(){return this._helper_get(this._environmentData,"userLanguage")}get equipment(){return this._helper_get(this._equipmentData)}get displayWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"displayWidthPx")}get displayHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"displayHeightPx")}get windowWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"windowWidthPx")}get windowHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"windowHeightPx")}get screenWidthCm(){return this._helper_get(this._screenData,"screenWidthCm")}get screenHeightCm(){return this._helper_get(this._screenData,"screenHeightCm")}get screenDiagonalCm(){return this._helper_get(this._screenData,"screenDiagonalCm")}get screenDiagonalIn(){return this._helper_get(this._screenData,"screenDiagonalIn")}get screenPpi(){return this._helper_get(this._screenData,"screenPpi")}get screenPhysicalPpi(){return this._helper_get(this._screenData,"screenPhysicalPpi")}get viewingDistanceCm(){return this._helper_get(this._viewingDistanceData)}get nearPointCm(){return this._helper_get(this._nearPointData)}get PDCm(){return this._helper_get(this._PDData)}get gazePositionPx(){return this._helper_get(this._gazePositionData)}get gazeAccuracyDeg(){return this._helper_get(this._gazeAccuracyData)}get displayData(){return this._displayData}get screenData(){return this._screenData}get viewingDistanceData(){return this._viewingDistanceData}get nearPointData(){return this._nearPointData}get PDData(){return this._PDData}get gazeData(){return this._gazePositionData}get performanceData(){return this._performanceData}get fullscreenData(){return this._fullscreenData}get environmentData(){return this._environmentData}get languageData(){return this._langData}get equipmentData(){return this._equipmentData}get checkData(){return this._checkData}set newDisplayData(e){this._displayData.push(e)}set newScreenData(e){this._screenData.push(e)}set newViewingDistanceData(e){this._viewingDistanceData.push(e)}set newNearPointData(e){this._nearPointData.push(e)}set newPDData(e){this._PDData.push(e)}set newGazePositionData(e){this._gazePositionData.push(e)}set newGazeAccuracyData(e){this._gazeAccuracyData.push(e)}set newEnvironmentData(e){this._environmentData.push(e)}set newPerformanceData(e){this._performanceData.push(e)}set newFullscreenData(e){this._fullscreenData.push(e)}set newLanguageData(e){this._langData.push(e)}set newEquipmentData(e){this._equipmentData.push(e)}set newCheckData(e){this._checkData.push(e)}}b.prototype.init=async function(e={},t=void 0){if(!this._initialized&&!this._initializing){this._initializing=!0;const n=Object.assign({id:d(),language:"AUTO",languagePhrasesJSON:null,fullscreen:!1},e);await(async(e=null)=>{const{remoteCalibratorPhrases:t}=await import("https://cdn.jsdelivr.net/gh/EasyEyes/remote-calibrator@latest/src/i18n/phrases.js");Object.assign(g.H,t),e&&Object.assign(g.H,e)})(n.languagePhrasesJSON),n.fullscreen&&!p.Y&&(0,f.Sf)(),this._id={value:n.id,timestamp:performance.now(),date:new Date},this._environment(),this._displaySize(),this._CONST.S.AUTO===n.language?this.newLanguageData=(0,m.t)(this.userLanguage.value):this.newLanguageData=(0,m.t)(n.language),this._lang=this.language.value,this._initializing=!1,this._initialized=!0,(0,f.nB)(t,this._id)}},b.prototype._environment=function(){if(this.checkInitialized()){(0,f.$k)();const e=e=>e.match(/Mobi/i)?"mobile":"desktop",t={value:{concurrency:window.navigator.hardwareConcurrency||-1,browser:r().name,browserVersion:r().version,deviceType:e(navigator.userAgent),model:r().product||"unknown",manufacturer:r().manufacturer||"unknown",engine:r().layout,system:`${r().os.family} ${r().os.version}`,systemFamily:r().os.family,description:r().description,fullDescription:r().ua,userLanguage:window.navigator.userLanguage||window.navigator.language},timestamp:this.id.timestamp};this.newEnvironmentData=t}},b.prototype.checkInitialized=function(){return!!this._initialized},b.prototype.getFullscreen=function(e=!0){return!!(0,f.aS)()||(this.newFullscreenData={value:!(!e||p.Y)&&(0,f.Sf)(),timestamp:performance.now()},this.isMobile.value&&window.scrollBy(0,1),this.isFullscreen)},b.prototype.newLanguage=function(e){if(this.checkInitialized()){let t;return this.newLanguageData=t=(0,m.t)(e),this._lang=this.language.value,t}},b.prototype._addBackground=function(e){if(null!==this.background)return;let t=document.getElementById("calibration-background");return t||(t=document.createElement("div"),t.id="calibration-background",t.className=`calibration-background rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._background.element=t,this.background},b.prototype._replaceBackground=function(e){return null!==this.background&&this._removeBackground(),this._addBackground(e)},b.prototype._removeBackground=function(){const e=document.getElementById("calibration-background");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._background={element:null,instructionElement:null},!0)},b.prototype._addBackgroundText=function(e,t){const n=this.background.getElementsByClassName("calibration-instruction");for(let e=0;e{"use strict";n.d(t,{Y:()=>s});const s=!1},9199:(e,t,n)=>{"use strict";n.d(t,{H:()=>r});const s=["en-US","ar","hy","bg","zh-CN","zh-HK","hr","cs","da","nl","en-UK","fi","fr","de","el","he","hi","hu","is","id","it","ja","kn","ko","lt","ms","ml","no","fa","pl","pt","ro","ru","sr","es","su","sw","sv","tl","tr","ur"],r={};["EE_languageNameEnglish","EE_languageNameNative","EE_languageDirection","EE_languageUseSpace","EE_phraseSource","RC_cancel","RC_distanceTracking","RC_distanceTrackingCloseL","RC_distanceTrackingCloseR","RC_distanceTrackingGuide","RC_distanceTrackingIntroEnd","RC_distanceTrackingIntroStart","RC_distanceTrackingMoveCloser","RC_distanceTrackingMoveFurther","RC_canUsePhoneKeypad","RC_distanceTrackingRedo","RC_distanceTrackingTitle","RC_errorCameraUseDenied","RC_errorNoCamera","RC_gazeTracking","RC_gazeTrackingIntro","RC_gazeTrackingNudge","RC_gazeTrackingTitle","RC_nearPointIntro","RC_nearPointTitle","RC_ok","RC_panelButton","RC_panelIntro","RC_panelTitle","RC_panelTitleNext","RC_panelIntroNext","RC_panelUsesWebcam","RC_panelUsesWebcamPhone","RC_performance","RC_performanceIntro","RC_performanceTitle","RC_privacyCamera","RC_requestCamera","RC_screenSize","RC_screenSizeCredit","RC_screenSizeCreditCard","RC_screenSizeHave","RC_screenSizeIntro","RC_screenSizeTitle","RC_screenSizeUSBA","RC_screenSizeUSBC","RC_starting","RC_viewingBlindSpotCredit","RC_viewingBlindSpotRejected","RC_viewingDistance","RC_viewingDistanceIntroTitle","RC_viewingDistanceIntroLiMethod","RC_viewingDistanceTitle"].map((e=>{r[e]={},s.map((t=>{r[e][t]=""}))}))},7790:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>_setDebugControl});var _components_utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9043);const _setDebugControl=(e,t,n,s)=>{const r=document.createElement("div");r.className="rc-panel-debug-control",r.innerHTML='

      DEBUG CONTROL

      REMEMBER TO SET debug TO false FOR PRODUCTION MODE!

      ',t.appendChild(r);const i=[];for(const t of n){const n=t.name?t.name:t,s=document.createElement("div");s.className="rc-panel-debug-control-task-row",s.id=`rc-debugger-row-${n}`;const a=e._debuggerDefault[n];if(a){r.innerHTML+=`

      ${n}

      `;const e={n:"number",s:"string"};switch(n){case"screenSize":for(const t in a.value)s.innerHTML+=_createValueElement(n,t,a.value[t],`.value.${t}`,e.n);break;case"measureDistance":s.innerHTML+=_createValueElement(n,"value",a.value,".value",e.n),s.innerHTML+=_createValueElement(n,"method",a.method,".method",e.s,!0);break;case"trackDistance":s.innerHTML+=_createValueElement(n,"viewingDistanceCm",a.value.viewingDistanceCm,".value",e.n),s.innerHTML+=_createValueElement(n,"PDCm",a.value.PDCm,".value",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.x",a.value.nearPointCm.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.y",a.value.nearPointCm.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",a.value.latencyMs,".latencyMs",e.n),s.innerHTML+=_createValueElement(n,"method",a.method,".method",e.s,!0);break;case"trackGaze":s.innerHTML+=_createValueElement(n,"x",a.value.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"y",a.value.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",a.value.latencyMs,".value.latencyMs",e.n);break;case"performance":s.innerHTML+=_createValueElement(n,"computeArrayFillMHz",a.value.computeArrayFillMHz,".value.computeArrayFillMHz",e.n),s.innerHTML+=_createValueElement(n,"computeRandomMHz",a.value.computeRandomMHz,".value.computeRandomMHz",e.n),s.innerHTML+=_createValueElement(n,"idealFps",a.value.idealFps,".value.idealFps",e.n),s.innerHTML+=_createValueElement(n,"stressFps",a.value.stressFps,".value.stressFps",e.n)}r.appendChild(s),i.push(n)}}const a=document.createElement("button");a.className="rc-panel-debug-control-next",a.innerHTML="Simulate calibration and continue",a.onclick=()=>{_wrapValues(e,i),(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.nB)(s,{timestamp:performance.now()}),e._panelStatus.panelFinished=!0},r.appendChild(a)},_createValueElement=(e,t,n,s,r,i=!1)=>`
      \n \n

      ${t}

      \n
      `,_wrapValues=(e,t)=>{for(const n of t){const t=document.querySelector(`#rc-debugger-row-${n}`),s={};switch(n){case"screenSize":s.value={},_putData(e,s,t),e.newScreenData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"measureDistance":_putData(e,s,t),e.newViewingDistanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"trackDistance":e.newViewingDistanceData={value:_get(t,"#trackDistance-viewingDistanceCm"),latencyMs:_get(t,"#trackDistance-latencyMs"),method:_get(t,"#trackDistance-method","string"),timestamp:e._debuggerDefault.timestamp},e.newNearPointData={value:{x:_get(t,"#trackDistance-nearPointCm-x"),y:_get(t,"#trackDistance-nearPointCm-y")},timestamp:e._debuggerDefault.timestamp},e.newPDData={value:_get(t,"#trackDistance-PDCm"),timestamp:e._debuggerDefault.timestamp};break;case"trackGaze":s.value={},_putData(e,s,t),e.newGazePositionData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"performance":s.value={},_putData(e,s,t),e.newPerformanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s)}}},_get=(e,t)=>{const n=e.querySelector(t);return"number"===n.dataset.type?Number(n.value):n.value},_putData=(RC,newData,taskRow)=>{for(const ele of taskRow.childNodes){const eleInput=ele.querySelector("input");try{eval(`newData${eleInput.dataset.source} = eleInput.dataset.type === 'number' ? Number(eleInput.value) : eleInput.value`)}catch(e){}newData.timestamp=RC._debuggerDefault.timestamp}return newData}},2921:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".animated{-webkit-animation-duration:var(--animate-duration);animation-duration:var(--animate-duration);-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.animated.repeat-1{-webkit-animation-iteration-count:var(--animate-repeat);animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{-webkit-animation-iteration-count:calc(var(--animate-repeat)*2);animation-iteration-count:calc(var(--animate-repeat)*2)}.animated.repeat-3{-webkit-animation-iteration-count:calc(var(--animate-repeat)*3);animation-iteration-count:calc(var(--animate-repeat)*3)}.animated.delay-1s{-webkit-animation-delay:var(--animate-delay);animation-delay:var(--animate-delay)}.animated.delay-2s{-webkit-animation-delay:calc(var(--animate-delay)*2);animation-delay:calc(var(--animate-delay)*2)}.animated.delay-3s{-webkit-animation-delay:calc(var(--animate-delay)*3);animation-delay:calc(var(--animate-delay)*3)}.animated.delay-4s{-webkit-animation-delay:calc(var(--animate-delay)*4);animation-delay:calc(var(--animate-delay)*4)}.animated.delay-5s{-webkit-animation-delay:calc(var(--animate-delay)*5);animation-delay:calc(var(--animate-delay)*5)}.animated.faster{-webkit-animation-duration:calc(var(--animate-duration)/2);animation-duration:calc(var(--animate-duration)/2)}.animated.fast{-webkit-animation-duration:calc(var(--animate-duration)*.8);animation-duration:calc(var(--animate-duration)*.8)}.animated.slow{-webkit-animation-duration:calc(var(--animate-duration)*2);animation-duration:calc(var(--animate-duration)*2)}.animated.slower{-webkit-animation-duration:calc(var(--animate-duration)*3);animation-duration:calc(var(--animate-duration)*3)}@media (prefers-reduced-motion:reduce),print{.animated{-webkit-animation-duration:1ms!important;animation-duration:1ms!important;-webkit-animation-iteration-count:1!important;animation-iteration-count:1!important;-webkit-transition-duration:1ms!important;transition-duration:1ms!important}.animated[class*=Out]{opacity:0}}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_base.css"],names:[],mappings:"AAAA,UACE,kDAA2C,CAA3C,0CAA2C,CAC3C,gCAAyB,CAAzB,wBACF,CAEA,mBACE,0CAAmC,CAAnC,kCACF,CAEA,mBACE,uDAAgD,CAAhD,+CACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,4CAAqC,CAArC,oCACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,eACE,2DAAuD,CAAvD,mDACF,CAEA,eACE,0DAAqD,CAArD,kDACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,6CACE,UACE,wCAAkC,CAAlC,gCAAkC,CAElC,6CAAuC,CAAvC,qCAAuC,CADvC,yCAAmC,CAAnC,iCAEF,CAEA,sBACE,SACF,CACF",sourcesContent:[".animated {\n animation-duration: var(--animate-duration);\n animation-fill-mode: both;\n}\n\n.animated.infinite {\n animation-iteration-count: infinite;\n}\n\n.animated.repeat-1 {\n animation-iteration-count: var(--animate-repeat);\n}\n\n.animated.repeat-2 {\n animation-iteration-count: calc(var(--animate-repeat) * 2);\n}\n\n.animated.repeat-3 {\n animation-iteration-count: calc(var(--animate-repeat) * 3);\n}\n\n.animated.delay-1s {\n animation-delay: var(--animate-delay);\n}\n\n.animated.delay-2s {\n animation-delay: calc(var(--animate-delay) * 2);\n}\n\n.animated.delay-3s {\n animation-delay: calc(var(--animate-delay) * 3);\n}\n\n.animated.delay-4s {\n animation-delay: calc(var(--animate-delay) * 4);\n}\n\n.animated.delay-5s {\n animation-delay: calc(var(--animate-delay) * 5);\n}\n\n.animated.faster {\n animation-duration: calc(var(--animate-duration) / 2);\n}\n\n.animated.fast {\n animation-duration: calc(var(--animate-duration) * 0.8);\n}\n\n.animated.slow {\n animation-duration: calc(var(--animate-duration) * 2);\n}\n\n.animated.slower {\n animation-duration: calc(var(--animate-duration) * 3);\n}\n\n@media print, (prefers-reduced-motion: reduce) {\n .animated {\n animation-duration: 1ms !important;\n transition-duration: 1ms !important;\n animation-iteration-count: 1 !important;\n }\n\n .animated[class*='Out'] {\n opacity: 0;\n }\n}\n"],sourceRoot:""}]);const o=a},2636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,":root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_vars.css"],names:[],mappings:"AAAA,MACE,qBAAsB,CACtB,kBAAmB,CACnB,kBACF",sourcesContent:[":root {\n --animate-duration: 1s;\n --animate-delay: 1s;\n --animate-repeat: 1;\n}\n"],sourceRoot:""}]);const o=a},7271:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_entrances/fadeInUp.css"],names:[],mappings:"AAAA,4BACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAVA,oBACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAEA,UACE,+BAAwB,CAAxB,uBACF",sourcesContent:["@keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n}\n\n.fadeInUp {\n animation-name: fadeInUp;\n}\n"],sourceRoot:""}]);const o=a},2551:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"@-webkit-keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_exits/fadeOutDown.css"],names:[],mappings:"AAAA,+BACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CATA,uBACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CAEA,aACE,kCAA2B,CAA3B,0BACF",sourcesContent:["@keyframes fadeOutDown {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n}\n\n.fadeOutDown {\n animation-name: fadeOutDown;\n}\n"],sourceRoot:""}]);const o=a},8470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,'.swal2-popup.swal2-toast{background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:min-content auto min-content;overflow-y:hidden;padding:1em;pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{font-size:1em;margin:.5em 1em;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{font-size:1em;height:2em;margin:.5em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{font-size:.8em;margin:.5em 0 0;padding:.5em 0 0}.swal2-popup.swal2-toast .swal2-close{align-self:center;font-size:2em;grid-column:3/3;grid-row:1/99;height:.8em;margin:0;width:.8em}.swal2-popup.swal2-toast .swal2-html-container{font-size:1em;margin:.5em 1em;overflow:initial;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:.25em;width:2em}.swal2-popup.swal2-toast .swal2-icon{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:0 .5em 0 0;min-width:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{align-items:center;display:flex;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;justify-content:flex-start;margin:.5em 0 0;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{font-size:1em;margin:.25em .5em;padding:.4em .6em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:3em;position:absolute;width:1.6em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:4em 0 0 4em;left:-.5em;top:-.8em;transform:rotate(-45deg);transform-origin:2em 2em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 4em 4em 0;left:.9375em;top:-.25em;transform-origin:0 1.5em}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{height:2.6875em;left:.4375em;top:0;width:.4375em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{left:.1875em;top:1.125em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{right:.1875em;top:.9375em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){box-sizing:border-box;display:grid;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;inset:0;overflow-x:hidden;padding:.625em;position:fixed;transition:background-color .1s;z-index:1060;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:transparent!important}div:where(.swal2-container).swal2-bottom-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}div:where(.swal2-container).swal2-bottom,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-top{grid-template-columns:auto minmax(0,1fr) auto}div:where(.swal2-container).swal2-bottom-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-left>.swal2-popup,div:where(.swal2-container).swal2-center-start>.swal2-popup{align-self:center;grid-row:2}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-left>.swal2-popup,div:where(.swal2-container).swal2-bottom-start>.swal2-popup{align-self:end;grid-column:1;grid-row:3}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup,div:where(.swal2-container).swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{align-self:stretch;grid-row:1/4}div:where(.swal2-container).swal2-no-transition{transition:none!important}div:where(.swal2-container) div:where(.swal2-popup){background:#fff;border:none;border-radius:5px;box-sizing:border-box;color:#545454;display:none;font-family:inherit;font-size:1rem;grid-template-columns:minmax(0,100%);max-width:100%;padding:0 0 1.25em;position:relative;width:32em}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){color:inherit;font-size:1.875em;font-weight:600;margin:0;max-width:100%;padding:.8em 1em 0;position:relative;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:1.25em auto 0;padding:0;width:auto;z-index:1}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}div:where(.swal2-container) div:where(.swal2-loader){align-items:center;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-color:#2778c4 transparent;border-radius:100%;border-style:solid;border-width:.25em;display:none;height:2.2em;justify-content:center;margin:0 1.875em;width:2.2em}div:where(.swal2-container) button:where(.swal2-styled){box-shadow:0 0 0 3px transparent;font-weight:500;margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){background:initial;background-color:#7066e0;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){background:initial;background-color:#dc3741;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){background:initial;background-color:#6e7881;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px hsla(208,8%,47%,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){border-top:1px solid #eee;color:inherit;font-size:1em;margin:1em 0 0;padding:1em 1em 0;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{border-bottom-left-radius:5px;border-bottom-right-radius:5px;bottom:0;grid-column:auto!important;left:0;overflow:hidden;position:absolute;right:0}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){background:rgba(0,0,0,.2);height:.25em;width:100%}div:where(.swal2-container) img:where(.swal2-image){margin:2em auto 1em;max-width:100%}div:where(.swal2-container) button:where(.swal2-close){align-items:center;background:transparent;border:none;border-radius:5px;color:#ccc;cursor:pointer;font-family:monospace;font-size:2.5em;height:1.2em;justify-content:center;justify-self:end;margin-bottom:-1.2em;margin-right:0;margin-top:0;overflow:hidden;padding:0;transition:color .1s,box-shadow .1s;width:1.2em;z-index:2}div:where(.swal2-container) button:where(.swal2-close):hover{background:transparent;color:#f27474;transform:none}div:where(.swal2-container) button:where(.swal2-close):focus-visible{box-shadow:inset 0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{color:inherit;font-size:1.125em;font-weight:400;justify-content:center;line-height:normal;margin:0;overflow:auto;padding:1em 1.6em .3em;text-align:center;z-index:1;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) label:where(.swal2-checkbox),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) textarea:where(.swal2-textarea){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) textarea:where(.swal2-textarea){background:transparent;border:1px solid #d9d9d9;border-radius:.1875em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;box-sizing:border-box;color:inherit;font-size:1.125em;transition:border-color .1s,box-shadow .1s;width:auto}div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) input:where(.swal2-file)::-moz-placeholder,div:where(.swal2-container) input:where(.swal2-input)::-moz-placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::-moz-placeholder{color:#ccc}div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{background:#fff;margin:1em 2em 3px}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{color:inherit;font-weight:600;text-align:center;width:20%}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{font-size:1.125em;height:2.625em;line-height:2.625em;padding:0}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{background:transparent;font-size:1.125em;margin-left:auto;margin-right:auto;width:75%}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{background:transparent;color:inherit;font-size:1.125em;max-width:100%;min-width:50%;padding:.375em .625em}div:where(.swal2-container) .swal2-checkbox,div:where(.swal2-container) .swal2-radio{align-items:center;background:#fff;color:inherit;justify-content:center}div:where(.swal2-container) .swal2-checkbox label,div:where(.swal2-container) .swal2-radio label{font-size:1.125em;margin:0 .6em}div:where(.swal2-container) .swal2-checkbox input,div:where(.swal2-container) .swal2-radio input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;justify-content:center;margin:1em 0 0;overflow:hidden;padding:.625em}div:where(.swal2-container) div:where(.swal2-validation-message):before{background-color:#f27474;border-radius:50%;color:#fff;content:"!";display:inline-block;font-weight:600;height:1.5em;line-height:1.5em;margin:0 .625em;min-width:1.5em;text-align:center;width:1.5em}div:where(.swal2-container) .swal2-progress-steps{align-items:center;background:transparent;flex-wrap:wrap;font-weight:600;margin:1.25em auto;max-width:100%;padding:0}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{background:#2778c4;border-radius:2em;color:#fff;flex-shrink:0;height:2em;line-height:2em;text-align:center;width:2em;z-index:20}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{background:#2778c4;flex-shrink:0;height:.4em;margin:0 -1px;width:2.5em;z-index:10}div:where(.swal2-icon){border:.25em solid #000;border-radius:50%;box-sizing:content-box;cursor:default;font-family:inherit;height:5em;justify-content:center;line-height:5em;margin:2.5em auto .6em;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5em}div:where(.swal2-icon) .swal2-icon-content{align-items:center;display:flex;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{flex-grow:1;position:relative}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{background-color:#f27474;border-radius:.125em;display:block;height:.3125em;position:absolute;top:2.3125em;width:2.9375em}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:7.5em;position:absolute;width:3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:7.5em 0 0 7.5em;left:-2.0635em;top:-.4375em;transform:rotate(-45deg);transform-origin:3.75em 3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 7.5em 7.5em 0;left:1.875em;top:-.6875em;transform:rotate(-45deg);transform-origin:0 3.75em}div:where(.swal2-icon).swal2-success .swal2-success-ring{border:.25em solid hsla(98,55%,69%,.3);border-radius:50%;box-sizing:content-box;height:100%;left:-.25em;position:absolute;top:-.25em;width:100%;z-index:2}div:where(.swal2-icon).swal2-success .swal2-success-fix{height:5.625em;left:1.625em;position:absolute;top:.5em;transform:rotate(-45deg);width:.4375em;z-index:1}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{background-color:#a5dc86;border-radius:.125em;display:block;height:.3125em;position:absolute;z-index:2}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{left:.8125em;top:2.875em;transform:rotate(45deg);width:1.5625em}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{right:.5em;top:2.375em;transform:rotate(-45deg);width:2.9375em}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{height:50px;overflow:scroll;position:absolute;top:-9999px;width:50px}.swal2-rtl .swal2-close{margin-left:0;margin-right:0}.swal2-rtl .swal2-timer-progress-bar{left:auto;right:0}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotate(2deg)}33%{transform:translateY(0) rotate(-2deg)}66%{transform:translateY(.3125em) rotate(2deg)}to{transform:translateY(0) rotate(0deg)}}@keyframes swal2-toast-hide{to{opacity:0;transform:rotate(1deg)}}@keyframes swal2-toast-animate-success-line-tip{0%{left:.0625em;top:.5625em;width:0}54%{left:.125em;top:.125em;width:0}70%{left:-.25em;top:.625em;width:1.625em}84%{left:.75em;top:1.0625em;width:.5em}to{left:.1875em;top:1.125em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{right:1.375em;top:1.625em;width:0}65%{right:.9375em;top:1.25em;width:0}84%{right:0;top:.9375em;width:1.125em}to{right:.1875em;top:.9375em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}to{transform:scale(1)}}@keyframes swal2-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.5)}}@keyframes swal2-animate-success-line-tip{0%{left:.0625em;top:1.1875em;width:0}54%{left:.125em;top:1.0625em;width:0}70%{left:-.375em;top:2.1875em;width:3.125em}84%{left:1.3125em;top:3em;width:1.0625em}to{left:.8125em;top:2.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{right:2.875em;top:3.375em;width:0}65%{right:2.875em;top:3.375em;width:0}84%{right:0;top:2.1875em;width:3.4375em}to{right:.5em;top:2.375em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}to{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;opacity:0;transform:scale(.4)}50%{margin-top:1.625em;opacity:0;transform:scale(.4)}80%{margin-top:-.375em;transform:scale(1.15)}to{margin-top:0;opacity:1;transform:scale(1)}}@keyframes swal2-animate-error-icon{0%{opacity:0;transform:rotateX(100deg)}to{opacity:1;transform:rotateX(0deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-1turn)}to{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{opacity:0;transform:rotate(45deg)}25%{opacity:.4;transform:rotate(-25deg)}50%{opacity:.8;transform:rotate(15deg)}75%{opacity:1;transform:rotate(-5deg)}to{opacity:1;transform:rotateX(0)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent;box-sizing:border-box;max-width:100%;pointer-events:none;width:360px}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}',"",{version:3,sources:["webpack://./node_modules/sweetalert2/src/scss/_toasts.scss","webpack://./node_modules/sweetalert2/src/variables.scss","webpack://./node_modules/sweetalert2/src/scss/_core.scss","webpack://./node_modules/sweetalert2/src/scss/_icons.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-animations.scss","webpack://./node_modules/sweetalert2/src/scss/_animations.scss","webpack://./node_modules/sweetalert2/src/scss/_mixins.scss","webpack://./node_modules/sweetalert2/src/scss/_body.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-body.scss"],names:[],mappings:"AACE,yBAOE,eCRU,CDSV,sJCqOF,CD5OE,qBAAA,CACA,yBAAA,CACA,sBAAA,CACA,kDAAA,CAEA,iBAAA,CADA,WCmPkB,CD/OlB,kBAAA,CAEA,2BACE,aAAA,CAGF,sCAGE,aCyOwB,CD3OxB,eCyOqB,CDxOrB,SCyOsB,CDvOtB,kBAAA,CAGF,wCACE,sBAAA,CAGF,sCAGE,aCqOwB,CDvOxB,UCqOqB,CDpOrB,WCsOwB,CDlO1B,mDACE,aCkO6B,CD/N/B,uCAGE,cCgOyB,CDlOzB,eCgOsB,CD/NtB,gBCiOyB,CD7N3B,sCAGE,iBAAA,CAIA,aCqM+B,CD3M/B,eAAA,CACA,aAAA,CAGA,WCqM4B,CDpM5B,QCqM4B,CDvM5B,UCwM+B,CDlMjC,+CAIE,aCuMiC,CD1MjC,eCwM8B,CDtM9B,gBAAA,CADA,SCwM+B,CDrM/B,kBAAA,CAEA,qDACE,SAAA,CAIJ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,SAAA,CADA,yBACA,CAGF,GAEE,SAAA,CADA,uBACA,CAAA,CAIJ,gCACE,GACE,sBAAA,CAGF,GACE,uBAAA,CAAA,CAKJ,uCACE,GACE,yBAAA,CAGF,GACE,oBAAA,CAAA,CAKJ,gCACE,GAEE,SAAA,CADA,uBACA,CAGF,IAEE,UAAA,CADA,wBACA,CAGF,IAEE,UAAA,CADA,uBACA,CAGF,IAEE,SAAA,CADA,uBACA,CAGF,GAEE,SAAA,CADA,oBACA,CAAA,CCtLF,iECPI,eAAA,CAIJ,uBACE,qBAAA,CAIA,wCACE,sCAAA,CACA,mBAAA,CAEA,qDACE,kBAAA,CAGF,qDACE,kCAAA,CAKN,aDhBA,iECmBM,2BAAA,CAEA,oFACE,YAAA,CAGF,kFACE,yBAAA,CAAA,CCpCN,wCAIE,4BAAA,CAHA,qBAAA,CAEA,cAAA,CAEA,mBAAA,CAHA,WAGA,CAEA,kDACE,qBAAA,CACA,0BAAA,CAGF,8GAEE,mBAAA,CAGF,+GAEE,mBAAA,CAGF,qHAEE,qBAAA,CACA,0BAAA,CAGF,qDACE,uBAAA,CACA,8BAAA,CAGF,oHAEE,qBAAA,CACA,0BAAA,CAGF,qHAEE,mBAAA,CAGF,qDACE,qBAAA,CACA,0BAAA,CAGF,oHAEE,mBAAA",sourceRoot:""}]);const o=a},663:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".rc-buttons{z-index:10}.rc-absolute-buttons{bottom:1.25rem;position:fixed;right:1.25rem;text-align:right}.rc-button{border:none!important;border-radius:7px!important;cursor:pointer;font-size:1rem!important;font-weight:700!important;line-height:150%!important;margin:.25rem!important;padding:1rem 1.5rem!important;text-align:center!important}.rc-go-button{background:rgba(255,154,0,.667)!important;color:#fff!important}.rc-go-button:hover{background:#ff9a00!important}.rc-go-button:active{background:#d68200!important}.rc-cancel-button,.rc-custom-button{background:hsla(0,0%,100%,.933)!important;color:#333!important}.rc-cancel-button:hover,.rc-custom-button:hover{background:#ddd!important}.rc-cancel-button:active,.rc-custom-button:active{background:#aaa!important;color:#000!important}.rc-button:disabled{background:#ddd!important;color:#999!important;cursor:default!important}","",{version:3,sources:["webpack://./src/css/buttons.scss"],names:[],mappings:"AAAA,YACE,UAAA,CAGF,qBAGE,cAAA,CAFA,cAAA,CAGA,aAAA,CAFA,gBAEA,CAGF,WAEE,qBAAA,CAMA,2BAAA,CACA,cAAA,CALA,wBAAA,CACA,yBAAA,CAFA,0BAAA,CAIA,uBAAA,CADA,6BAAA,CALA,2BAQA,CAGF,cACE,yCAAA,CACA,oBAAA,CAEA,oBACE,4BAAA,CAGF,qBACE,4BAAA,CAIJ,oCAEE,yCAAA,CACA,oBAAA,CAEA,gDACE,yBAAA,CAGF,kDACE,yBAAA,CACA,oBAAA,CAIJ,oBACE,yBAAA,CACA,oBAAA,CACA,wBAAA",sourceRoot:""}]);const o=a},290:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".my__swal2__container .swal2-select{border:2px solid #aaa!important;border-radius:5px!important;font-family:inherit!important;font-size:1.2rem!important;margin:auto 1.6rem!important;outline:none!important;padding-top:.5rem!important}.rc-form{font-family:inherit;font-size:2rem;pointer-events:auto!important}.rc-form .rc-form-inputs{display:flex;justify-content:space-between!important;margin:1rem 0}.rc-form .rc-form-inputs .rc-form-input,.rc-form .rc-form-inputs span{flex-grow:1;font-family:inherit;font-size:inherit;padding:.5rem}.rc-form .rc-form-inputs span{font-weight:700}.rc-form .rc-form-input{border:2px solid #aaa;border-radius:5px;outline:none;width:min(100%,10rem)}.rc-form .rc-form-input.rc-input-error{border-color:#ac0d0d!important;color:#ac0d0d!important}.rc-form .rc-form-input+.rc-form-input{margin-left:.5rem}.arrow-two-sided-svg{position:fixed}.arrow-two-sided-svg .arrow-two-sided{fill:#ff9a00}.arrow-two-sided-horizontal{bottom:10%;left:0;right:0;width:100%}.arrow-two-sided-vertical{bottom:0;height:100%;right:5%;top:0}","",{version:3,sources:["webpack://./src/css/check.scss"],names:[],mappings:"AAAA,oCAME,+BAAA,CADA,2BAAA,CADA,6BAAA,CAHA,0BAAA,CACA,4BAAA,CAKA,sBAAA,CAJA,2BAIA,CAOF,SAEE,mBAAA,CADA,cAAA,CAEA,6BAAA,CAEA,yBACE,YAAA,CACA,uCAAA,CACA,aAAA,CAEA,sEAEE,WAAA,CAEA,mBAAA,CACA,iBAAA,CAFA,aAEA,CAGF,8BACE,eAAA,CAIJ,wBACE,qBAAA,CAEA,iBAAA,CADA,YAAA,CAEA,qBAAA,CAEA,uCACE,8BAAA,CACA,uBAAA,CAIJ,uCACE,iBAAA,CAIJ,qBACE,cAAA,CAEA,sCACE,YAAA,CAIJ,4BAEE,UAAA,CACA,MAAA,CACA,OAAA,CAHA,UAGA,CAGF,0BAIE,QAAA,CAHA,WAAA,CACA,QAAA,CACA,KACA",sourceRoot:""}]);const o=a},2945:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#eye-side{font-weight:700}#blind-spot-canvas{bottom:0;display:block;left:0;margin:0;padding:0;position:fixed;right:0;top:0;z-index:-1}#blind-spot-instruction{max-width:unset!important}@media(min-width:641px){#blind-spot-instruction{font-size:1.1rem!important;width:65%!important}}@media(max-width:640px){#blind-spot-instruction{font-size:.9rem!important;width:90%!important}}#pip-video{display:none}#video-canvas{border-radius:6px;bottom:1rem;display:block;left:1rem;position:absolute;z-index:1000}#rc-ruler{cursor:pointer;max-height:120px;overflow:hidden;position:fixed;-webkit-user-select:none;-moz-user-select:none;user-select:none}#rc-ruler-scales{left:30px;pointer-events:none;position:absolute;top:0;z-index:1}#rc-ruler-scales #size-arrow{opacity:.5;transform:rotate(90deg) translateY(calc(50% + 3px))}#rc-ruler-scales .rc-ruler-scale-text{color:rgba(44,46,67,.667);font-weight:700;margin:0!important;padding:0;position:absolute;top:32px!important;transform:translate(-50%)!important}#rc-ruler-scales .rc-ruler-scale{display:block;position:absolute;top:0;transform:translate(-1px);width:2px;z-index:2}#rc-ruler-scales .rc-ruler-major{background-color:rgba(44,46,67,.933);height:30px}#rc-ruler-scales .rc-ruler-secondary{background-color:rgba(89,82,96,.867);height:24px}#rc-ruler-scales .rc-ruler-minor{background-color:rgba(89,82,96,.4);height:16px}.hide-nudger .calibration-nudger{display:none!important;opacity:0!important}.calibration-nudger,.gaze-nudger{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999999}.calibration-nudger *,.gaze-nudger *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#rc-distance-correct{margin:0 auto auto;overflow-wrap:break-word;padding:2rem;text-align:center;width:100%}#rc-distance-correct #rc-distance-correct-instruction{font-size:7rem;font-weight:700;line-height:100%;margin:0 auto 2rem}#rc-distance-correct #rc-distance-correct-guide{font-size:3rem;font-weight:500;line-height:200%}#rc-distance-correct #rc-distance-correct-guide .rc-distance-num{border-radius:7px!important;font-family:monospace!important;font-size:9rem;font-weight:700;padding:.5rem;vertical-align:middle}","",{version:3,sources:["webpack://./src/css/distance.scss"],names:[],mappings:"AAAA,UACE,eAAA,CAGF,mBAME,QAAA,CAJA,aAAA,CAGA,MAAA,CAIA,QAAA,CADA,SAAA,CAPA,cAAA,CAMA,OAAA,CAHA,KAAA,CADA,UAMA,CAGF,wBAEE,yBAAA,CAGF,wBACE,wBAEE,0BAAA,CADA,mBACA,CAAA,CAIJ,wBACE,wBAEE,yBAAA,CADA,mBACA,CAAA,CAIJ,WACE,YAAA,CAGF,cAME,iBAAA,CAFA,WAAA,CADA,aAAA,CAEA,SAAA,CAHA,iBAAA,CADA,YAKA,CAKF,UAKE,cAAA,CAHA,gBAAA,CACA,eAAA,CAFA,cAAA,CAKA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAGF,iBAGE,SAAA,CAEA,mBAAA,CAJA,iBAAA,CACA,KAAA,CAEA,SACA,CAEA,6BAEE,UAAA,CADA,mDACA,CAGF,sCAKE,yBAAA,CACA,eAAA,CAHA,kBAAA,CACA,SAAA,CAHA,iBAAA,CACA,kBAAA,CAKA,mCAAA,CAGF,iCAEE,aAAA,CADA,iBAAA,CAEA,KAAA,CAEA,yBAAA,CADA,SAAA,CAEA,SAAA,CAGF,iCACE,oCAAA,CACA,WAAA,CAGF,qCACE,oCAAA,CACA,WAAA,CAGF,iCACE,kCAAA,CACA,WAAA,CAOF,iCACE,sBAAA,CACA,mBAAA,CAIJ,iCASE,QAAA,CAIA,qBAAA,CARA,WAAA,CAEA,MAAA,CAGA,QAAA,CACA,eAAA,CARA,cAAA,CAKA,OAAA,CAOA,oBAAA,CADA,iBAAA,CARA,KAAA,CAMA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CARA,UAAA,CAFA,iBAaA,CAEA,qCACE,wHAAA,CAKJ,qBAGE,kBAAA,CAEA,wBAAA,CADA,YAAA,CAHA,iBAAA,CACA,UAGA,CAEA,sDAEE,cAAA,CADA,eAAA,CAGA,gBAAA,CADA,kBACA,CAGF,gDAEE,cAAA,CADA,eAAA,CAEA,gBAAA,CAEA,iEAEE,2BAAA,CAEA,+BAAA,CAEA,cAAA,CAHA,eAAA,CAFA,aAAA,CAIA,qBACA",sourceRoot:""}]);const o=a},4636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,":root{--rc-panel-theme-color:#3490de;--rc-panel-darken-color:#185b94;--rc-panel-theme-color-semi:#3490de66;--rc-panel-darken-color-semi:#185b9488}.rc-panel{background-color:var(--rc-panel-theme-color);border-radius:10px!important;box-shadow:var(--rc-panel-darken-color-semi) 0 50px 100px -20px,var(--rc-panel-theme-color-semi) 0 30px 60px -30px!important;display:block;margin-left:auto!important;margin-right:auto!important;max-width:720px!important;overflow:hidden;padding:.75rem!important;position:relative;width:100%}.rc-panel *{box-sizing:border-box;outline:none;text-rendering:optimizeLegibility;vertical-align:baseline;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-kerning:normal;scrollbar-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-panel .rc-panel-title{color:#fff!important;font-size:2rem!important;font-weight:600!important;margin:1rem 1rem 0!important}.rc-panel .rc-panel-description{color:hsla(0,0%,100%,.8)!important;font-size:1rem!important;font-weight:500!important;margin:.5rem 1rem 0!important}.rc-panel #rc-panel-language-parent{display:flex;flex-direction:row-reverse;margin:0;padding:0}.rc-panel #rc-panel-language-parent #rc-panel-lang-picker{background-color:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:5px!important;display:block;font-size:1rem!important;font-weight:500!important;margin:.25rem .25rem 0!important;outline:none!important;padding:.25rem!important}.rc-panel .rc-panel-steps{margin:-3rem 0 0!important;padding-top:4rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l,.rc-panel .rc-panel-steps.rc-panel-steps-s{display:flex!important;justify-content:space-between!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{background:hsla(0,0%,100%,.8);flex-grow:1!important;margin:.25rem!important;padding:0!important;position:relative;text-align:center;transition:background-color .2s}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use{font-size:1rem!important;line-height:170%!important;margin:0!important;padding:0 .3rem!important;position:absolute;right:0;top:0}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use svg,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use svg{height:1rem;width:1rem;fill:var(--rc-panel-darken-color)}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-name,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-name{color:var(--rc-panel-darken-color);font-size:1rem!important;font-weight:700!important;line-height:150%!important;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-l{flex-flow:row nowrap;max-width:100%;overflow-x:scroll}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-name{margin:1.5rem .5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-use-tip{bottom:110%!important;display:flex!important;left:50%!important;position:absolute!important;transform:translate(-50%)!important}.rc-panel .rc-panel-steps.rc-panel-steps-s{flex-flow:column nowrap;overflow-x:hidden}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{overflow-x:hidden;text-align:left;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-name{margin:1.2rem .75rem 1.2rem 1.5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-use-tip{display:inline-flex!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step{border:none!important;border-radius:7px!important}.rc-panel .rc-panel-steps .rc-panel-step .rc-panel-step-name{display:inline-block!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip{align-items:center!important;background-color:rgba(255,154,0,.933)!important;border:none!important;border-radius:7px!important;color:#fff!important;font-size:.75rem!important;font-weight:500!important;justify-content:center!important;line-height:100%!important;margin:0!important;opacity:0;padding:.7rem .5rem!important;pointer-events:none;text-align:center!important;transition:opacity .2s;width:-moz-max-content!important;width:max-content!important;z-index:10!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg{height:.75rem;width:.75rem;fill:#fff}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg:last-of-type{margin-right:5px}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover{background-color:#fff}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus .rc-panel-step-use-tip,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover .rc-panel-step-use-tip{opacity:1!important}.rc-panel .rc-panel-steps .rc-panel-step-todo:active{background-color:hsla(0,0%,93%,.8)}.rc-panel .rc-panel-steps .rc-panel-step-finished{background-color:hsla(0,0%,73%,.8)!important}.rc-panel .rc-panel-steps .rc-panel-step-inactive{opacity:.6;pointer-events:none}.rc-panel .rc-panel-steps .rc-panel-step-active{cursor:pointer;opacity:1}.rc-panel ::-webkit-scrollbar{display:none;width:0}.rc-panel .rc-panel-debug-control{background-color:hsla(0,0%,100%,.8);border:3px solid #e00;border-radius:7px;margin:1rem 0 0;overflow:hidden;padding:.5rem}.rc-panel .rc-panel-debug-control *{color:#ac0d0d}.rc-panel .rc-panel-debug-control h2,.rc-panel .rc-panel-debug-control h3,.rc-panel .rc-panel-debug-control p{margin:0!important}.rc-panel .rc-panel-debug-control h2{font-size:1.2rem!important;font-weight:700!important}.rc-panel .rc-panel-debug-control h3{font-size:.9rem;font-variant:small-caps;font-weight:500;padding-bottom:.3rem;padding-top:.5rem}.rc-panel .rc-panel-debug-control .rc-panel-debug-bold-text{font-size:1rem!important;font-weight:700}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next{background-color:#e00;border:none;border-radius:5px;color:#fff;cursor:pointer;font-size:.9rem!important;margin:1rem 0 0;padding:.5rem 1.2rem!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next:hover{background-color:#ac0d0d}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row{display:inline-flex;justify-content:flex-start!important;width:100%}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element{flex-grow:1;overflow-x:hidden;padding:0 .1rem;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:first-of-type{padding-left:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:last-of-type{padding-right:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element p{color:#ac0d0d;font-size:.65rem!important;line-height:150%!important;padding-left:1px!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element input{background-color:hsla(0,0%,100%,.8);border:1px solid #e99!important;border-radius:3px!important;font-size:.8rem;margin:0!important;padding:.3rem!important;pointer-events:auto;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto;width:100%}","",{version:3,sources:["webpack://./src/css/panel.scss"],names:[],mappings:"AAAA,MACE,8BAAA,CACA,+BAAA,CACA,qCAAA,CACA,sCAAA,CAGF,UAKE,4CAAA,CAIA,4BAAA,CACA,4HACE,CATF,aAAA,CACA,0BAAA,CACA,2BAAA,CAGA,yBAAA,CAMA,eAAA,CALA,wBAAA,CAPA,iBAAA,CAKA,UAOA,CAEA,YAGE,qBAAA,CAFA,YAAA,CAGA,iCAAA,CAFA,uBAAA,CAGA,2BAAA,CACA,iCAAA,CAGA,wHAAA,CAFA,mBAAA,CAIA,oBAAA,CAHA,wBAAA,CAAA,qBAAA,CAAA,gBAGA,CAGF,0BACE,oBAAA,CAEA,wBAAA,CACA,yBAAA,CAFA,4BAEA,CAGF,gCACE,kCAAA,CAEA,wBAAA,CACA,yBAAA,CAFA,6BAEA,CAGF,oCACE,YAAA,CACA,0BAAA,CACA,QAAA,CACA,SAAA,CAEA,0DAEE,6CAAA,CACA,qBAAA,CAMA,2BAAA,CARA,aAAA,CAMA,wBAAA,CACA,yBAAA,CAHA,gCAAA,CADA,sBAAA,CAEA,wBAGA,CAIJ,0BACE,0BAAA,CACA,0BAAA,CAEA,sFAEE,sBAAA,CACA,uCAAA,CAEA,oHAME,6BAAA,CAJA,qBAAA,CACA,uBAAA,CAEA,mBAAA,CAJA,iBAAA,CAGA,iBAAA,CAGA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CAGF,4DACE,wBAAA,CACA,eAAA,CAGF,+DAIE,qBAAA,CAGA,WAAA,CADA,iBAAA,CAHA,UAAA,CAKA,cAAA,CAPA,yBAAA,CACA,eAAA,CAGA,8BAGA,CAEA,qEACE,wBAAA,CAIJ,mEACE,mBAAA,CACA,oCAAA,CACA,UAAA,CAEA,kFACE,WAAA,CAEA,iBAAA,CADA,eAAA,CAKA,mBAAA,CADA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAFA,kBAGA,CAEA,gGACE,cAAA,CAGF,+FACE,eAAA,CAGF,oFAIE,aAAA,CADA,0BAAA,CADA,0BAAA,CADA,0BAGA,CAGF,wFAOE,mCAAA,CAFA,+BAAA,CACA,2BAAA,CAHA,eAAA,CAFA,kBAAA,CACA,uBAAA,CAOA,mBAAA,CADA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAJA,UAKA",sourceRoot:""}]);const o=a},5151:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#size-card,#size-usba,#size-usbc{display:block;height:auto;left:2rem;position:absolute;z-index:2}#size-arrow{display:block;height:auto;position:absolute;width:70px;z-index:1}#size-arrow-fill{transition:fill .3s}.minor{transition:opacity .25s}.rc-slider:active~.size-obj .minor{opacity:0}#matching-obj{background-color:#fff;border:none;border-radius:7px;font-size:1.1rem;font-weight:600;margin-bottom:unset;margin-left:.3rem;margin-right:.3rem;margin-top:unset;padding-bottom:unset;padding-left:.3rem;padding-right:.3rem;padding-top:unset;pointer-events:auto!important;vertical-align:middle}@media(min-width:481px){.rc-size-obj-selection{display:inline-flex}}@media(max-width:480px){.rc-size-obj-selection{display:inline-block}}","",{version:3,sources:["webpack://./src/css/screenSize.scss"],names:[],mappings:"AAAA,iCAIE,aAAA,CAGA,WAAA,CADA,SAAA,CAHA,iBAAA,CAKA,SAAA,CAGF,YAEE,aAAA,CAGA,WAAA,CAJA,iBAAA,CAGA,UAAA,CAEA,SAAA,CAGF,iBACE,mBAAA,CAGF,OACE,uBAAA,CAIF,mCACE,SAAA,CAKF,cAGE,qBAAA,CADA,WAAA,CADA,iBAAA,CAMA,gBAAA,CADA,eAAA,CADA,mBAAA,CAAA,iBAAA,CAAA,kBAAA,CAAA,gBAAA,CADA,oBAAA,CAAA,kBAAA,CAAA,mBAAA,CAAA,iBAAA,CAKA,6BAAA,CADA,qBACA,CAGF,wBACE,uBACE,mBAAA,CAAA,CAIJ,wBACE,uBACE,oBAAA,CAAA",sourceRoot:""}]);const o=a},5319:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".rc-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(90deg,#ffc772,#ffc772 60%,#fff 0);border-radius:5px;cursor:grab;direction:ltr!important;display:block;height:10px;left:2rem;opacity:1;position:absolute;transition:opacity .3s;width:calc(100% - 4rem);z-index:10}.rc-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-ms-thumb{appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}","",{version:3,sources:["webpack://./src/css/slider.scss"],names:[],mappings:"AAAA,WAGE,uBAAA,CAAA,oBAAA,CAAA,eAAA,CAGA,4DAAA,CAIA,iBAAA,CAEA,WAAA,CAEA,uBAAA,CAZA,aAAA,CAGA,WAAA,CAIA,SAAA,CAFA,SAAA,CANA,iBAAA,CAYA,sBAAA,CATA,uBAAA,CAOA,UAGA,CAkBF,iCAVE,uBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAOF,6BAdE,oBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAWF,sBAlBE,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA",sourceRoot:""}]);const o=a},4889:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#webgazerVideoContainer .webgazer-videoinput-select{background:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:.6rem!important;color:#666;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.6rem;left:0;line-height:100%;margin:.3rem;outline:none!important;padding:.2rem .3rem;position:absolute;top:0;z-index:9}","",{version:3,sources:["webpack://./src/css/video.scss"],names:[],mappings:"AACE,oDAcE,uCAAA,CAHA,qBAAA,CAEA,6BAAA,CAEA,UAAA,CARA,wHAAA,CAEA,eAAA,CALA,MAAA,CAMA,gBAAA,CALA,YAAA,CAOA,sBAAA,CANA,mBAAA,CAJA,iBAAA,CACA,KAAA,CAFA,SAcA",sourceRoot:""}]);const o=a},9057:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#gaze-system-instruction{top:65%;white-space:pre}.gaze-nudge-instruction{top:65%}.gaze-calibration-dot{background:#ff005c80;cursor:auto;display:block;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;z-index:999999998}.gaze-calibration-dot-click{background:#ff005c;cursor:pointer;margin:auto;position:absolute;text-align:center;vertical-align:middle}.gaze-calibration-dot-click:active{opacity:.3}.gaze-calibration-dot-text{color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.9rem;font-weight:500;vertical-align:text-bottom}#webgazerGazeDot,#webgazerGazeDot-tempClone,.gaze-calibration-dot-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerGazeDot,#webgazerGazeDot-tempClone{background-color:#111d5e;border-radius:5px;opacity:.5;position:fixed;z-index:9999999999}#webgazerVideoContainer{border-radius:5px;display:block;overflow:hidden;position:fixed!important;transform-origin:bottom left;z-index:999999997}#webgazerFaceFeedbackBox,#webgazerVideoContainer,#webgazerVideoContainer *{-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerFaceFeedbackBox{border-radius:10px;box-sizing:border-box;opacity:.6;pointer-events:none}.rc-crosshair,.rc-gaze-nudger-arrows{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-crosshair{border-radius:50%;cursor:pointer;display:block;height:40px;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;width:40px;z-index:999999999}.rc-crosshair-component{background-color:#000;left:50%;margin:auto;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}","",{version:3,sources:["webpack://./src/css/gaze.css"],names:[],mappings:"AAAA,yBACE,OAAQ,CACR,eACF,CAEA,wBACE,OACF,CAEA,sBACE,oBAAqB,CAGrB,WAAe,CADf,aAAc,CADd,wBAA0B,CAI1B,sCAAuC,CACvC,gDAIa,CANb,iBAOF,CAEA,4BAEE,kBAAmB,CAEnB,cAAe,CADf,WAAY,CAFZ,iBAAkB,CAIlB,iBAAkB,CAClB,qBACF,CAEA,mCACE,UACF,CAEA,2BAIE,UAAW,CAHX,wHAC8D,CAG9D,eAAiB,CAFjB,eAAgB,CAGhB,0BAGF,CAIA,uEALE,mBAAoB,CADpB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAeF,CATA,4CAKE,wBAAyB,CACzB,iBAAkB,CAFlB,UAAY,CAFZ,cAAe,CACf,kBAMF,CAEA,wBAKE,iBAAkB,CAHlB,aAAc,CAKd,eAAgB,CAJhB,wBAA0B,CAC1B,4BAA6B,CAH7B,iBASF,CAMA,2EAPE,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAcF,CAPA,yBAGE,kBAAmB,CADnB,qBAAsB,CAEtB,UAAY,CACZ,mBAEF,CAIA,qCAEE,iBAAkB,CAIlB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBACF,CAEA,cAcE,iBAAkB,CARlB,cAAe,CAJf,aAAc,CAEd,WAAY,CAHZ,wBAA0B,CAM1B,sCAAuC,CACvC,gDAIa,CATb,UAAW,CAEX,iBAUF,CAEA,wBAQE,qBAAsB,CALtB,QAAS,CAET,WAAY,CACZ,mBAAoB,CALpB,iBAAkB,CAClB,OAAQ,CAER,8BAAgC,CAGhC,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAEF",sourcesContent:["#gaze-system-instruction {\n top: 65%;\n white-space: pre;\n}\n\n.gaze-nudge-instruction {\n top: 65%;\n}\n\n.gaze-calibration-dot {\n background: #ff005c80;\n position: fixed !important;\n display: block;\n cursor: initial;\n z-index: 999999998;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n}\n\n.gaze-calibration-dot-click {\n position: absolute;\n background: #ff005c;\n margin: auto;\n cursor: pointer;\n text-align: center;\n vertical-align: middle;\n}\n\n.gaze-calibration-dot-click:active {\n opacity: 0.3;\n}\n\n.gaze-calibration-dot-text {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-weight: 500;\n color: #fff;\n font-size: 0.9rem;\n vertical-align: text-bottom;\n user-select: none;\n pointer-events: none;\n}\n\n/* ----------------------------- WebGazer Native ---------------------------- */\n\n#webgazerGazeDot,\n#webgazerGazeDot-tempClone {\n position: fixed;\n z-index: 9999999999;\n opacity: 0.5;\n background-color: #111d5e;\n border-radius: 5px;\n pointer-events: none;\n user-select: none;\n}\n\n#webgazerVideoContainer {\n z-index: 999999997;\n display: block;\n position: fixed !important;\n transform-origin: bottom left;\n border-radius: 5px;\n /* opacity: 0.8; */\n overflow: hidden;\n /* pointer-events: none; */\n user-select: none;\n}\n\n#webgazerVideoContainer * {\n user-select: none;\n}\n\n#webgazerFaceFeedbackBox {\n /* TODO Set style in sub-module */\n box-sizing: border-box;\n border-radius: 10px;\n opacity: 0.6;\n pointer-events: none;\n user-select: none;\n}\n\n/* ------------------------------- Gaze Nudger ------------------------------ */\n\n.rc-crosshair,\n.rc-gaze-nudger-arrows {\n position: absolute;\n /* top: 50%;\n left: 50%;\n transform: translate(-50%, -50%); */\n user-select: none;\n}\n\n.rc-crosshair {\n position: fixed !important;\n display: block;\n width: 40px;\n height: 40px;\n z-index: 999999999;\n cursor: pointer;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n /* filter: drop-shadow(0 0 3px #fff); */\n border-radius: 50%;\n}\n\n.rc-crosshair-component {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n margin: auto;\n pointer-events: none;\n user-select: none;\n background-color: #000;\n}\n"],sourceRoot:""}]);const o=a},9725:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,"#calibration-background{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;overflow-y:scroll;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999990}#calibration-background::-webkit-scrollbar{display:none;width:0}#calibration-background *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#calibration-background p{line-height:150%}.calibration-instruction{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.calibration-instruction-scrollable{height:200%}.calibration-instruction h1{font-weight:700;min-width:360px}.calibration-instruction *{font-size:1.2rem;line-height:170%;margin:0;padding:0}.calibration-instruction p{margin-top:1rem;white-space:pre-line}.calibration-description{line-height:170%}.rc-hang-description{font-size:1rem!important;margin-top:50vh!important}@media (min-width:481px){.calibration-instruction{margin:2rem}.calibration-instruction h1{font-size:2.5rem!important;line-height:100%}.calibration-description{width:calc(100% - 4rem);width:max(min(100% - 4rem,960px),300px)}.calibration-description,.calibration-description *{font-size:1.2rem}.calibration-credit-text{font-size:.9rem!important}}@media (max-width:480px){.calibration-instruction{margin:1rem}.calibration-instruction h1{font-size:1.8rem!important;line-height:120%}.calibration-description{width:calc(100% - 1rem)}.calibration-description,.calibration-description *{font-size:1rem}.calibration-credit-text{font-size:.7rem!important}}.float-instruction{background:hsla(0,0%,100%,.9);border-radius:10px;font-size:1rem;font-weight:500;left:50%;margin:0;max-width:25rem;padding:10px 17px;position:fixed;text-align:center;transform:translate(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:999999991}.swal2-container{z-index:999999999!important}.calibration-credit-text{bottom:3px!important;color:#999!important;line-height:100%!important;margin:0!important;padding:0!important;position:fixed!important;text-align:center!important;width:100%!important}.lock-view{overflow:hidden!important}.rc-lang-ltr{direction:ltr!important;text-align:left!important}.rc-lang-rtl{direction:rtl!important;text-align:right!important}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}","",{version:3,sources:["webpack://./src/css/main.css"],names:[],mappings:"AACA,wBAQE,QAAS,CAMT,qBAAsB,CAVtB,WAAY,CAEZ,MAAO,CAGP,QAAS,CAET,eAAgB,CAChB,iBAAkB,CAVlB,cAAe,CAKf,OAAQ,CASR,oBAAqB,CADrB,iBAAkB,CAVlB,KAAM,CAQN,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAAiB,CAVjB,UAAW,CAFX,iBAgBF,CAEA,2CAEE,YAAa,CADb,OAEF,CAEA,0BACE,wHAEF,CAEA,0BACE,gBACF,CAEA,yBAGE,mBAAoB,CAFpB,iBAAkB,CAClB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAEF,CAEA,oCACE,WACF,CAEA,4BAEE,eAAgB,CADhB,eAEF,CAEA,2BACE,gBAAiB,CACjB,gBAAiB,CACjB,QAAS,CACT,SACF,CAEA,2BAEE,eAAgB,CADhB,oBAEF,CAEA,yBACE,gBACF,CAEA,qBAEE,wBAA0B,CAD1B,yBAEF,CAKA,yBACE,yBACE,WACF,CAEA,4BAEE,0BAA4B,CAD5B,gBAEF,CAEA,yBACE,uBAAwB,CACxB,uCACF,CAEA,oDAEE,gBACF,CAEA,yBACE,yBACF,CACF,CAEA,yBACE,yBACE,WACF,CAEA,4BAEE,0BAA4B,CAD5B,gBAEF,CAEA,yBACE,uBACF,CAEA,oDAEE,cACF,CAEA,yBACE,yBACF,CACF,CAEA,mBAIE,6BAAoC,CAMpC,kBAAmB,CACnB,cAAe,CACf,eAAgB,CALhB,QAAS,CADT,QAAS,CAET,eAAgB,CAHhB,iBAAkB,CAJlB,cAAe,CACf,iBAAkB,CAOlB,yBAA6B,CAN7B,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAAiB,CAUjB,iBACF,CAIA,iBACE,2BACF,CAIA,yBAGE,oBAAsB,CACtB,oBAAsB,CAGtB,0BAA4B,CAF5B,kBAAoB,CACpB,mBAAqB,CALrB,wBAA0B,CAO1B,2BAA6B,CAN7B,oBAOF,CAIA,WACE,yBACF,CAIA,aACE,uBAAyB,CACzB,yBACF,CAEA,aACE,uBAAyB,CACzB,0BACF,CAMA,aACE,WACF,CAEA,iBACE,eACF",sourcesContent:["/* background div */\n#calibration-background {\n z-index: 999999990;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n /* background: #eee; */\n overflow: hidden;\n overflow-y: scroll;\n user-select: none;\n box-sizing: border-box;\n text-align: center;\n scrollbar-width: none;\n}\n\n#calibration-background::-webkit-scrollbar {\n width: 0;\n display: none;\n}\n\n#calibration-background * {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\n\n#calibration-background p {\n line-height: 150%;\n}\n\n.calibration-instruction {\n position: absolute;\n user-select: none;\n pointer-events: none;\n}\n\n.calibration-instruction-scrollable {\n height: 200%;\n}\n\n.calibration-instruction h1 {\n min-width: 360px;\n font-weight: 700;\n}\n\n.calibration-instruction * {\n font-size: 1.2rem;\n line-height: 170%;\n margin: 0;\n padding: 0;\n}\n\n.calibration-instruction p {\n white-space: pre-line;\n margin-top: 1rem;\n}\n\n.calibration-description {\n line-height: 170%;\n}\n\n.rc-hang-description {\n margin-top: 50vh !important;\n font-size: 1rem !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Screen size specific */\n\n@media (min-width: 481px) {\n .calibration-instruction {\n margin: 2rem;\n }\n\n .calibration-instruction h1 {\n line-height: 100%;\n font-size: 2.5rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 4rem);\n width: max(min(100% - 4rem, 960px), 300px);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1.2rem;\n }\n\n .calibration-credit-text {\n font-size: 0.9rem !important;\n }\n}\n\n@media (max-width: 480px) {\n .calibration-instruction {\n margin: 1rem;\n }\n\n .calibration-instruction h1 {\n line-height: 120%;\n font-size: 1.8rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 1rem);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1rem;\n }\n\n .calibration-credit-text {\n font-size: 0.7rem !important;\n }\n}\n\n.float-instruction {\n position: fixed;\n text-align: center;\n user-select: none;\n background: rgba(255, 255, 255, 0.9);\n padding: 10px 17px;\n margin: 0;\n left: 50%;\n max-width: 25rem;\n transform: translate(-50%, 0);\n border-radius: 10px;\n font-size: 1rem;\n font-weight: 500;\n z-index: 999999991;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.swal2-container {\n z-index: 999999999 !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.calibration-credit-text {\n position: fixed !important;\n width: 100% !important;\n bottom: 3px !important;\n color: #999 !important;\n margin: 0 !important;\n padding: 0 !important;\n line-height: 100% !important;\n text-align: center !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.lock-view {\n overflow: hidden !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.rc-lang-ltr {\n direction: ltr !important;\n text-align: left !important;\n}\n\n.rc-lang-rtl {\n direction: rtl !important;\n text-align: right !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* --------------------------------- CURSOR --------------------------------- */\n/* -------------------------------------------------------------------------- */\n\n.cursor-grab {\n cursor: grab;\n}\n\n.cursor-grabbing {\n cursor: grabbing;\n}\n"],sourceRoot:""}]);const o=a},2535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.push([e.id,".swal2-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif!important}.my__swal2__icon{font-weight:700!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__icon *{color:#ff9a00!important}.my__swal2__title{color:#000!important;font-size:2rem!important;font-weight:700!important}.my__swal2__html,.my__swal2__title{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__html{color:#444!important;font-size:1.2rem!important;font-weight:400!important;line-height:150%!important;margin:1.6rem}.my__swal2__html__center{text-align:center!important}.animate__animated.animate__fadeInUp,.animate__animated.animate__fadeOutDown{--animate-duration:400ms!important;--animate-delay:0!important}.fadeInUp,.fadeOutDown{animation-delay:0!important;animation-duration:.4s!important}","",{version:3,sources:["webpack://./src/css/swal.css"],names:[],mappings:"AAAA,iBACE,kIAEF,CAEA,iBACE,yBAA4B,CAC5B,kCAA4B,CAA5B,+BAA4B,CAA5B,0BACF,CAEA,mBACE,uBACF,CAEA,kBACE,oBAAsB,CACtB,wBAA0B,CAC1B,yBAEF,CAEA,mCAHE,kCAA4B,CAA5B,+BAA4B,CAA5B,0BAUF,CAPA,iBAEE,oBAAsB,CACtB,0BAA4B,CAE5B,yBAA8B,CAD9B,0BAA4B,CAH5B,aAMF,CAEA,yBACE,2BACF,CAEA,6EAEE,kCAAoC,CACpC,2BACF,CAEA,uBAGE,2BAA6B,CAD7B,gCAEF",sourcesContent:[".swal2-container {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n}\n\n.my__swal2__icon {\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__icon * {\n color: #ff9a00 !important;\n}\n\n.my__swal2__title {\n color: #000 !important;\n font-size: 2rem !important;\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__html {\n margin: 1.6rem;\n color: #444 !important;\n font-size: 1.2rem !important;\n line-height: 150% !important;\n font-weight: normal !important;\n user-select: none !important;\n}\n\n.my__swal2__html__center {\n text-align: center !important;\n}\n\n.animate__animated.animate__fadeInUp,\n.animate__animated.animate__fadeOutDown {\n --animate-duration: 400ms !important;\n --animate-delay: 0 !important;\n}\n\n.fadeInUp,\n.fadeOutDown {\n animation-duration: 400ms !important;\n animation-delay: 0 !important;\n}\n"],sourceRoot:""}]);const o=a},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var o=0;o0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),t.push(c))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),i="/*# ".concat(r," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},7158:function(e){var t=function(){"use strict";var e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m,g,y,b,w,v,A,x,C="leader-line",k=1,S=2,_=3,E=4,I={top:k,right:S,bottom:_,left:E},T=1,N=2,O=3,R=4,D=5,M={straight:T,arc:N,fluid:O,magnet:R,grid:D},F="behind",B=C+"-defs",z='',L={disc:{elmId:"leader-line-disc",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},square:{elmId:"leader-line-square",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},arrow1:{elmId:"leader-line-arrow1",bBox:{left:-8,top:-8,width:16,height:16,right:8,bottom:8},widthR:4,heightR:4,bCircle:8,sideLen:8,backLen:8,overhead:8,outlineBase:2,outlineMax:1.5},arrow2:{elmId:"leader-line-arrow2",bBox:{left:-7,top:-8,width:11,height:16,right:4,bottom:8},widthR:2.75,heightR:4,bCircle:8,sideLen:8,backLen:7,overhead:4,outlineBase:1,outlineMax:1.75},arrow3:{elmId:"leader-line-arrow3",bBox:{left:-4,top:-5,width:12,height:10,right:8,bottom:5},widthR:3,heightR:2.5,bCircle:8,sideLen:5,backLen:4,overhead:8,outlineBase:1,outlineMax:2.5},hand:{elmId:"leader-line-hand",bBox:{left:-3,top:-12,width:40,height:24,right:37,bottom:12},widthR:10,heightR:6,bCircle:37,sideLen:12,backLen:3,overhead:37},crosshair:{elmId:"leader-line-crosshair",noRotate:!0,bBox:{left:-96,top:-96,width:192,height:192,right:96,bottom:96},widthR:48,heightR:48,bCircle:96,sideLen:96,backLen:96,overhead:0}},P={behind:F,disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},V={disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},W=[k,S,_,E],G="auto",U={x:"left",y:"top",width:"width",height:"height"},q=80,j=4,H=5,$=120,K=8,X=3.75,Z=10,Y=30,Q=.5522847,J=.25*Math.PI,ee=/^\s*(\-?[\d\.]+)\s*(\%)?\s*$/,te="http://www.w3.org/2000/svg",ne="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style&&!window.navigator.msPointerEnabled,se=!ne&&!!document.uniqueID,re="MozAppearance"in document.documentElement.style,ie=!(ne||re||!window.chrome||!window.CSS),ae=!(ne||se||re||ie||window.chrome||!("WebkitAppearance"in document.documentElement.style)),oe=se||ne?.2:.1,le={path:O,lineColor:"coral",lineSize:4,plugSE:[F,"arrow1"],plugSizeSE:[1,1],lineOutlineEnabled:!1,lineOutlineColor:"indianred",lineOutlineSize:.25,plugOutlineEnabledSE:[!1,!1],plugOutlineSizeSE:[1,1]},ue=(v={}.toString,A={}.hasOwnProperty.toString,x=A.call(Object),function(e){var t,n;return e&&"[object Object]"===v.call(e)&&(!(t=Object.getPrototypeOf(e))||(n=t.hasOwnProperty("constructor")&&t.constructor)&&"function"==typeof n&&A.call(n)===x)}),ce=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},he=(p={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},f=1e3/60/2,m=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,f)},g=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(e){clearTimeout(e)},y=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},b=[],w=0,{add:function(e,t,n,s,r,i,a){var o,l,u,c,h,d,m,g,y,v,A,x,C,k=++w;function S(t,n){return{value:e(n),timeRatio:t,outputRatio:n}}if("string"==typeof r&&(r=p[r]),e=e||function(){},n=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex)return null;var e=null,t=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===t)e=0;else{if("1"!==t)return null;e=1}return this._skipOptionalSpacesOrDelimiter(),e}};var o=e.SVGPathElement.prototype.setAttribute,l=e.SVGPathElement.prototype.removeAttribute,u=e.Symbol?e.Symbol():"__cachedPathData",c=e.Symbol?e.Symbol():"__cachedNormalizedPathData",h=function(e,t,n,s,r,i,a,o,l,u){function c(e,t,n){return{x:e*Math.cos(n)-t*Math.sin(n),y:e*Math.sin(n)+t*Math.cos(n)}}var d,p,f,m,g,y,b,w,v,A,x,C,k,S,_,E=(d=a,Math.PI*d/180),I=[];u?(S=u[0],_=u[1],C=u[2],k=u[3]):(e=(p=c(e,t,-E)).x,t=p.y,1<(y=(m=(e-(n=(f=c(n,s,-E)).x))/2)*m/(r*r)+(g=(t-(s=f.y))/2)*g/(i*i))&&(r*=y=Math.sqrt(y),i*=y),v=(b=r*r)*(w=i*i)-b*g*g-w*m*m,A=b*g*g+w*m*m,C=(x=(o===l?-1:1)*Math.sqrt(Math.abs(v/A)))*r*g/i+(e+n)/2,k=x*-i*m/r+(t+s)/2,S=Math.asin(parseFloat(((t-k)/i).toFixed(9))),_=Math.asin(parseFloat(((s-k)/i).toFixed(9))),e120*Math.PI/180&&(T=_,N=n,O=s,_=l&&S<_?S+120*Math.PI/180*1:S+120*Math.PI/180*-1,n=C+r*Math.cos(_),s=k+i*Math.sin(_),I=h(n,s,N,O,r,i,a,0,l,[_,T,C,k])),R=_-S;var D=Math.cos(S),M=Math.sin(S),F=Math.cos(_),B=Math.sin(_),z=Math.tan(R/4),L=4/3*r*z,P=4/3*i*z,V=[e,t],W=[e+L*M,t-P*D],G=[n+L*B,s-P*F],U=[n,s];if(W[0]=2*V[0]-W[0],W[1]=2*V[1]-W[1],u)return[W,G,U].concat(I);I=[W,G,U].concat(I).join().split(",");var q=[],j=[];return I.forEach((function(e,t){t%2?j.push(c(I[t-1],I[t],E).y):j.push(c(I[t],I[t+1],E).x),6===j.length&&(q.push(j),j=[])})),q};e.SVGPathElement.prototype.setAttribute=function(e,t){"d"===e&&(this[u]=null,this[c]=null),o.call(this,e,t)},e.SVGPathElement.prototype.removeAttribute=function(e,t){"d"===e&&(this[u]=null,this[c]=null),l.call(this,e)},e.SVGPathElement.prototype.getPathData=function(e){if(e&&e.normalize){if(this[c])return i(this[c]);this[u]?d=i(this[u]):(d=r(this.getAttribute("d")||""),this[u]=i(d));var t=a((n=[],h=l=o=s=null,d.forEach((function(e){var t,r,i,a,u,c,d=e.type;"M"===d?(u=e.values[0],c=e.values[1],n.push({type:"M",values:[u,c]}),s=l=u,o=h=c):"m"===d?(u=s+e.values[0],c=o+e.values[1],n.push({type:"M",values:[u,c]}),s=l=u,o=h=c):"L"===d?(u=e.values[0],c=e.values[1],n.push({type:"L",values:[u,c]}),s=u,o=c):"l"===d?(u=s+e.values[0],c=o+e.values[1],n.push({type:"L",values:[u,c]}),s=u,o=c):"C"===d?(t=e.values[0],r=e.values[1],i=e.values[2],a=e.values[3],u=e.values[4],c=e.values[5],n.push({type:"C",values:[t,r,i,a,u,c]}),s=u,o=c):"c"===d?(t=s+e.values[0],r=o+e.values[1],i=s+e.values[2],a=o+e.values[3],u=s+e.values[4],c=o+e.values[5],n.push({type:"C",values:[t,r,i,a,u,c]}),s=u,o=c):"Q"===d?(t=e.values[0],r=e.values[1],u=e.values[2],c=e.values[3],n.push({type:"Q",values:[t,r,u,c]}),s=u,o=c):"q"===d?(t=s+e.values[0],r=o+e.values[1],u=s+e.values[2],c=o+e.values[3],n.push({type:"Q",values:[t,r,u,c]}),s=u,o=c):"A"===d?(u=e.values[5],c=e.values[6],n.push({type:"A",values:[e.values[0],e.values[1],e.values[2],e.values[3],e.values[4],u,c]}),s=u,o=c):"a"===d?(u=s+e.values[5],c=o+e.values[6],n.push({type:"A",values:[e.values[0],e.values[1],e.values[2],e.values[3],e.values[4],u,c]}),s=u,o=c):"H"===d?(u=e.values[0],n.push({type:"H",values:[u]}),s=u):"h"===d?(u=s+e.values[0],n.push({type:"H",values:[u]}),s=u):"V"===d?(c=e.values[0],n.push({type:"V",values:[c]}),o=c):"v"===d?(c=o+e.values[0],n.push({type:"V",values:[c]}),o=c):"S"===d?(i=e.values[0],a=e.values[1],u=e.values[2],c=e.values[3],n.push({type:"S",values:[i,a,u,c]}),s=u,o=c):"s"===d?(i=s+e.values[0],a=o+e.values[1],u=s+e.values[2],c=o+e.values[3],n.push({type:"S",values:[i,a,u,c]}),s=u,o=c):"T"===d?(u=e.values[0],c=e.values[1],n.push({type:"T",values:[u,c]}),s=u,o=c):"t"===d?(u=s+e.values[0],c=o+e.values[1],n.push({type:"T",values:[u,c]}),s=u,o=c):"Z"!==d&&"z"!==d||(n.push({type:"Z",values:[]}),s=l,o=h)})),n));return this[c]=i(t),t}if(this[u])return i(this[u]);var n,s,o,l,h,d=r(this.getAttribute("d")||"");return this[u]=i(d),d},e.SVGPathElement.prototype.setPathData=function(e){if(0===e.length)s?this.setAttribute("d",""):this.removeAttribute("d");else{for(var t="",n=0,r=e.length;n=n.duration&&n.count&&n.loopsLeft<=1)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);if(s>n.duration){if(r=Math.floor(s/n.duration),n.count){if(r>=n.loopsLeft)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);n.loopsLeft-=r}n.framesStart+=n.duration*r,s=e-n.framesStart}n.reverse&&(s=n.duration-s),i=n.frames[n.lastFrame=Math.round(s/f)],!1!==n.frameCallback(i.value,!1,i.timeRatio,i.outputRatio)?t=!0:n.framesStart=null}})),t&&(d=m.call(window,Ce))}function ke(e,t){e.framesStart=Date.now(),null!=t&&(e.framesStart-=e.duration*(e.reverse?1-t:t)),e.loopsLeft=e.count,e.lastFrame=null,Ce()}function Se(e,t){var n,s;return typeof e!=typeof t||(n=ue(e)?"obj":Array.isArray(e)?"array":"")!=(ue(t)?"obj":Array.isArray(t)?"array":"")||("obj"===n?Se(s=Object.keys(e).sort(),Object.keys(t).sort())||s.some((function(n){return Se(e[n],t[n])})):"array"===n?e.length!==t.length||e.some((function(e,n){return Se(e,t[n])})):e!==t)}function _e(e){return e?ue(e)?Object.keys(e).reduce((function(t,n){return t[n]=_e(e[n]),t}),{}):Array.isArray(e)?e.map(_e):e:e}function Ee(e){var t,n,s,r=1,i=e=(e+"").trim();function a(e){var t=1,n=ee.exec(e);return n&&(t=parseFloat(n[1]),n[2]?t=0<=t&&t<=100?t/100:1:(t<0||1=Math.abs(s)?0<=t?S:E:0<=s?_:k))}))),A.position_path!==x.position_path||A.position_lineStrokeWidth!==x.position_lineStrokeWidth||[0,1].some((function(e){return A.position_plugOverheadSE[e]!==x.position_plugOverheadSE[e]||(i=C[e],a=x.position_socketXYSE[e],i.x!==a.x||i.y!==a.y||i.socketId!==a.socketId)||(n=t[e],s=x.position_socketGravitySE[e],(r=null==n?"auto":Array.isArray(n)?"array":"number")!=(null==s?"auto":Array.isArray(s)?"array":"number")||("array"==r?n[0]!==s[0]||n[1]!==s[1]:n!==s));var n,s,r,i,a}))){switch(e.pathList.baseVal=s=[],e.pathList.animVal=null,A.position_path){case T:s.push([F(C[0]),F(C[1])]);break;case N:d="number"==typeof t[0]&&0j?(A.position_lineStrokeWidth-j)*H:0),e.socketId===k?((i=(e.y-n.y)/2)=t.x:t.dirId===i?e.y>=t.y:e.x<=t.x}function p(e,t){return t.dirId===n||t.dirId===i?e.x===t.x:e.y===t.y}function f(e){return e[0]?{contain:0,notContain:1}:{contain:1,notContain:0}}function m(e,t,n){return Math.abs(t[n]-e[n])}function g(e,t,s){return"x"===s?e.x=Y?g(l[t.notContain],l[t.contain],u[t.contain]):l[t.contain].dirId)):(s=[{x:l[0].x,y:l[0].y},{x:l[1].x,y:l[1].y}],o.forEach((function(e,t){var n=0===t?1:0,r=m(s[t],s[n],u[t]);rZ&&(l[i]-eZ&&(l[i]-es.outlineMax&&(t=s.outlineMax),t*=2*s.outlineBase,A=Xe(b,v.plugOutline_strokeWidthSE,e,t)||A,A=Xe(b,v.plugOutline_inStrokeWidthSE,e,v.plugOutline_colorTraSE[e]?t-oe/(v.line_strokeWidth/le.lineSize)/w.plugSizeSE[e]*2:t/2)||A)})),A)),(n.faces||he.line||he.plug||he.lineOutline||he.plugOutline)&&(he.faces=(k=(x=t).curStats,S=x.aplStats,_=x.events,E=!1,!k.line_altColor&&Xe(x,S,"line_color",C=k.line_color,_.apl_line_color)&&(x.lineFace.style.stroke=C,E=!0),Xe(x,S,"line_strokeWidth",C=k.line_strokeWidth,_.apl_line_strokeWidth)&&(x.lineShape.style.strokeWidth=C+"px",E=!0,(re||se)&&(qe(x,x.lineShape),se&&(qe(x,x.lineFace),qe(x,x.lineMaskCaps)))),Xe(x,S,"lineOutline_enabled",C=k.lineOutline_enabled,_.apl_lineOutline_enabled)&&(x.lineOutlineFace.style.display=C?"inline":"none",E=!0),k.lineOutline_enabled&&(Xe(x,S,"lineOutline_color",C=k.lineOutline_color,_.apl_lineOutline_color)&&(x.lineOutlineFace.style.stroke=C,E=!0),Xe(x,S,"lineOutline_strokeWidth",C=k.lineOutline_strokeWidth,_.apl_lineOutline_strokeWidth)&&(x.lineOutlineMaskShape.style.strokeWidth=C+"px",E=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace))),Xe(x,S,"lineOutline_inStrokeWidth",C=k.lineOutline_inStrokeWidth,_.apl_lineOutline_inStrokeWidth)&&(x.lineMaskShape.style.strokeWidth=C+"px",E=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace)))),Xe(x,S,"plug_enabled",C=k.plug_enabled,_.apl_plug_enabled)&&(x.plugsFace.style.display=C?"inline":"none",E=!0),k.plug_enabled&&[0,1].forEach((function(e){var t=k.plug_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(x,S.plug_enabledSE,e,C=k.plug_enabledSE[e],_.apl_plug_enabledSE)&&(x.plugsFace.style[s.prop]=C?"url(#"+x.plugMarkerIdSE[e]+")":"none",E=!0),k.plug_enabledSE[e]&&(Xe(x,S.plug_plugSE,e,t,_.apl_plug_plugSE)&&(x.plugFaceSE[e].href.baseVal="#"+n.elmId,He(x,x.plugMarkerSE[e],s.orient,n.bBox,x.svg,x.plugMarkerShapeSE[e],x.plugsFace),E=!0,re&&qe(x,x.plugsFace)),Xe(x,S.plug_colorSE,e,C=k.plug_colorSE[e],_.apl_plug_colorSE)&&(x.plugFaceSE[e].style.fill=C,E=!0,(ie||ae||se)&&!k.line_colorTra&&qe(x,se?x.lineMaskCaps:x.capsMaskLine)),["markerWidth","markerHeight"].forEach((function(t){var n="plug_"+t+"SE";Xe(x,S[n],e,C=k[n][e],_["apl_"+n])&&(x.plugMarkerSE[e][t].baseVal.value=C,E=!0)})),Xe(x,S.plugOutline_enabledSE,e,C=k.plugOutline_enabledSE[e],_.apl_plugOutline_enabledSE)&&(C?(x.plugFaceSE[e].style.mask="url(#"+x.plugMaskIdSE[e]+")",x.plugOutlineFaceSE[e].style.display="inline"):(x.plugFaceSE[e].style.mask="none",x.plugOutlineFaceSE[e].style.display="none"),E=!0),k.plugOutline_enabledSE[e]&&(Xe(x,S.plugOutline_plugSE,e,t,_.apl_plugOutline_plugSE)&&(x.plugOutlineFaceSE[e].href.baseVal=x.plugMaskShapeSE[e].href.baseVal=x.plugOutlineMaskShapeSE[e].href.baseVal="#"+n.elmId,[x.plugMaskSE[e],x.plugOutlineMaskSE[e]].forEach((function(e){e.x.baseVal.value=n.bBox.left,e.y.baseVal.value=n.bBox.top,e.width.baseVal.value=n.bBox.width,e.height.baseVal.value=n.bBox.height})),E=!0),Xe(x,S.plugOutline_colorSE,e,C=k.plugOutline_colorSE[e],_.apl_plugOutline_colorSE)&&(x.plugOutlineFaceSE[e].style.fill=C,E=!0,se&&(qe(x,x.lineMaskCaps),qe(x,x.lineOutlineMaskCaps))),Xe(x,S.plugOutline_strokeWidthSE,e,C=k.plugOutline_strokeWidthSE[e],_.apl_plugOutline_strokeWidthSE)&&(x.plugOutlineMaskShapeSE[e].style.strokeWidth=C+"px",E=!0),Xe(x,S.plugOutline_inStrokeWidthSE,e,C=k.plugOutline_inStrokeWidthSE[e],_.apl_plugOutline_inStrokeWidthSE)&&(x.plugMaskShapeSE[e].style.strokeWidth=C+"px",E=!0)))})),E)),(n.position||he.line||he.plug)&&(he.position=Qe(t)),(n.path||he.position)&&(he.path=(N=(I=t).curStats,O=I.aplStats,R=I.pathList.animVal||I.pathList.baseVal,D=N.path_edge,M=!1,R&&(D.x1=D.x2=R[0][0].x,D.y1=D.y2=R[0][0].y,N.path_pathData=T=Le(R,(function(e){e.xD.x2&&(D.x2=e.x),e.y>D.y2&&(D.y2=e.y)})),Ve(T,O.path_pathData)&&(I.linePath.setPathData(T),O.path_pathData=T,M=!0,se?(qe(I,I.plugsFace),qe(I,I.lineMaskCaps)):re&&qe(I,I.linePath),I.events.apl_path&&I.events.apl_path.forEach((function(e){e(I,T)})))),M)),he.viewBox=(z=(B=t).curStats,P=B.aplStats,W=z.path_edge,G=z.viewBox_bBox,q=P.viewBox_bBox,j=B.svg.viewBox.baseVal,H=B.svg.style,$=!1,K=Math.max(z.line_strokeWidth/2,z.viewBox_plugBCircleSE[0]||0,z.viewBox_plugBCircleSE[1]||0),X={x1:W.x1-K,y1:W.y1-K,x2:W.x2+K,y2:W.y2+K},B.events.new_edge4viewBox&&B.events.new_edge4viewBox.forEach((function(e){e(B,X)})),G.x=z.lineMask_x=z.lineOutlineMask_x=z.maskBGRect_x=X.x1,G.y=z.lineMask_y=z.lineOutlineMask_y=z.maskBGRect_y=X.y1,G.width=X.x2-X.x1,G.height=X.y2-X.y1,["x","y","width","height"].forEach((function(e){var t;(t=G[e])!==q[e]&&(j[e]=q[e]=t,H[U[e]]=t+("x"===e||"y"===e?B.bodyOffset[e]:0)+"px",$=!0)})),$),he.mask=(Q=(Z=t).curStats,J=Z.aplStats,ee=!1,Q.plug_enabled?[0,1].forEach((function(e){Q.capsMaskMarker_enabledSE[e]=Q.plug_enabledSE[e]&&Q.plug_colorTraSE[e]||Q.plugOutline_enabledSE[e]&&Q.plugOutline_colorTraSE[e]})):Q.capsMaskMarker_enabledSE[0]=Q.capsMaskMarker_enabledSE[1]=!1,Q.capsMaskMarker_enabled=Q.capsMaskMarker_enabledSE[0]||Q.capsMaskMarker_enabledSE[1],Q.lineMask_outlineMode=Q.lineOutline_enabled,Q.caps_enabled=Q.capsMaskMarker_enabled||Q.capsMaskAnchor_enabledSE[0]||Q.capsMaskAnchor_enabledSE[1],Q.lineMask_enabled=Q.caps_enabled||Q.lineMask_outlineMode,(Q.lineMask_enabled&&!Q.lineMask_outlineMode||Q.lineOutline_enabled)&&["x","y"].forEach((function(e){var t="maskBGRect_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.maskBGRect[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"lineMask_enabled",Y=Q.lineMask_enabled)&&(Z.lineFace.style.mask=Y?"url(#"+Z.lineMaskId+")":"none",ee=!0,ae&&qe(Z,Z.lineMask)),Q.lineMask_enabled&&(Xe(Z,J,"lineMask_outlineMode",Y=Q.lineMask_outlineMode)&&(Y?(Z.lineMaskBG.style.display="none",Z.lineMaskShape.style.display="inline"):(Z.lineMaskBG.style.display="inline",Z.lineMaskShape.style.display="none"),ee=!0),["x","y"].forEach((function(e){var t="lineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineMask[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"caps_enabled",Y=Q.caps_enabled)&&(Z.lineMaskCaps.style.display=Z.lineOutlineMaskCaps.style.display=Y?"inline":"none",ee=!0,ae&&qe(Z,Z.capsMaskLine)),Q.caps_enabled&&([0,1].forEach((function(e){var t;Xe(Z,J.capsMaskAnchor_enabledSE,e,Y=Q.capsMaskAnchor_enabledSE[e])&&(Z.capsMaskAnchorSE[e].style.display=Y?"inline":"none",ee=!0,ae&&qe(Z,Z.lineMask)),Q.capsMaskAnchor_enabledSE[e]&&(Ve(t=Q.capsMaskAnchor_pathDataSE[e],J.capsMaskAnchor_pathDataSE[e])&&(Z.capsMaskAnchorSE[e].setPathData(t),J.capsMaskAnchor_pathDataSE[e]=t,ee=!0),Xe(Z,J.capsMaskAnchor_strokeWidthSE,e,Y=Q.capsMaskAnchor_strokeWidthSE[e])&&(Z.capsMaskAnchorSE[e].style.strokeWidth=Y+"px",ee=!0))})),Xe(Z,J,"capsMaskMarker_enabled",Y=Q.capsMaskMarker_enabled)&&(Z.capsMaskLine.style.display=Y?"inline":"none",ee=!0),Q.capsMaskMarker_enabled&&[0,1].forEach((function(e){var t=Q.capsMaskMarker_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(Z,J.capsMaskMarker_enabledSE,e,Y=Q.capsMaskMarker_enabledSE[e])&&(Z.capsMaskLine.style[s.prop]=Y?"url(#"+Z.lineMaskMarkerIdSE[e]+")":"none",ee=!0),Q.capsMaskMarker_enabledSE[e]&&(Xe(Z,J.capsMaskMarker_plugSE,e,t)&&(Z.capsMaskMarkerShapeSE[e].href.baseVal="#"+n.elmId,He(Z,Z.capsMaskMarkerSE[e],s.orient,n.bBox,Z.svg,Z.capsMaskMarkerShapeSE[e],Z.capsMaskLine),ee=!0,re&&(qe(Z,Z.capsMaskLine),qe(Z,Z.lineFace))),["markerWidth","markerHeight"].forEach((function(t){var n="capsMaskMarker_"+t+"SE";Xe(Z,J[n],e,Y=Q[n][e])&&(Z.capsMaskMarkerSE[e][t].baseVal.value=Y,ee=!0)})))})))),Q.lineOutline_enabled&&["x","y"].forEach((function(e){var t="lineOutlineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineOutlineMask[e].baseVal.value=Y,ee=!0)})),ee),n.effect&&(ue=(te=t).curStats,ce=te.aplStats,Object.keys(e).forEach((function(t){var n=e[t],s=t+"_enabled",r=t+"_options",i=ue[r];Xe(te,ce,s,ne=ue[s])?(ne&&(ce[r]=_e(i)),n[ne?"init":"remove"](te)):ne&&Se(i,ce[r])&&(n.remove(te),ce[s]=!0,ce[r]=_e(i),n.init(te))}))),(ie||ae)&&he.line&&!he.path&&qe(t,t.lineShape),ie&&he.plug&&!he.line&&qe(t,t.plugsFace),je(t)}function tt(e,t){return{duration:ce(e.duration)&&0t.x2&&(t.x2=s.x2),s.y2>t.y2&&(t.y2=s.y2),["x","y"].forEach((function(n){var s,a="dropShadow_"+n;r[a]=s=t[n+"1"],Xe(e,i,a,s)&&(e.efc_dropShadow_elmFilter[n].baseVal.value=s)})))}}},Object.keys(e).forEach((function(t){var n=e[t],s=n.stats;s[t+"_enabled"]={iniValue:!1},s[t+"_options"]={hasProps:!0},n.anim&&(s[t+"_animOptions"]={},s[t+"_animId"]={})})),t={none:{defaultAnimOptions:{},init:function(e,n){var s=e.curStats;s.show_animId&&(he.remove(s.show_animId),s.show_animId=null),t.none.start(e,n)},start:function(e,n){t.none.stop(e,!0)},stop:function(e,t,n){var s=e.curStats;return n=null!=n?n:e.aplStats.show_on,s.show_inAnim=!1,t&&Je(e,n),n?1:0}},fade:{defaultAnimOptions:{duration:300,timing:"linear"},init:function(e,n){var s=e.curStats,r=e.aplStats;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){return e}),(function(n,s){s?t.fade.stop(e,!0):(e.svg.style.opacity=n+"",se&&(qe(e,e.svg),je(e)))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.fade.start(e,n)},start:function(e,t){var n,s=e.curStats;s.show_inAnim&&(n=he.stop(s.show_animId)),Je(e,1),s.show_inAnim=!0,he.start(s.show_animId,!e.aplStats.show_on,null!=t?t:n)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.svg.style.opacity=n?"":"0",Je(e,n)),s}},draw:{defaultAnimOptions:{duration:500,timing:[.58,0,.42,1]},init:function(e,n){var s=e.curStats,r=e.aplStats,i=e.pathList.baseVal,a=Pe(i),o=a.segsLen,l=a.lenAll;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){var t,n,s,r,a=-1;if(0===e)n=[[i[0][0],i[0][0]]];else if(1===e)n=i;else{for(t=l*e,n=[];t>=o[++a];)n.push(i[a]),t-=o[a];t&&(2===(s=i[a]).length?n.push([s[0],De(s[0],s[1],t/o[a])]):(r=Fe(s[0],s[1],s[2],s[3],ze(s[0],s[1],s[2],s[3],t)),n.push([s[0],r.fromP1,r.fromP2,r])))}return n}),(function(n,s){s?t.draw.stop(e,!0):(e.pathList.animVal=n,et(e,{path:!0}))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.draw.start(e,n)},start:function(e,n){var s,r=e.curStats;r.show_inAnim&&(s=he.stop(r.show_animId)),Je(e,1),r.show_inAnim=!0,We(e,"apl_position",t.draw.update),he.start(r.show_animId,!e.aplStats.show_on,null!=n?n:s)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.pathList.animVal=n?null:[[e.pathList.baseVal[0][0],e.pathList.baseVal[0][0]]],et(e,{path:!0}),Je(e,n)),s},update:function(e){Ge(e,"apl_position",t.draw.update),e.curStats.show_inAnim?t.draw.init(e,t.draw.stop(e)):e.aplStats.show_animOptions={}}}},[["start","anchorSE",0],["end","anchorSE",1],["color","lineColor"],["size","lineSize"],["startSocketGravity","socketGravitySE",0],["endSocketGravity","socketGravitySE",1],["startPlugColor","plugColorSE",0],["endPlugColor","plugColorSE",1],["startPlugSize","plugSizeSE",0],["endPlugSize","plugSizeSE",1],["outline","lineOutlineEnabled"],["outlineColor","lineOutlineColor"],["outlineSize","lineOutlineSize"],["startPlugOutline","plugOutlineEnabledSE",0],["endPlugOutline","plugOutlineEnabledSE",1],["startPlugOutlineColor","plugOutlineColorSE",0],["endPlugOutlineColor","plugOutlineColorSE",1],["startPlugOutlineSize","plugOutlineSizeSE",0],["endPlugOutlineSize","plugOutlineSizeSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2];Object.defineProperty(at.prototype,t,{get:function(){var e=null!=s?be[this._id].options[n][s]:n?be[this._id].options[n]:be[this._id].options[t];return null==e?G:_e(e)},set:ot(t),enumerable:!0})})),[["path",M],["startSocket",I,"socketSE",0],["endSocket",I,"socketSE",1],["startPlug",P,"plugSE",0],["endPlug",P,"plugSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2],r=e[3];Object.defineProperty(at.prototype,t,{get:function(){var e,i=null!=r?be[this._id].options[s][r]:s?be[this._id].options[s]:be[this._id].options[t];return i?Object.keys(n).some((function(t){return n[t]===i&&(e=t,!0)}))?e:new Error("It's broken"):G},set:ot(t),enumerable:!0})})),Object.keys(e).forEach((function(t){var n=e[t];Object.defineProperty(at.prototype,t,{get:function(){var e,s,r=be[this._id].options[t];return ue(r)?(e=r,s=n.optionsConf.reduce((function(t,n){var s,r=n[0],i=n[1],a=n[2],o=n[3],l=n[4],u=null!=l?e[o][l]:o?e[o]:e[i];return t[i]="id"===r?u?Object.keys(a).some((function(e){return a[e]===u&&(s=e,!0)}))?s:new Error("It's broken"):G:null==u?G:_e(u),t}),{}),n.anim&&(s.animation=_e(e.animation)),s):r},set:ot(t),enumerable:!0})})),["startLabel","endLabel","middleLabel"].forEach((function(e,t){Object.defineProperty(at.prototype,e,{get:function(){var e=be[this._id],n=e.options;return n.labelSEM[t]&&!e.optionIsAttach.labelSEM[t]?ve[n.labelSEM[t]._id].text:n.labelSEM[t]||""},set:ot(e),enumerable:!0})})),at.prototype.setOptions=function(e){return it(be[this._id],e),this},at.prototype.position=function(){return et(be[this._id],{position:!0}),this},at.prototype.remove=function(){var t=be[this._id],n=t.curStats;Object.keys(e).forEach((function(e){var t=e+"_animId";n[t]&&he.remove(n[t])})),n.show_animId&&he.remove(n.show_animId),t.attachments.slice().forEach((function(e){rt(t,e)})),t.baseWindow&&t.svg&&t.baseWindow.document.body.removeChild(t.svg),delete be[this._id]},at.prototype.show=function(e,t){return nt(be[this._id],!0,e,t),this},at.prototype.hide=function(e,t){return nt(be[this._id],!1,e,t),this},i=function(e){e&&ve[e._id]&&(e.boundTargets.slice().forEach((function(t){rt(t.props,e,!0)})),e.conf.remove&&e.conf.remove(e),delete ve[e._id])},lt.prototype.remove=function(){var e=this,t=ve[e._id];t&&(t.boundTargets.slice().forEach((function(e){t.conf.removeOption(t,e)})),Ue((function(){var t=ve[e._id];t&&i(t)})))},s=lt,window.LeaderLineAttachment=s,r=function(e,t){return e instanceof s&&(!(e.isRemoved||t&&ve[e._id].conf.type!==t)||null)},n={pointAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie}],init:function(e,t){return e.element=n.pointAnchor.checkElement(t.element),e.x=n.pointAnchor.parsePercent(t.x,!0)||[.5,!0],e.y=n.pointAnchor.parsePercent(t.y,!0)||[.5,!0],!0},removeOption:function(e,t){var r=t.props,i={},a=e.element,o=r.options.anchorSE["start"===t.optionName?1:0];a===o&&(a=o===document.body?new s(n.pointAnchor,[a]):document.body),i[t.optionName]=a,it(r,i)},getBBoxNest:function(e,t){var n=Oe(e.element,t.baseWindow),s=n.width,r=n.height;return n.width=n.height=0,n.left=n.right=n.left+e.x[0]*(e.x[1]?s:1),n.top=n.bottom=n.top+e.y[0]*(e.y[1]?r:1),n},parsePercent:function(e,t){var n,s,r=!1;return ce(e)?s=e:"string"==typeof e&&(n=ee.exec(e))&&n[2]&&(r=0!=(s=parseFloat(n[1])/100)),null!=s&&(t||0<=s)?[s,r]:null},checkElement:function(e){if(null==e)e=document.body;else if(!Ie(e))throw new Error("`element` must be Element");return e}},areaAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"shape",type:"string"}],stats:{color:{},strokeWidth:{},elementWidth:{},elementHeight:{},elementLeft:{},elementTop:{},pathListRel:{},bBoxRel:{},pathData:{},viewBoxBBox:{hasProps:!0},dashLen:{},dashGap:{}},init:function(e,t){var s,r,i,a=[];return e.element=n.pointAnchor.checkElement(t.element),"string"==typeof t.color&&(e.color=t.color.trim()),"string"==typeof t.fillColor&&(e.fill=t.fillColor.trim()),ce(t.size)&&0<=t.size&&(e.size=t.size),t.dash&&(e.dash=!0,ce(t.dash.len)&&0s.right&&(s.right=n),is.bottom&&(s.bottom=i)):s={left:n,right:n,top:i,bottom:i},r?D.pathListRel.push([r,{x:n,y:i}]):D.pathListRel=[],r={x:n,y:i}})),D.pathListRel.push([]),i=D.strokeWidth/2,a=[{x:s.left-i,y:s.top-i},{x:s.right+i,y:s.bottom+i}],D.bBoxRel={left:a[0].x,top:a[0].y,right:a[1].x,bottom:a[1].y,width:a[1].x-a[0].x,height:a[1].y-a[0].y}}B.pathListRel=B.bBoxRel=!0}return(B.pathListRel||B.elementLeft||B.elementTop)&&(D.pathData=Le(D.pathListRel,(function(e){e.x+=t.left,e.y+=t.top}))),Xe(e,M,"strokeWidth",n=D.strokeWidth)&&(e.path.style.strokeWidth=n+"px"),Ve(n=D.pathData,M.pathData)&&(e.path.setPathData(n),M.pathData=n,B.pathData=!0),e.dash&&(!B.pathData&&(!B.strokeWidth||e.dashLen&&e.dashGap)||(D.dashLen=e.dashLen||2*D.strokeWidth,D.dashGap=e.dashGap||D.strokeWidth),B.dash=Xe(e,M,"dashLen",D.dashLen)||B.dash,B.dash=Xe(e,M,"dashGap",D.dashGap)||B.dash,B.dash&&(e.path.style.strokeDasharray=M.dashLen+","+M.dashGap)),T=D.viewBoxBBox,N=M.viewBoxBBox,O=e.svg.viewBox.baseVal,R=e.svg.style,T.x=D.bBoxRel.left+t.left,T.y=D.bBoxRel.top+t.top,T.width=D.bBoxRel.width,T.height=D.bBoxRel.height,["x","y","width","height"].forEach((function(t){(n=T[t])!==N[t]&&(O[t]=N[t]=n,R[U[t]]=n+("x"===t||"y"===t?e.bodyOffset[t]:0)+"px")})),B.strokeWidth||B.pathListRel||B.bBoxRel}},mouseHoverAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"showEffectName",type:"string"}],style:{backgroundImage:"url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg==')",backgroundSize:"",backgroundRepeat:"no-repeat",backgroundColor:"#f8f881",cursor:"default"},hoverStyle:{backgroundImage:"none",backgroundColor:"#fadf8f"},padding:{top:1,right:15,bottom:1,left:2},minHeight:15,backgroundPosition:{right:2,top:2},backgroundSize:{width:12,height:12},dirKeys:[["top","Top"],["right","Right"],["bottom","Bottom"],["left","Left"]],init:function(e,s){var r,i,a,o,l,u,c,h,d,p,f,m=n.mouseHoverAnchor,g={};if(e.element=n.pointAnchor.checkElement(s.element),!((p=(h=e.element).ownerDocument)&&(d=p.defaultView)&&d.HTMLElement&&h instanceof d.HTMLElement))throw new Error("`element` must be HTML element");return m.style.backgroundSize=m.backgroundSize.width+"px "+m.backgroundSize.height+"px",["style","hoverStyle"].forEach((function(t){var n=m[t];e[t]=Object.keys(n).reduce((function(e,t){return e[t]=n[t],e}),{})})),"inline"===(r=e.element.ownerDocument.defaultView.getComputedStyle(e.element,"")).display?e.style.display="inline-block":"none"===r.display&&(e.style.display="block"),n.mouseHoverAnchor.dirKeys.forEach((function(t){var n=t[0],s="padding"+t[1];parseFloat(r[s])e.x2&&(e.x2=s.x2),s.y2>e.y2&&(e.y2=s.y2)},newText:function(e,t,n,s,r){var i,a,o,u,c,h=t.createElementNS(te,"text");return h.textContent=e,[h.x,h.y].forEach((function(e){var t=n.createSVGLength();t.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),e.baseVal.initialize(t)})),"boolean"!=typeof l&&(l="paintOrder"in h.style),r&&!l?(a=t.createElementNS(te,"defs"),h.id=s,a.appendChild(h),(u=(i=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(o=i.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(c=u.style).strokeLinejoin="round",{elmPosition:h,styleText:h.style,styleFill:o.style,styleStroke:c,styleShow:i.style,elmsAppend:[a,i]}):(c=h.style,r&&(c.strokeLinejoin="round",c.paintOrder="stroke"),{elmPosition:h,styleText:c,styleFill:c,styleStroke:r?c:null,styleShow:c,elmsAppend:[h]})},getMidPoint:function(e,t){var n,s,r=Pe(e),i=r.segsLen,a=r.lenAll,o=-1,l=a/2+(t||0);if(l<=0)return 2===(n=e[0]).length?De(n[0],n[1],0):Fe(n[0],n[1],n[2],n[3],0);if(a<=l)return 2===(n=e[e.length-1]).length?De(n[0],n[1],1):Fe(n[0],n[1],n[2],n[3],1);for(s=[];l>i[++o];)s.push(e[o]),l-=i[o];return 2===(n=e[o]).length?De(n[0],n[1],l/i[o]):Fe(n[0],n[1],n[2],n[3],ze(n[0],n[1],n[2],n[3],l))},initSvg:function(e,t){var s,r,i=n.captionLabel.newText(e.text,t.baseWindow.document,t.svg,C+"-captionLabel-"+e._id,e.outlineColor);["elmPosition","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),s=i.elmPosition.getBBox(),e.width=s.width,e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,i.styleStroke.strokeWidth=r+"px",i.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.captionLabel.stats),e.updateColor(t),e.refSocketXY?e.updateSocketXY(t):e.updatePath(t),ae&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),(e.refSocketXY="startLabel"===t.optionName||"endLabel"===t.optionName)?(e.socketIndex="startLabel"===t.optionName?0:1,We(s,"apl_position",e.updateSocketXY),e.offset||(We(s,"cur_attach_plugSideLenSE",e.updateSocketXY),We(s,"cur_line_strokeWidth",e.updateSocketXY))):We(s,"apl_path",e.updatePath),We(s,"svgShow",e.updateShow),ae&&We(s,"new_edge4viewBox",e.adjustEdge),n.captionLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.captionLabel.stats),Ke(e.aplStats,n.captionLabel.stats),e.color||Ge(s,"cur_line_color",e.updateColor),e.refSocketXY?(Ge(s,"apl_position",e.updateSocketXY),e.offset||(Ge(s,"cur_attach_plugSideLenSE",e.updateSocketXY),Ge(s,"cur_line_strokeWidth",e.updateSocketXY))):Ge(s,"apl_path",e.updatePath),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.captionLabel.unbind(e,t)}))}},pathLabel:{type:"label",argOptions:[{optionName:"text",type:"string"}],stats:{color:{},startOffset:{},pathData:{}},init:function(e,t){return"string"==typeof t.text&&(e.text=t.text.trim()),!!e.text&&("string"==typeof t.color&&(e.color=t.color.trim()),e.outlineColor="string"==typeof t.outlineColor?t.outlineColor.trim():"#fff",ce(t.lineOffset)&&(e.lineOffset=t.lineOffset),n.captionLabel.textStyleProps.forEach((function(n){null!=t[n]&&(e[n]=t[n])})),e.updateColor=function(t){n.captionLabel.updateColor(e,t)},e.updatePath=function(t){var s,r=e.curStats,i=e.aplStats,a=t.curStats,o=t.pathList.animVal||t.pathList.baseVal;o&&(r.pathData=s=n.pathLabel.getOffsetPathData(o,a.line_strokeWidth/2+e.strokeWidth/2+e.height/4,1.25*e.height),Ve(s,i.pathData)&&(e.elmPath.setPathData(s),i.pathData=s,e.bBox=e.elmPosition.getBBox(),e.updateStartOffset(t)))},e.updateStartOffset=function(t){var n,s,r,i,a=e.curStats,o=e.aplStats,l=t.curStats;a.pathData&&(2===e.semIndex&&!e.lineOffset||(r=a.pathData.reduce((function(e,t){var n,r=t.values;switch(t.type){case"M":s={x:r[0],y:r[1]};break;case"L":n={x:r[0],y:r[1]},s&&(e+=Re(s,n)),s=n;break;case"C":n={x:r[4],y:r[5]},s&&(e+=Be(s,{x:r[0],y:r[1]},{x:r[2],y:r[3]},n)),s=n}return e}),0),i=0===e.semIndex?0:1===e.semIndex?r:r/2,2!==e.semIndex&&(n=Math.max(l.attach_plugBackLenSE[e.semIndex]||0,l.line_strokeWidth/2)+e.strokeWidth/2+e.height/4,i=(i+=0===e.semIndex?n:-n)<0?0:rt?((r=s.points)[1]=Me(r[0],r[1],-t),s.len=Re(r[0],r[1])):(s.points=null,s.len=0),e.len>t+n?((r=e.points)[0]=Me(r[1],r[0],-(t+n)),e.len=Re(r[0],r[1])):(e.points=null,e.len=0)),e):null})),i.reduce((function(e,t){var n=t.points;return n&&(r&&a(n[0],r)||e.push({type:"M",values:[n[0].x,n[0].y]}),"line"===t.type?e.push({type:"L",values:[n[1].x,n[1].y]}):(n.shift(),n.forEach((function(t){e.push({type:"L",values:[t.x,t.y]})}))),r=n[n.length-1]),e}),[])},newText:function(e,t,n,s){var r,i,a,o,u,c,h,d,p=t.createElementNS(te,"defs"),f=p.appendChild(t.createElementNS(te,"path"));return f.id=r=n+"-path",(o=(a=t.createElementNS(te,"text")).appendChild(t.createElementNS(te,"textPath"))).href.baseVal="#"+r,o.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),o.textContent=e,"boolean"!=typeof l&&(l="paintOrder"in a.style),s&&!l?(a.id=i=n+"-text",p.appendChild(a),(h=(u=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(c=u.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(d=h.style).strokeLinejoin="round",{elmPosition:a,elmPath:f,elmOffset:o,styleText:a.style,styleFill:c.style,styleStroke:d,styleShow:u.style,elmsAppend:[p,u]}):(d=a.style,s&&(d.strokeLinejoin="round",d.paintOrder="stroke"),{elmPosition:a,elmPath:f,elmOffset:o,styleText:d,styleFill:d,styleStroke:s?d:null,styleShow:d,elmsAppend:[p,a]})},initSvg:function(e,t){var s,r,i=n.pathLabel.newText(e.text,t.baseWindow.document,C+"-pathLabel-"+e._id,e.outlineColor);["elmPosition","elmPath","elmOffset","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),i.elmPath.setPathData([{type:"M",values:[0,100]},{type:"h",values:[100]}]),s=i.elmPosition.getBBox(),i.styleText.textAnchor=["start","end","middle"][e.semIndex],2!==e.semIndex||e.lineOffset||i.elmOffset.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE,50),e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,i.styleStroke.strokeWidth=r+"px",i.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.pathLabel.stats),e.updateColor(t),e.updatePath(t),e.updateStartOffset(t),ae&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),We(s,"cur_line_strokeWidth",e.updatePath),We(s,"apl_path",e.updatePath),e.semIndex="startLabel"===t.optionName?0:"endLabel"===t.optionName?1:2,2===e.semIndex&&!e.lineOffset||We(s,"cur_attach_plugBackLenSE",e.updateStartOffset),We(s,"svgShow",e.updateShow),ae&&We(s,"new_edge4viewBox",e.adjustEdge),n.pathLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.elmPath=e.elmOffset=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.pathLabel.stats),Ke(e.aplStats,n.pathLabel.stats),e.color||Ge(s,"cur_line_color",e.updateColor),Ge(s,"cur_line_strokeWidth",e.updatePath),Ge(s,"apl_path",e.updatePath),2===e.semIndex&&!e.lineOffset||Ge(s,"cur_attach_plugBackLenSE",e.updateStartOffset),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.pathLabel.unbind(e,t)}))}}},Object.keys(n).forEach((function(e){at[e]=function(){return new s(n[e],Array.prototype.slice.call(arguments))}})),at.positionByWindowResize=!0,window.addEventListener("resize",pe.add((function(){at.positionByWindowResize&&Object.keys(be).forEach((function(e){et(be[e],{position:!0})}))})),!1),at}();e.exports=t},7503:function(e,t,n){var s;e=n.nmd(e),function(){"use strict";var r={function:!0,object:!0},i=r[typeof window]&&window||this,a=r[typeof t]&&t,o=r.object&&e&&!e.nodeType&&e,l=a&&o&&"object"==typeof n.g&&n.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(i=l);var u=Math.pow(2,53)-1,c=/\bOpera/,h=Object.prototype,d=h.hasOwnProperty,p=h.toString;function f(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function m(e){return e=v(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:f(e)}function g(e,t){for(var n in e)d.call(e,n)&&t(e[n],n,e)}function y(e){return null==e?f(e):p.call(e).slice(8,-1)}function b(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function w(e,t){var n=null;return function(e,t){var n=-1,s=e?e.length:0;if("number"==typeof s&&s>-1&&s<=u)for(;++n3?"WebKit":/\bOpera\b/.test(P)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(L)&&"WebKit"||!L&&/\bMSIE\b/i.test(t)&&("Mac OS"==G?"Tasman":"Trident")||"WebKit"==L&&/\bPlayStation\b(?! Vita\b)/i.test(P)&&"NetFront")&&(L=[o]),"IE"==P&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(P+=" Mobile",G="Windows Phone "+(/\+$/.test(o)?o:o+".x"),M.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(P="IE Mobile",G="Windows Phone 8.x",M.unshift("desktop mode"),z||(z=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=P&&"Trident"==L&&(o=/\brv:([\d.]+)/.exec(t))&&(P&&M.push("identifying as "+P+(z?" "+z:"")),P="IE",z=o[1]),B){if(h="global",d=null!=(u=n)?typeof u[h]:"number",/^(?:boolean|number|string|undefined)$/.test(d)||"object"==d&&!u[h])y(o=n.runtime)==x?(P="Adobe AIR",G=o.flash.system.Capabilities.os):y(o=n.phantom)==S?(P="PhantomJS",z=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof N.documentMode&&(o=/\bTrident\/(\d+)/i.exec(t))?(z=[z,N.documentMode],(o=+o[1]+4)!=z[1]&&(M.push("IE "+z[1]+" mode"),L&&(L[1]=""),z[1]=o),z="IE"==P?String(z[1].toFixed(1)):z[0]):"number"==typeof N.documentMode&&/^(?:Chrome|Firefox)\b/.test(P)&&(M.push("masking as "+P+" "+z),P="IE",z="11.0",L=["Trident"],G="Windows");else if(_&&(D=(o=_.lang.System).getProperty("os.arch"),G=G||o.getProperty("os.name")+" "+o.getProperty("os.version")),E){try{z=n.require("ringo/engine").version.join("."),P="RingoJS"}catch(e){(o=n.system)&&o.global.system==n.system&&(P="Narwhal",G||(G=o[0].os||null))}P||(P="Rhino")}else"object"==typeof n.process&&!n.process.browser&&(o=n.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(M.push("Node "+o.versions.node),P="Electron",z=o.versions.electron):"string"==typeof o.versions.nw&&(M.push("Chromium "+z,"Node "+o.versions.node),P="NW.js",z=o.versions.nw)),P||(P="Node.js",D=o.arch,G=o.platform,z=(z=/[\d.]+/.exec(o.version))?z[0]:null));G=G&&m(G)}if(z&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(z)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(B&&r.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(F=/b/i.test(o)?"beta":"alpha",z=z.replace(RegExp(o+"\\+?$"),"")+("beta"==F?T:I)+(/\d+\+?/.exec(o)||"")),"Fennec"==P||"Firefox"==P&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(G))P="Firefox Mobile";else if("Maxthon"==P&&z)z=z.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(V))"Xbox 360"==V&&(G=null),"Xbox 360"==V&&/\bIEMobile\b/.test(t)&&M.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(P)&&(!P||V||/Browser|Mobi/.test(P))||"Windows CE"!=G&&!/Mobi/i.test(t))if("IE"==P&&B)try{null===n.external&&M.unshift("platform preview")}catch(e){M.unshift("embedded")}else(/\bBlackBerry\b/.test(V)||/\bBB10\b/.test(t))&&(o=(RegExp(V.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||z)?(G=((o=[o,/BB10/.test(t)])[1]?(V=null,W="BlackBerry"):"Device Software")+" "+o[0],z=null):this!=g&&"Wii"!=V&&(B&&O||/Opera/.test(P)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==P&&/\bOS X (?:\d+\.){2,}/.test(G)||"IE"==P&&(G&&!/^Win/.test(G)&&z>5.5||/\bWindows XP\b/.test(G)&&z>8||8==z&&!/\bTrident\b/.test(t)))&&!c.test(o=e.call(g,t.replace(c,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),c.test(P)?(/\bIE\b/.test(o)&&"Mac OS"==G&&(G=null),o="identify"+o):(o="mask"+o,P=R?m(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(G=null),B||(z=null)),L=["Presto"],M.push(o));else P+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==P&&"+"==o[1].slice(-1)?(P="WebKit Nightly",F="alpha",z=o[1].slice(0,-1)):z!=o[1]&&z!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(z=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==L&&(L=["Blink"]),B&&(f||o[1])?(L&&(L[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=L?"27":"28")):(L&&(L[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),L&&(L[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==P&&(!z||parseInt(z)>45)?z=o:"Chrome"==P&&/\bHeadlessChrome/i.test(t)&&M.unshift("headless")),"Opera"==P&&(o=/\bzbov|zvav$/.exec(G))?(P+=" ",M.unshift("desktop mode"),"zvav"==o?(P+="Mini",z=null):P+="Mobile",G=G.replace(RegExp(" *"+o+"$"),"")):"Safari"==P&&/\bChrome\b/.exec(L&&L[1])?(M.unshift("desktop mode"),P="Chrome Mobile",z=null,/\bOS X\b/.test(G)?(W="Apple",G="iOS 4.3+"):G=null):/\bSRWare Iron\b/.test(P)&&!z&&(z=q("Chrome")),z&&0==z.indexOf(o=/[\d.]+$/.exec(G))&&t.indexOf("/"+o+"-")>-1&&(G=v(G.replace(o,""))),G&&-1!=G.indexOf(P)&&!RegExp(P+" OS").test(G)&&(G=G.replace(RegExp(" *"+b(P)+" *"),"")),L&&!/\b(?:Avant|Nook)\b/.test(P)&&(/Browser|Lunascape|Maxthon/.test(P)||"Safari"!=P&&/^iOS/.test(G)&&/\bSafari\b/.test(L[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(P)&&L[1])&&(o=L[L.length-1])&&M.push(o),M.length&&(M=["("+M.join("; ")+")"]),W&&V&&V.indexOf(W)<0&&M.push("on "+W),V&&M.push((/^on /.test(M[M.length-1])?"":"on ")+V),G&&(o=/ ([\d.+]+)$/.exec(G),l=o&&"/"==G.charAt(G.length-o[0].length-1),G={architecture:32,family:o&&!l?G.replace(o[0],""):G,version:o?o[1]:null,toString:function(){var e=this.version;return this.family+(e&&!l?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(D))&&!/\bi686\b/i.test(D)?(G&&(G.architecture=64,G.family=G.family.replace(RegExp(" *"+o),"")),P&&(/\bWOW64\b/i.test(t)||B&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(t))&&M.unshift("32-bit")):G&&/^OS X/.test(G.family)&&"Chrome"==P&&parseFloat(z)>=39&&(G.architecture=64),t||(t=null);var j={};return j.description=t,j.layout=L&&L[0],j.manufacturer=W,j.name=P,j.prerelease=F,j.product=V,j.ua=t,j.version=P&&z,j.os=G||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=e,j.toString=function(){return this.description||""},j.version&&M.unshift(z),j.name&&M.unshift(P),G&&P&&(G!=String(G).split(" ")[0]||G!=P.split(" ")[0]&&!V)&&M.push(V?"("+G+")":"on "+G),M.length&&(j.description=M.join(" ")),j}();i.platform=A,void 0===(s=function(){return A}.call(t,n,t,e))||(e.exports=s)}.call(this)},115:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,s="function"==typeof Set,r="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var o,l,u,c;if(Array.isArray(e)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(!i(e[l],a[l]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!a.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!i(l.value[1],a.get(l.value[0])))return!1;return!0}if(s&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(e[l]!==a[l])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((o=(u=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(l=o;0!=l--;)if(!Object.prototype.hasOwnProperty.call(a,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!i(e[u[l]],a[u[l]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return!1;throw e}}},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,s=0;s{"use strict";var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,r&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},402:e=>{e.exports=''},3389:e=>{e.exports=''},627:e=>{e.exports=''},8110:e=>{e.exports=''},980:e=>{e.exports=''},3890:e=>{e.exports=''},880:e=>{e.exports=''},3282:e=>{e.exports=''},4948:function(e){e.exports=function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function s(e,n,s){t(e,n),n.set(e,s)}function r(t,n,s){return t.set(e(t,n),s),s}const i=100,a={},o=()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus()},l=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;a.restoreFocusTimeout=setTimeout((()=>{o(),t()}),i),window.scrollTo(n,s)})),u="swal2-",c=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=u+t,e)),{}),h=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=u+t,e)),{}),d=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>{},f=e=>{},m=[],g=e=>{m.includes(e)||(m.push(e),p(e))},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},b=e=>"function"==typeof e?e():e,w=e=>e&&"function"==typeof e.toPromise,v=e=>w(e)?e.toPromise():Promise.resolve(e),A=e=>e&&Promise.resolve(e)===e,x=()=>document.body.querySelector(`.${c.container}`),C=e=>{const t=x();return t?t.querySelector(e):null},k=e=>C(`.${e}`),S=()=>k(c.popup),_=()=>k(c.icon),E=()=>k(c["icon-content"]),I=()=>k(c.title),T=()=>k(c["html-container"]),N=()=>k(c.image),O=()=>k(c["progress-steps"]),R=()=>k(c["validation-message"]),D=()=>C(`.${c.actions} .${c.confirm}`),M=()=>C(`.${c.actions} .${c.cancel}`),F=()=>C(`.${c.actions} .${c.deny}`),B=()=>k(c["input-label"]),z=()=>C(`.${c.loader}`),L=()=>k(c.actions),P=()=>k(c.footer),V=()=>k(c["timer-progress-bar"]),W=()=>k(c.close),G='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n',U=()=>{const e=S();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>ue(e)))},q=()=>K(document.body,c.shown)&&!K(document.body,c["toast-shown"])&&!K(document.body,c["no-backdrop"]),j=()=>{const e=S();return!!e&&K(e,c.toast)},H=()=>{const e=S();return!!e&&e.hasAttribute("data-loading")},$=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},K=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach((n=>{Object.values(c).includes(n)||Object.values(h).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))},Z=(e,t,n)=>{if(X(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?ee(e,s):p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${c.popup} > .${c[t]}`);case"checkbox":return e.querySelector(`.${c.popup} > .${c.checkbox} input`);case"radio":return e.querySelector(`.${c.popup} > .${c.radio} input:checked`)||e.querySelector(`.${c.popup} > .${c.radio} input:first-child`);case"range":return e.querySelector(`.${c.popup} > .${c.range} input`);default:return e.querySelector(`.${c.popup} > .${c.input}`)}},Q=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},J=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},ee=(e,t)=>{J(e,t,!0)},te=(e,t)=>{J(e,t,!1)},ne=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},ie=e=>{e&&(e.style.display="none")},ae=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{le(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},oe=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},le=function(e,t){t?re(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ie(e)},ue=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ce=()=>!ue(D())&&!ue(F())&&!ue(M()),he=e=>!!(e.scrollHeight>e.clientHeight),de=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},pe=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=V();n&&ue(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},fe=()=>{const e=V();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},me=()=>"undefined"==typeof window||"undefined"==typeof document,ge=`\n
      \n \n
        \n
        \n \n

        \n
        \n \n \n
        \n \n \n
        \n \n
        \n \n \n
        \n
        \n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n`.replace(/(^|\n)\s*/g,""),ye=()=>{const e=x();return!!e&&(e.remove(),te([document.documentElement,document.body],[c["no-backdrop"],c["toast-shown"],c["has-column"]]),!0)},be=()=>{a.currentInstance.resetValidationMessage()},we=()=>{const e=S(),t=ne(e,c.input),n=ne(e,c.file),s=e.querySelector(`.${c.range} input`),r=e.querySelector(`.${c.range} output`),i=ne(e,c.select),a=e.querySelector(`.${c.checkbox} input`),o=ne(e,c.textarea);t.oninput=be,n.onchange=be,i.onchange=be,a.onchange=be,o.oninput=be,s.oninput=()=>{be(),r.value=s.value},s.onchange=()=>{be(),r.value=s.value}},ve=e=>"string"==typeof e?document.querySelector(e):e,Ae=e=>{const t=S();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},xe=e=>{"rtl"===window.getComputedStyle(e).direction&&ee(x(),c.rtl)},Ce=e=>{const t=ye();if(me())return void f("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=c.container,t&&ee(n,c["no-transition"]),$(n,ge);const s=ve(e.target);s.appendChild(n),Ae(e),xe(s),we()},ke=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?Se(e,t):e&&$(t,e)},Se=(e,t)=>{e.jquery?_e(t,e):$(t,e.toString())},_e=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Ee=(()=>{if(me())return!1;const e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"})(),Ie=(e,t)=>{const n=L(),s=z();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?re(n):ie(n),Z(n,t,"actions"),Te(n,s,t),$(s,t.loaderHtml||""),Z(s,t,"loader"))};function Te(e,t,n){const s=D(),r=F(),i=M();s&&r&&i&&(Oe(s,"confirm",n),Oe(r,"deny",n),Oe(i,"cancel",n),Ne(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function Ne(e,t,n,s){s.buttonsStyling?(ee([e,t,n],c.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,ee(e,c["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,ee(t,c["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,ee(n,c["default-outline"]))):te([e,t,n],c.styled)}function Oe(e,t,n){const s=d(t);le(e,n[`show${s}Button`],"inline-block"),$(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=c[t],Z(e,n,`${t}Button`)}const Re=(e,t)=>{const n=W();n&&($(n,t.closeButtonHtml||""),Z(n,t,"closeButton"),le(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},De=(e,t)=>{const n=x();n&&(Me(n,t.backdrop),Fe(n,t.position),Be(n,t.grow),Z(n,t,"container"))};function Me(e,t){"string"==typeof t?e.style.background=t:t||ee([document.documentElement,document.body],c["no-backdrop"])}function Fe(e,t){t&&(t in c?ee(e,c[t]):(p('The "position" parameter is not valid, defaulting to "center"'),ee(e,c.center)))}function Be(e,t){t&&ee(e,c[`grow-${t}`])}var ze={innerParams:new WeakMap,domCache:new WeakMap};const Le=["input","file","range","select","radio","checkbox","textarea"],Pe=(e,t)=>{const n=S();if(!n)return;const s=ze.innerParams.get(e),r=!s||t.input!==s.input;Le.forEach((e=>{const s=ne(n,c[e]);s&&(Ge(e,t.inputAttributes),s.className=c[e],r&&ie(s))})),t.input&&(r&&Ve(t),Ue(t))},Ve=e=>{if(!e.input)return;if(!Ke[e.input])return void f(`Unexpected type of input! Expected ${Object.keys(Ke).join(" | ")}, got "${e.input}"`);const t=He(e.input);if(!t)return;const n=Ke[e.input](t,e);re(t),e.inputAutoFocus&&setTimeout((()=>{Q(n)}))},We=e=>{for(let t=0;t{const n=S();if(!n)return;const s=Y(n,e);if(s){We(s);for(const e in t)s.setAttribute(e,t[e])}},Ue=e=>{if(!e.input)return;const t=He(e.input);t&&Z(t,e,"input")},qe=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},je=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=c["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&ee(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},He=e=>{const t=S();if(t)return ne(t,c[e]||c.input)},$e=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:A(t)||p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Ke={};Ke.text=Ke.email=Ke.password=Ke.number=Ke.tel=Ke.url=Ke.search=Ke.date=Ke["datetime-local"]=Ke.time=Ke.week=Ke.month=(e,t)=>($e(e,t.inputValue),je(e,e,t),qe(e,t),e.type=t.input,e),Ke.file=(e,t)=>(je(e,e,t),qe(e,t),e),Ke.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return $e(n,t.inputValue),n.type=t.input,$e(s,t.inputValue),je(n,e,t),e},Ke.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");$(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return je(e,e,t),e},Ke.radio=e=>(e.textContent="",e),Ke.checkbox=(e,t)=>{const n=Y(S(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return $(s,t.inputPlaceholder||t.inputLabel),n},Ke.textarea=(e,t)=>{$e(e,t.inputValue),qe(e,t),je(e,e,t);const n=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout((()=>{if("MutationObserver"in window){const s=parseInt(window.getComputedStyle(S()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const r=e.offsetWidth+n(e);r>s?S().style.width=`${r}px`:se(S(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Xe=(e,t)=>{const n=T();n&&(ae(n),Z(n,t,"htmlContainer"),t.html?(ke(t.html,n),re(n,"block")):t.text?(n.textContent=t.text,re(n,"block")):ie(n),Pe(e,t))},Ze=(e,t)=>{const n=P();n&&(ae(n),le(n,t.footer,"block"),t.footer&&ke(t.footer,n),Z(n,t,"footer"))},Ye=(e,t)=>{const n=ze.innerParams.get(e),s=_();if(s){if(n&&t.icon===n.icon)return nt(s,t),void Qe(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(h).indexOf(t.icon))return f(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void ie(s);re(s),nt(s,t),Qe(s,t),ee(s,t.showClass&&t.showClass.icon)}else ie(s)}},Qe=(e,t)=>{for(const[n,s]of Object.entries(h))t.icon!==n&&te(e,s);ee(e,t.icon&&h[t.icon]),st(e,t),Je(),Z(e,t,"icon")},Je=()=>{const e=S();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e\n \n
        \n
        \n',tt='\n \n \n \n \n',nt=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";t.iconHtml?s=rt(t.iconHtml):"success"===t.icon?(s=et,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=tt:t.icon&&(s=rt({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&$(e,s)},st=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"background-color",t.iconColor);oe(e,".swal2-success-ring","border-color",t.iconColor)}},rt=e=>`
        ${e}
        `,it=(e,t)=>{const n=N();n&&(t.imageUrl?(re(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),se(n,"width",t.imageWidth),se(n,"height",t.imageHeight),n.className=c.image,Z(n,t,"image")):ie(n))},at=(e,t)=>{const n=x(),s=S();if(n&&s){if(t.toast){se(n,"width",t.width),s.style.width="100%";const e=z();e&&s.insertBefore(e,_())}else se(s,"width",t.width);se(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),ie(R()),ot(s,t)}},ot=(e,t)=>{const n=t.showClass||{};e.className=`${c.popup} ${ue(e)?n.popup:""}`,t.toast?(ee([document.documentElement,document.body],c["toast-shown"]),ee(e,c.toast)):ee(e,c.modal),Z(e,t,"popup"),"string"==typeof t.customClass&&ee(e,t.customClass),t.icon&&ee(e,c[`icon-${t.icon}`])},lt=(e,t)=>{const n=O();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(re(n),n.textContent="",r>=s.length&&p("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach(((e,i)=>{const a=ut(e);if(n.appendChild(a),i===r&&ee(a,c["active-progress-step"]),i!==s.length-1){const e=ct(t);n.appendChild(e)}}))):ie(n)},ut=e=>{const t=document.createElement("li");return ee(t,c["progress-step"]),$(t,e),t},ct=e=>{const t=document.createElement("li");return ee(t,c["progress-step-line"]),e.progressStepsDistance&&se(t,"width",e.progressStepsDistance),t},ht=(e,t)=>{const n=I();n&&(ae(n),le(n,t.title||t.titleText,"block"),t.title&&ke(t.title,n),t.titleText&&(n.innerText=t.titleText),Z(n,t,"title"))},dt=(e,t)=>{at(e,t),De(e,t),lt(e,t),Ye(e,t),it(e,t),ht(e,t),Re(e,t),Xe(e,t),Ie(e,t),Ze(e,t);const n=S();"function"==typeof t.didRender&&n&&t.didRender(n),a.eventEmitter.emit("didRender",n)},pt=()=>ue(S()),ft=()=>{var e;return null===(e=D())||void 0===e?void 0:e.click()},mt=()=>{var e;return null===(e=F())||void 0===e?void 0:e.click()},gt=()=>{var e;return null===(e=M())||void 0===e?void 0:e.click()},yt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),bt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},wt=(e,t,n)=>{bt(e),t.toast||(e.keydownHandler=e=>Ct(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:S(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},vt=(e,t)=>{var n;const s=U();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=S())||void 0===n||n.focus()},At=["ArrowRight","ArrowDown"],xt=["ArrowLeft","ArrowUp"],Ct=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?kt(t,e):"Tab"===t.key?St(t):[...At,...xt].includes(t.key)?_t(t.key):"Escape"===t.key&&Et(t,e,n)))},kt=(e,t)=>{if(!b(t.allowEnterKey))return;const n=Y(S(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;ft(),e.preventDefault()}},St=e=>{const t=e.target,n=U();let s=-1;for(let e=0;e{const t=L(),n=D(),s=F(),r=M();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=At.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{b(t.allowEscapeKey)&&(e.preventDefault(),n(yt.esc))};var It={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Tt=()=>{const e=x();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))},Nt=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Ot="undefined"!=typeof window&&!!window.GestureEvent,Rt=()=>{if(Ot&&!K(document.body,c.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",ee(document.body,c.iosfix),Dt()}},Dt=()=>{const e=x();if(!e)return;let t;e.ontouchstart=e=>{t=Mt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Mt=e=>{const t=e.target,n=x(),s=T();return!(!n||!s||Ft(e)||Bt(e)||t!==n&&(he(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||he(s)&&s.contains(t)))},Ft=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Bt=e=>e.touches&&e.touches.length>1,zt=()=>{if(K(document.body,c.iosfix)){const e=parseInt(document.body.style.top,10);te(document.body,c.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},Lt=()=>{const e=document.createElement("div");e.className=c["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Pt=null;const Vt=e=>{null===Pt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Pt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Pt+Lt()}px`)},Wt=()=>{null!==Pt&&(document.body.style.paddingRight=`${Pt}px`,Pt=null)};function Gt(e,t,n,s){j()?Yt(e,s):(l(n).then((()=>Yt(e,s))),bt(a)),Ot?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),q()&&(Wt(),zt(),Nt()),Ut()}function Ut(){te([document.documentElement,document.body],[c.shown,c["height-auto"],c["no-backdrop"],c["toast-shown"]])}function qt(e){e=Kt(e);const t=It.swalPromiseResolve.get(this),n=jt(this);this.isAwaitingPromise?e.isDismissed||($t(this),t(e)):n&&t(e)}const jt=e=>{const t=S();if(!t)return!1;const n=ze.innerParams.get(e);if(!n||K(t,n.hideClass.popup))return!1;te(t,n.showClass.popup),ee(t,n.hideClass.popup);const s=x();return te(s,n.showClass.backdrop),ee(s,n.hideClass.backdrop),Xt(e,t,n),!0};function Ht(e){const t=It.swalPromiseReject.get(this);$t(this),t&&t(e)}const $t=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,ze.innerParams.get(e)||e._destroy())},Kt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Xt=(e,t,n)=>{const s=x(),r=Ee&&de(t);"function"==typeof n.willClose&&n.willClose(t),a.eventEmitter.emit("willClose",t),r?Zt(e,t,s,n.returnFocus,n.didClose):Gt(e,s,n.returnFocus,n.didClose)},Zt=(e,t,n,s,r)=>{Ee&&(a.swalCloseEventFinishedCallback=Gt.bind(null,e,n,s,r),t.addEventListener(Ee,(function(e){e.target===t&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback)})))},Yt=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),a.eventEmitter.emit("didClose"),e._destroy&&e._destroy()}))},Qt=e=>{let t=S();if(t||new nr,t=S(),!t)return;const n=z();j()?ie(_()):Jt(t,e),re(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},Jt=(e,t)=>{const n=L(),s=z();n&&s&&(!t&&ue(D())&&(t=D()),re(n),t&&(ie(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),ee([e,n],c.loading))},en=(e,t)=>{"select"===t.input||"radio"===t.input?an(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(w(t.inputValue)||A(t.inputValue))&&(Qt(D()),on(e,t))},tn=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return nn(n);case"radio":return sn(n);case"file":return rn(n);default:return t.inputAutoTrim?n.value.trim():n.value}},nn=e=>e.checked?1:0,sn=e=>e.checked?e.value:null,rn=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,an=(e,t)=>{const n=S();if(!n)return;const s=e=>{"select"===t.input?ln(n,cn(e),t):"radio"===t.input&&un(n,cn(e),t)};w(t.inputOptions)||A(t.inputOptions)?(Qt(D()),v(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):f("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},on=(e,t)=>{const n=e.getInput();n&&(ie(n),v(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,re(n),n.focus(),e.hideLoading()})).catch((t=>{f(`Error in inputValue promise: ${t}`),n.value="",re(n),n.focus(),e.hideLoading()})))};function ln(e,t,n){const s=ne(e,c.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,$(r,t),r.selected=hn(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}function un(e,t,n){const s=ne(e,c.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=c.radio,i.value=t,hn(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");$(o,r),o.className=c.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}const cn=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=cn(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=cn(s)),t.push([n,s])})),t},hn=(e,t)=>!!t&&t.toString()===e.toString(),dn=e=>{const t=ze.innerParams.get(e);e.disableButtons(),t.input?mn(e,"confirm"):vn(e,!0)},pn=e=>{const t=ze.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?mn(e,"deny"):yn(e,!1)},fn=(e,t)=>{e.disableButtons(),t(yt.cancel)},mn=(e,t)=>{const n=ze.innerParams.get(e);if(!n.input)return void f(`The "input" parameter is needed to be set when using returnInputValueOn${d(t)}`);const s=e.getInput(),r=tn(e,n);n.inputValidator?gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?yn(e,r):vn(e,r)},gn=(e,t,n)=>{const s=ze.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>v(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?yn(e,t):vn(e,t)}))},yn=(e,t)=>{const n=ze.innerParams.get(e||void 0);n.showLoaderOnDeny&&Qt(F()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),$t(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>wn(e||void 0,t)))):e.close({isDenied:!0,value:t})},bn=(e,t)=>{e.close({isConfirmed:!0,value:t})},wn=(e,t)=>{e.rejectPromise(t)},vn=(e,t)=>{const n=ze.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Qt(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preConfirm(t,n.validationMessage)))).then((n=>{ue(R())||!1===n?(e.hideLoading(),$t(e)):bn(e,void 0===n?t:n)})).catch((t=>wn(e||void 0,t)))):bn(e,t)};function An(){const e=ze.innerParams.get(this);if(!e)return;const t=ze.domCache.get(this);ie(t.loader),j()?e.icon&&re(_()):xn(t),te([t.popup,t.actions],c.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const xn=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?re(t[0],"inline-block"):ce()&&ie(e.actions)};function Cn(){const e=ze.innerParams.get(this),t=ze.domCache.get(this);return t?Y(t.popup,e.input):null}function kn(e,t,n){const s=ze.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function Sn(e,t){const n=S();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${c.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(Rn,e),zn=e=>-1!==Dn.indexOf(e),Ln=e=>Mn[e],Pn=e=>{Bn(e)||p(`Unknown parameter "${e}"`)},Vn=e=>{Fn.includes(e)&&p(`The parameter "${e}" is incompatible with toasts`)},Wn=e=>{const t=Ln(e);t&&y(e,t)},Gn=e=>{!1===e.backdrop&&e.allowOutsideClick&&p('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Pn(t),e.toast&&Vn(t),Wn(t)};function Un(e){const t=S(),n=ze.innerParams.get(this);if(!t||K(t,n.hideClass.popup))return void p("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=qn(e),r=Object.assign({},n,s);dt(this,r),ze.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const qn=e=>{const t={};return Object.keys(e).forEach((n=>{zn(n)?t[n]=e[n]:p(`Invalid parameter to update: ${n}`)})),t};function jn(){const e=ze.domCache.get(this),t=ze.innerParams.get(this);t?(e.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),a.eventEmitter.emit("didDestroy"),Hn(this)):$n(this)}const Hn=e=>{$n(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},$n=e=>{e.isAwaitingPromise?(Kn(ze,e),e.isAwaitingPromise=!0):(Kn(It,e),Kn(ze,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Kn=(e,t)=>{for(const n in e)e[n].delete(t)};var Xn=Object.freeze({__proto__:null,_destroy:jn,close:qt,closeModal:qt,closePopup:qt,closeToast:qt,disableButtons:En,disableInput:Tn,disableLoading:An,enableButtons:_n,enableInput:In,getInput:Cn,handleAwaitingPromise:$t,hideLoading:An,rejectPromise:Ht,resetValidationMessage:On,showValidationMessage:Nn,update:Un});const Zn=(e,t,n)=>{e.toast?Yn(e,t,n):(es(t),ts(t),ns(e,t,n))},Yn=(e,t,n)=>{t.popup.onclick=()=>{e&&(Qn(e)||e.timer||e.input)||n(yt.close)}},Qn=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Jn=!1;const es=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Jn=!0)}}},ts=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Jn=!0)}}},ns=(e,t,n)=>{t.container.onclick=s=>{Jn?Jn=!1:s.target===t.container&&b(e.allowOutsideClick)&&n(yt.backdrop)}},ss=e=>"object"==typeof e&&e.jquery,rs=e=>e instanceof Element||ss(e),is=e=>{const t={};return"object"!=typeof e[0]||rs(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];"string"==typeof r||rs(r)?t[n]=r:void 0!==r&&f(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof r}`)})):Object.assign(t,e[0]),t};function as(){for(var e=arguments.length,t=new Array(e),n=0;na.timeout&&a.timeout.getTimerLeft(),us=()=>{if(a.timeout)return fe(),a.timeout.stop()},cs=()=>{if(a.timeout){const e=a.timeout.start();return pe(e),e}},hs=()=>{const e=a.timeout;return e&&(e.running?us():cs())},ds=e=>{if(a.timeout){const t=a.timeout.increase(e);return pe(t,!0),t}},ps=()=>!(!a.timeout||!a.timeout.isRunning());let fs=!1;const ms={};function gs(){ms[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,fs||(document.body.addEventListener("click",ys),fs=!0)}const ys=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in ms){const n=t.getAttribute(e);if(n)return void ms[e].fire({template:n})}};class bs{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}}a.eventEmitter=new bs;const ws=(e,t)=>{a.eventEmitter.on(e,t)},vs=(e,t)=>{a.eventEmitter.once(e,t)},As=(e,t)=>{e?t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e):a.eventEmitter.reset()};var xs=Object.freeze({__proto__:null,argsToParams:is,bindClickHandler:gs,clickCancel:gt,clickConfirm:ft,clickDeny:mt,enableLoading:Qt,fire:as,getActions:L,getCancelButton:M,getCloseButton:W,getConfirmButton:D,getContainer:x,getDenyButton:F,getFocusableElements:U,getFooter:P,getHtmlContainer:T,getIcon:_,getIconContent:E,getImage:N,getInputLabel:B,getLoader:z,getPopup:S,getProgressSteps:O,getTimerLeft:ls,getTimerProgressBar:V,getTitle:I,getValidationMessage:R,increaseTimer:ds,isDeprecatedParameter:Ln,isLoading:H,isTimerRunning:ps,isUpdatableParameter:zn,isValidParameter:Bn,isVisible:pt,mixin:os,off:As,on:ws,once:vs,resumeTimer:cs,showLoading:Qt,stopTimer:us,toggleTimer:hs});class Cs{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const ks=["swal-title","swal-html","swal-footer"],Ss=e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Ds(n),Object.assign(_s(n),Es(n),Is(n),Ts(n),Ns(n),Os(n),Rs(n,ks))},_s=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{Ms(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&("boolean"==typeof Rn[n]?t[n]="false"!==s:"object"==typeof Rn[n]?t[n]=JSON.parse(s):t[n]=s)})),t},Es=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},Is=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{Ms(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${d(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},Ts=e=>{const t={},n=e.querySelector("swal-image");return n&&(Ms(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},Ns=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Ms(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Os=e=>{const t={},n=e.querySelector("swal-input");n&&(Ms(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{Ms(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},Rs=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(Ms(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},Ds=e=>{const t=ks.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||p(`Unrecognized element <${n}>`)}))},Ms=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])}))},Fs=10,Bs=e=>{const t=x(),n=S();"function"==typeof e.willOpen&&e.willOpen(n),a.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;Vs(t,n,e),setTimeout((()=>{Ls(t,n)}),Fs),q()&&(Ps(t,e.scrollbarPadding,s),Tt()),j()||a.previousActiveElement||(a.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),a.eventEmitter.emit("didOpen",n),te(t,c["no-transition"])},zs=e=>{const t=S();if(e.target!==t||!Ee)return;const n=x();t.removeEventListener(Ee,zs),n.style.overflowY="auto"},Ls=(e,t)=>{Ee&&de(t)?(e.style.overflowY="hidden",t.addEventListener(Ee,zs)):e.style.overflowY="auto"},Ps=(e,t,n)=>{Rt(),t&&"hidden"!==n&&Vt(n),setTimeout((()=>{e.scrollTop=0}))},Vs=(e,t,n)=>{ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),re(t,"grid"),setTimeout((()=>{ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),Fs)):re(t,"grid"),ee([document.documentElement,document.body],c.shown),n.heightAuto&&n.backdrop&&!n.toast&&ee([document.documentElement,document.body],c["height-auto"])};var Ws={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function Gs(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Ws.email),"url"===e.input&&(e.inputValidator=Ws.url))}function Us(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(p('Target parameter is not valid, defaulting to "body"'),e.target="body")}function qs(e){Gs(e),e.showLoaderOnConfirm&&!e.preConfirm&&p("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),Us(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
        ")),Ce(e)}let js;var Hs=new WeakMap;class $s{constructor(){if(s(this,Hs,void 0),"undefined"==typeof window)return;js=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(Gn(Object.assign({},t,e)),a.currentInstance){const e=It.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),q()&&Nt()}a.currentInstance=js;const n=Xs(e,t);qs(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);const s=Zs(js);return dt(js,n),ze.innerParams.set(js,n),Ks(js,s,n)}then(e){return n(Hs,this).then(e)}finally(e){return n(Hs,this).finally(e)}}const Ks=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};It.swalPromiseResolve.set(e,s),It.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{dn(e)},t.denyButton.onclick=()=>{pn(e)},t.cancelButton.onclick=()=>{fn(e,i)},t.closeButton.onclick=()=>{i(yt.close)},Zn(n,t,i),wt(a,n,i),en(e,n),Bs(n),Ys(a,n,i),Qs(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Xs=(e,t)=>{const n=Ss(e),s=Object.assign({},Rn,t,n,e);return s.showClass=Object.assign({},Rn.showClass,s.showClass),s.hideClass=Object.assign({},Rn.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Zs=e=>{const t={popup:S(),container:x(),actions:L(),confirmButton:D(),denyButton:F(),cancelButton:M(),loader:z(),closeButton:W(),validationMessage:R(),progressSteps:O()};return ze.domCache.set(e,t),t},Ys=(e,t,n)=>{const s=V();ie(s),t.timer&&(e.timeout=new Cs((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(re(s),Z(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&pe(t.timer)}))))},Qs=(e,t)=>{if(!t.toast)return b(t.allowEnterKey)?void(Js(e)||er(e,t)||vt(-1,1)):(y("allowEnterKey"),void tr())},Js=e=>{const t=e.popup.querySelectorAll("[autofocus]");for(const e of t)if(e instanceof HTMLElement&&ue(e))return e.focus(),!0;return!1},er=(e,t)=>t.focusDeny&&ue(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ue(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ue(e.confirmButton)||(e.confirmButton.focus(),0)),tr=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}$s.prototype.disableButtons=En,$s.prototype.enableButtons=_n,$s.prototype.getInput=Cn,$s.prototype.disableInput=Tn,$s.prototype.enableInput=In,$s.prototype.hideLoading=An,$s.prototype.disableLoading=An,$s.prototype.showValidationMessage=Nn,$s.prototype.resetValidationMessage=On,$s.prototype.close=qt,$s.prototype.closePopup=qt,$s.prototype.closeModal=qt,$s.prototype.closeToast=qt,$s.prototype.rejectPromise=Ht,$s.prototype.update=Un,$s.prototype._destroy=jn,Object.assign($s,xs),Object.keys(Xn).forEach((e=>{$s[e]=function(){return js&&js[e]?js[e](...arguments):null}})),$s.DismissReason=yt,$s.version="11.14.0";const nr=$s;return nr.default=nr,nr}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2)},9171:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AMOscillator:()=>fa,AMSynth:()=>Ha,Abs:()=>Na,Add:()=>Aa,AmplitudeEnvelope:()=>Ua,Analyser:()=>ml,AudioToGain:()=>da,AutoFilter:()=>Ro,AutoPanner:()=>Mo,AutoWah:()=>Bo,BaseContext:()=>Kr,BiquadFilter:()=>$a,BitCrusher:()=>Lo,Buffer:()=>Xl,BufferSource:()=>Yl,Buffers:()=>Zl,Channel:()=>Cl,Chebyshev:()=>Vo,Chorus:()=>jo,Clock:()=>zi,Compressor:()=>Tl,Context:()=>Xr,Convolver:()=>Fl,CrossFade:()=>To,DCMeter:()=>wl,Delay:()=>Li,Destination:()=>Vl,Distortion:()=>Ho,Draw:()=>jl,DuoSynth:()=>Ya,EQ3:()=>Ml,Emitter:()=>$r,Envelope:()=>Pa,FFT:()=>bl,FMOscillator:()=>ma,FMSynth:()=>Qa,FatOscillator:()=>ya,FeedbackCombFilter:()=>lo,FeedbackDelay:()=>Ko,Filter:()=>Ka,Follower:()=>Fo,Freeverb:()=>Jo,Frequency:()=>wi,FrequencyClass:()=>gi,FrequencyEnvelope:()=>Xa,FrequencyShifter:()=>Zo,Gain:()=>Ti,GainToAudio:()=>Oa,Gate:()=>Nl,GrainPlayer:()=>Ta,GreaterThan:()=>Fa,GreaterThanZero:()=>Ma,IntervalTimeline:()=>Hi,JCReverb:()=>sl,LFO:()=>ka,Limiter:()=>Ol,Listener:()=>Ul,Loop:()=>go,LowpassCombFilter:()=>co,Master:()=>Wl,MembraneSynth:()=>to,Merge:()=>Go,MetalSynth:()=>eo,Meter:()=>yl,MidSideCompressor:()=>Rl,MidSideMerge:()=>cl,MidSideSplit:()=>ul,Midi:()=>Gi,MidiClass:()=>Wi,Mono:()=>kl,MonoSynth:()=>Za,MultibandCompressor:()=>Dl,MultibandSplit:()=>Sl,Multiply:()=>pa,Negate:()=>Ra,Noise:()=>na,NoiseSynth:()=>no,Offline:()=>Pi,OfflineContext:()=>ei,OmniOscillator:()=>va,OnePoleFilter:()=>uo,Oscillator:()=>ua,PWMOscillator:()=>ba,PanVol:()=>xl,Panner:()=>Do,Panner3D:()=>El,Param:()=>ki,Part:()=>yo,Pattern:()=>Eo,Phaser:()=>ol,PingPongDelay:()=>il,PitchShift:()=>al,Player:()=>Ea,Players:()=>Ia,PluckSynth:()=>ho,PolySynth:()=>po,Pow:()=>Ba,PulseOscillator:()=>ga,Recorder:()=>Il,Reverb:()=>ll,Sampler:()=>fo,Scale:()=>xa,ScaleExp:()=>za,Sequence:()=>Io,Signal:()=>Ri,Solo:()=>Al,Split:()=>Wo,StateTimeline:()=>Ci,StereoWidener:()=>dl,Subtract:()=>Da,SyncedSignal:()=>La,Synth:()=>qa,Ticks:()=>qi,TicksClass:()=>Ui,Time:()=>mi,TimeClass:()=>fi,Timeline:()=>Gr,ToneAudioBuffer:()=>Jr,ToneAudioBuffers:()=>Vi,ToneAudioNode:()=>Si,ToneBufferSource:()=>ta,ToneEvent:()=>mo,ToneOscillatorNode:()=>la,Transport:()=>Ll,TransportTime:()=>Ai,TransportTimeClass:()=>vi,Tremolo:()=>pl,Unit:()=>r,UserMedia:()=>aa,Vibrato:()=>fl,Volume:()=>Ki,WaveShaper:()=>ha,Waveform:()=>vl,Zero:()=>Ca,connect:()=>Ei,connectSeries:()=>_i,connectSignal:()=>Di,context:()=>$l,dbToGain:()=>ai,debug:()=>s,defaultArg:()=>Dr,disconnect:()=>Ii,ftom:()=>ci,gainToDb:()=>oi,getContext:()=>si,getDestination:()=>Gl,getDraw:()=>Hl,getListener:()=>ql,getTransport:()=>Pl,immediate:()=>zl,intervalToFrequencyRatio:()=>li,isArray:()=>yr,isBoolean:()=>gr,isDefined:()=>dr,isFunction:()=>pr,isNote:()=>wr,isNumber:()=>fr,isObject:()=>mr,isString:()=>br,isUndef:()=>hr,loaded:()=>Kl,mtof:()=>di,now:()=>Bl,optionsFromArguments:()=>Rr,setContext:()=>ri,start:()=>ii,supported:()=>sr,version:()=>i});var s={};n.r(s),n.d(s,{assert:()=>rr,assertContextRunning:()=>ar,assertRange:()=>ir,log:()=>ur,setLogger:()=>lr,warn:()=>cr});var r={};n.r(r);const i="14.7.77",a=(e,t,n)=>({endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}),o=(e,t,n)=>({endTime:t,insertTime:n,type:"linearRampToValue",value:e}),l=(e,t)=>({startTime:t,type:"setValue",value:e}),u=(e,t,n)=>({duration:n,startTime:t,type:"setValueCurve",values:e}),c=(e,t,{startTime:n,target:s,timeConstant:r})=>s+(t-s)*Math.exp((n-e)/r),h=e=>"exponentialRampToValue"===e.type,d=e=>"linearRampToValue"===e.type,p=e=>h(e)||d(e),f=e=>"setValue"===e.type,m=e=>"setValueCurve"===e.type,g=(e,t,n,s)=>{const r=e[t];return void 0===r?s:p(r)||f(r)?r.value:m(r)?r.values[r.values.length-1]:c(n,g(e,t-1,r.startTime,s),r)},y=(e,t,n,s,r)=>void 0===n?[s.insertTime,r]:p(n)?[n.endTime,n.value]:f(n)?[n.startTime,n.value]:m(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,g(e,t-1,n.startTime,r)],b=e=>"cancelAndHold"===e.type,w=e=>"cancelScheduledValues"===e.type,v=e=>b(e)||w(e)?e.cancelTime:h(e)||d(e)?e.endTime:e.startTime,A=(e,t,n,{endTime:s,value:r})=>n===r?r:0n+(e-t)/(s-t)*(r-n),C=(e,{duration:t,startTime:n,values:s})=>((e,t)=>{const n=Math.floor(t),s=Math.ceil(t);return n===s?e[n]:(1-(t-n))*e[n]+(1-(s-t))*e[s]})(s,(e-n)/t*(s.length-1)),k=e=>"setTarget"===e.type;class S{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=v(e);if(b(e)||w(e)){const n=this._automationEvents.findIndex((n=>w(e)&&m(n)?n.startTime+n.duration>=t:v(n)>=t)),s=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),b(e)){const e=this._automationEvents[this._automationEvents.length-1];if(void 0!==s&&p(s)){if(void 0!==e&&k(e))throw new Error("The internal list is malformed.");const n=void 0===e?s.insertTime:m(e)?e.startTime+e.duration:v(e),r=void 0===e?this._defaultValue:m(e)?e.values[e.values.length-1]:e.value,i=h(s)?A(t,n,r,s):x(t,n,r,s),l=h(s)?a(i,t,this._currenTime):o(i,t,this._currenTime);this._automationEvents.push(l)}if(void 0!==e&&k(e)&&this._automationEvents.push(l(this.getValue(t),t)),void 0!==e&&m(e)&&e.startTime+e.duration>t){const n=t-e.startTime,s=(e.values.length-1)/e.duration,r=Math.max(2,1+Math.ceil(n*s)),i=n/(r-1)*s,a=e.values.slice(0,r);if(i<1)for(let t=1;tv(e)>t)),s=-1===n?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[n-1];if(void 0!==s&&m(s)&&v(s)+s.duration>t)return!1;const r=h(e)?a(e.value,e.endTime,this._currenTime):d(e)?o(e.value,t,this._currenTime):e;if(-1===n)this._automationEvents.push(r);else{if(m(e)&&t+e.duration>v(this._automationEvents[n]))return!1;this._automationEvents.splice(n,0,r)}}return!0}flush(e){const t=this._automationEvents.findIndex((t=>v(t)>e));if(t>1){const e=this._automationEvents.slice(t-1),n=e[0];k(n)&&e.unshift(l(g(this._automationEvents,t-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=e}}getValue(e){if(0===this._automationEvents.length)return this._defaultValue;const t=this._automationEvents.findIndex((t=>v(t)>e)),n=this._automationEvents[t],s=(-1===t?this._automationEvents.length:t)-1,r=this._automationEvents[s];if(void 0!==r&&k(r)&&(void 0===n||!p(n)||n.insertTime>e))return c(e,g(this._automationEvents,s-1,r.startTime,this._defaultValue),r);if(void 0!==r&&f(r)&&(void 0===n||!p(n)))return r.value;if(void 0!==r&&m(r)&&(void 0===n||!p(n)||r.startTime+r.duration>e))return eB},z=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,L=(e,t)=>{const n=[];let s=e.replace(/^[\s]+/,""),r=s.match(z);for(;null!==r;){const e=r[1].slice(1,-1),i=r[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(i),s=s.slice(r[0].length).replace(/^[\s]+/,""),r=s.match(z)}return[n.join(";"),s]},P=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},V=e=>{if(!(e=>{try{new new Proxy(e,B)}catch{return!1}return!0})(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},W=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},G=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[s]=n;return e.delete(s),s},U=(e,t,n,s)=>{const r=W(e,t),i=G(r,(e=>e[0]===n&&e[1]===s));return 0===r.size&&e.delete(t),i},q=e=>W(R,e),j=e=>{if(_.has(e))throw new Error("The AudioNode is already stored.");_.add(e),q(e).forEach((e=>e(!0)))},H=e=>"port"in e,$=e=>{if(!_.has(e))throw new Error("The AudioNode is not stored.");_.delete(e),q(e).forEach((e=>e(!1)))},K=(e,t)=>{!H(e)&&t.every((e=>0===e.size))&&$(e)},X={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Z=(e,t)=>e.context===t,Y=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Q=()=>new DOMException("","IndexSizeError"),J=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Q();throw e}})},ee={numberOfChannels:1},te=-34028234663852886e22,ne=-te,se=e=>_.has(e),re={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},ie=e=>W(E,e),ae=e=>W(T,e),oe=(e,t)=>{const{activeInputs:n}=ie(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||oe(n,[...t,e])}))));const s=(e=>"playbackRate"in e)(e)?[e.playbackRate]:H(e)?Array.from(e.parameters.values()):(e=>"frequency"in e&&"gain"in e)(e)?[e.Q,e.detune,e.frequency,e.gain]:(e=>"offset"in e)(e)?[e.offset]:(e=>!("frequency"in e)&&"gain"in e)(e)?[e.gain]:(e=>"detune"in e&&"frequency"in e)(e)?[e.detune,e.frequency]:(e=>"pan"in e)(e)?[e.pan]:[];for(const e of s){const n=ae(e);void 0!==n&&n.activeInputs.forEach((([e])=>oe(e,t)))}se(e)&&$(e)},le=e=>{oe(e.destination,[])},ue=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ce=e=>"context"in e,he=e=>ce(e[0]),de=(e,t,n,s)=>{for(const t of e)if(n(t)){if(s)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},pe=(e,t,[n,s],r)=>{de(e,[t,n,s],(e=>e[0]===t&&e[1]===n),r)},fe=(e,[t,n,s],r)=>{const i=e.get(t);void 0===i?e.set(t,new Set([[n,s]])):de(i,[n,s],(e=>e[0]===n),r)},me=e=>"inputs"in e,ge=(e,t,n,s)=>{if(me(t)){const r=t.inputs[s];return e.connect(r,n,0),[r,n,0]}return e.connect(t,n,s),[t,n,s]},ye=(e,t,n)=>{for(const s of e)if(s[0]===t&&s[1]===n)return e.delete(s),s;return null},be=(e,t)=>{if(!q(e).delete(t))throw new Error("Missing the expected event listener.")},we=(e,t,n)=>{const s=W(e,t),r=G(s,(e=>e[0]===n));return 0===s.size&&e.delete(t),r},ve=(e,t,n,s)=>{me(t)?e.disconnect(t.inputs[s],n,0):e.disconnect(t,n,s)},Ae=e=>W(I,e),xe=e=>W(N,e),Ce=e=>D.has(e),ke=e=>!_.has(e),Se=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),s=e.createGain(),r=e.createBuffer(1,2,44100),i=r.getChannelData(0);i[0]=1,i[1]=1;const a=e.createBufferSource();a.buffer=r,a.loop=!0,a.connect(t).connect(e.destination),a.connect(s),a.disconnect(s),t.onaudioprocess=s=>{const r=s.inputBuffer.getChannelData(0);Array.prototype.some.call(r,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.start()}})),_e=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},Ee=e=>"context"in e,Ie=e=>{const t=new Map;e.connect=(e=>(n,s=0,r=0)=>{const i=Ee(n)?e(n,s,r):e(n,s),a=t.get(n);return void 0===a?t.set(n,[{input:r,output:s}]):a.every((e=>e.input!==r||e.output!==s))&&a.push({input:r,output:s}),i})(e.connect.bind(e)),e.disconnect=(n=>(s,r,i)=>{if(n.apply(e),void 0===s)t.clear();else if("number"==typeof s)for(const[e,n]of t){const r=n.filter((e=>e.output!==s));0===r.length?t.delete(e):t.set(e,r)}else if(t.has(s))if(void 0===r)t.delete(s);else{const e=t.get(s);if(void 0!==e){const n=e.filter((e=>e.output!==r&&(e.input!==i||void 0===i)));0===n.length?t.delete(s):t.set(s,n)}}for(const[n,s]of t)s.forEach((t=>{Ee(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})(e.disconnect)},Te=(e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ae(t),{outputs:a}=ie(e),o=q(e),l=a=>{const o=Ae(e),l=xe(t);if(a){const t=we(i,e,n);pe(r,e,t,!1),s||Ce(e)||o.connect(l,n)}else{const t=((e,t,n)=>G(e,(e=>e[0]===t&&e[1]===n)))(r,e,n);fe(i,t,!1),s||Ce(e)||o.disconnect(l,n)}};return!!de(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(o.add(l),se(e)?pe(r,e,[n,l],!0):fe(i,[e,n,l],!0),!0)},Ne=(e,t,n,s,r)=>{const[i,a]=((e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ie(t),a=ye(r[s],e,n);if(null===a)return[U(i,e,n,s)[2],!1];return[a[2],!0]})(e,n,s,r);if(null!==i&&(be(e,i),!a||t||Ce(e)||ve(Ae(e),Ae(n),s,r)),se(n)){const{activeInputs:e}=ie(n);K(n,e)}},Oe=(e,t,n,s)=>{const[r,i]=((e,t,n)=>{const{activeInputs:s,passiveInputs:r}=ae(t),i=ye(s,e,n);if(null===i)return[we(r,e,n)[1],!1];return[i[2],!0]})(e,n,s);null!==r&&(be(e,r),!i||t||Ce(e)||Ae(e).disconnect(xe(n),s))};class Re{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,s)=>e.call(t,n,s,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const De={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function Me(e,t,n,s,r){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],s,r);else{const i=e.getChannelData(s);if(0===t[n].byteLength)t[n]=i.slice(r,r+128);else{const e=new Float32Array(i.buffer,r*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const Fe=(e,t,n,s,r)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],s,r):0!==t[n].byteLength&&e.getChannelData(s).set(t[n],r)},Be=(e,t)=>{const n=[];for(let s=0;s{const o=null===t?128*Math.ceil(e.context.length/128):t.length,l=s.channelCount*s.numberOfInputs,u=r.reduce(((e,t)=>e+t),0),c=0===u?null:n.createBuffer(u,o,n.sampleRate);if(void 0===i)throw new Error("Missing the processor constructor.");const h=ie(e),d=await((e,t)=>{const n=W(F,e),s=Ae(t);return W(n,s)})(n,e),p=Be(s.numberOfInputs,s.channelCount),f=Be(s.numberOfOutputs,r),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let u=0;u0&&null!==t)for(let e=0;e{Me(t,m,e,l+n,u)}));for(let e=0;e0===h.activeInputs[t].size?[]:e)),t=a(u/n.sampleRate,n.sampleRate,(()=>d.process(e,f,m)));if(null!==c)for(let e=0,t=0;e{const{port1:t,port2:n}=new MessageChannel;return new Promise((s=>{const r=()=>{n.onmessage=null,t.close(),n.close(),s()};n.onmessage=()=>r();try{t.postMessage(e,[e])}catch{}finally{r()}}))},qe={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},je=(e,t,n)=>{const s=t[n];if(void 0===s)throw e();return s},He={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},$e={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ke=()=>new DOMException("","InvalidStateError"),Xe=()=>new DOMException("","InvalidAccessError"),Ze={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Ye=(e,t,n,s,r,i,a,o,l,u,c)=>{const h=u.length;let d=o;for(let o=0;o{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},et={numberOfChannels:1},tt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n]&&(e[n]=s)},nt=(e,t)=>{tt(e,t,"channelCount"),tt(e,t,"channelCountMode"),tt(e,t,"channelInterpretation")},st=e=>"function"==typeof e.getFloatTimeDomainData,rt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n].value&&(e[n].value=s)},it=e=>{e.start=(t=>(n=0,s=0,r)=>{if("number"==typeof r&&r<0||s<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,s,r)})(e.start)},at=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},ot=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),lt=async(e,t)=>{const n=await(e=>new Promise(((t,n)=>{const{port1:s,port2:r}=new MessageChannel;s.onmessage=({data:e})=>{s.close(),r.close(),t(e)},s.onmessageerror=({data:e})=>{s.close(),r.close(),n(e)},r.postMessage(e)})))(t);return new e(n)},ut=(e,t)=>{const n=e.createBiquadFilter();return nt(n,t),rt(n,t,"Q"),rt(n,t,"detune"),rt(n,t,"frequency"),rt(n,t,"gain"),tt(n,t,"type"),n},ct=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return nt(n,t),(e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Ke()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw Ke()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw Ke()}})})(n),n},ht=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),dt=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return nt(n,t),rt(n,t,"delayTime"),n},pt=(e,t)=>{const n=e.createGain();return nt(n,t),rt(n,t,"gain"),n};function ft(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function mt(e,t){let n=[0,0];for(let i=e.length-1;i>=0;i-=1)r=t,n=[(s=n)[0]*r[0]-s[1]*r[1],s[0]*r[1]+s[1]*r[0]],n[0]+=e[i];var s,r;return n}const gt=(e,t,n,s)=>e.createScriptProcessor(t,n,s),yt=()=>new DOMException("","NotSupportedError"),bt={numberOfChannels:1},wt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},vt={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},At={disableNormalization:!1},xt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Ct=()=>new DOMException("","UnknownError"),kt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},St=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),_t=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},Et=(e,t,n,s)=>{let r=e;for(;!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);const{get:i,set:a}=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,{get:n(i),set:s(a)})},It=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(s){if(9!==s.code)throw s;It(e,t,n+1e-7)}},Tt=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Nt=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Ot=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},Rt=()=>{try{new DOMException}catch{return!1}return!0},Dt=()=>new Promise((e=>{const t=new ArrayBuffer(0),{port1:n,port2:s}=new MessageChannel;n.onmessage=({data:t})=>e(null!==t),s.postMessage(t,[t])})),Mt=(e,t)=>{const n=t.createGain();e.connect(n);const s=(t=>()=>{t.call(e,n),e.removeEventListener("ended",s)})(e.disconnect);e.addEventListener("ended",s),ht(e,n),e.stop=(t=>{let s=!1;return(r=0)=>{if(s)try{t.call(e,r)}catch{n.gain.setValueAtTime(0,r)}else t.call(e,r),s=!0}})(e.stop)},Ft=(e,t)=>n=>{const s={value:e};return Object.defineProperties(n,{currentTarget:s,target:s}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Bt=(e=>(t,n,[s,r,i],a)=>{e(t[r],[n,s,i],(e=>e[0]===n&&e[1]===s),a)})(de),zt=(e=>(t,n,[s,r,i],a)=>{const o=t.get(s);void 0===o?t.set(s,new Set([[r,n,i]])):e(o,[r,n,i],(e=>e[0]===r&&e[1]===n),a)})(de),Lt=(e=>(t,n,s,r)=>e(t[r],(e=>e[0]===n&&e[1]===s)))(G),Pt=new WeakMap,Vt=(e=>t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:0})(Pt),Wt=(Gt=new Map,Ut=new WeakMap,(e,t)=>{const n=Ut.get(e);if(void 0!==n)return n;const s=Gt.get(e);if(void 0!==s)return s;try{const n=t();return n instanceof Promise?(Gt.set(e,n),n.catch((()=>!1)).then((t=>(Gt.delete(e),Ut.set(e,t),t)))):(Ut.set(e,n),n)}catch{return Ut.set(e,!1),!1}});var Gt,Ut;const qt="undefined"==typeof window?null:window,jt=((e,t)=>(n,s)=>{const r=n.createAnalyser();if(nt(r,s),!(s.maxDecibels>s.minDecibels))throw t();return tt(r,s,"fftSize"),tt(r,s,"maxDecibels"),tt(r,s,"minDecibels"),tt(r,s,"smoothingTimeConstant"),e(st,(()=>st(r)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const s=Math.max(n.length,e.fftSize);for(let e=0;et=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer})(ie),$t=((e,t,n)=>async(s,r,i)=>{const a=e(s);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,o])=>{const l=t(e),u=await l.render(e,r),c=s.context.destination;n(e)||s===c&&n(s)||u.connect(i,o,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(ie,Ht,Ce),Kt=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(jt,Ae,$t),Xt=(Zt=O,e=>{const t=Zt.get(e);if(void 0===t)throw Ke();return t});var Zt;const Yt=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(qt),Qt=(e=>t=>null!==e&&t instanceof e)(Yt),Jt=new WeakMap,en=(e=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(t,n,s){if(null!==n){let r=this._listeners.get(n);void 0===r&&(r=e(this,n),"function"==typeof n&&this._listeners.set(n,r)),this._nativeEventTarget.addEventListener(t,r,s)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const s=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===s?null:s,n)}})(Ft),tn=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(qt),nn=(e=>t=>null!==e&&t instanceof e)(tn),sn=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(qt),rn=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(qt),an=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(qt),on=((e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m)=>class extends u{constructor(t,s,r,i){super(r),this._context=t,this._nativeAudioNode=r;const a=c(t);h(a)&&!0!==n(Se,(()=>Se(a,m)))&&Ie(r),I.set(this,r),R.set(this,new Set),"closed"!==t.state&&s&&j(this),e(this,i,r)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,o=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw r();const u=c(this._context),h=f(u);if(d(e)||p(e))throw i();if(ce(e)){const r=Ae(e);try{const t=ge(this._nativeAudioNode,r,n,o),s=ke(this);(h||s)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!s&&ke(e)&&j(e)}catch(e){if(12===e.code)throw i();throw e}if(t(this,e,n,o,h)){const t=l([this],e);_e(t,s(h))}return e}const m=xe(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(h||ke(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw i();throw e}if(Te(this,e,n,h)){const t=l([this],e);_e(t,s(h))}}disconnect(e,t,n){let s;const a=c(this._context),u=f(a);if(void 0===e)s=((e,t)=>{const n=ie(e),s=[];for(const r of n.outputs)he(r)?Ne(e,t,...r):Oe(e,t,...r),s.push(r[0]);return n.outputs.clear(),s})(this,u);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw r();s=((e,t,n)=>{const s=ie(e),r=[];for(const i of s.outputs)i[1]===n&&(he(i)?Ne(e,t,...i):Oe(e,t,...i),r.push(i[0]),s.outputs.delete(i));return r})(this,u,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw r();if(ce(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw r();if(s=((e,t,n,s,r)=>{const i=ie(e);return Array.from(i.outputs).filter((e=>!(e[0]!==n||void 0!==s&&e[1]!==s||void 0!==r&&e[2]!==r))).map((n=>(he(n)?Ne(e,t,...n):Oe(e,t,...n),i.outputs.delete(n),n[0])))})(this,u,e,t,n),0===s.length)throw i()}for(const e of s){const t=l([this],e);_e(t,o)}}})((ln=E,(e,t,n)=>{const s=[];for(let e=0;e{const p=new WeakMap;return(f,m,g,y,b)=>{const{activeInputs:w,passiveInputs:v}=i(m),{outputs:A}=i(f),x=o(f),C=i=>{const o=l(m),u=l(f);if(i){const t=U(v,f,g,y);e(w,f,t,!1),b||h(f)||n(u,o,g,y),d(m)&&j(m)}else{const e=s(w,f,g,y);t(v,y,e,!1),b||h(f)||r(u,o,g,y);const n=a(m);if(0===n)c(m)&&K(m,w);else{const e=p.get(m);void 0!==e&&clearTimeout(e),p.set(m,setTimeout((()=>{c(m)&&K(m,w)}),1e3*n))}}};return!!u(A,[m,g,y],(e=>e[0]===m&&e[1]===g&&e[2]===y),!0)&&(x.add(C),c(f)?e(w,f,[g,y,C],!0):t(v,y,[f,g,C],!0),!0)}})(Bt,zt,ge,Lt,ve,ie,Vt,q,Ae,de,se,Ce,ke),Wt,((e,t,n,s,r,i)=>a=>(o,l)=>{const u=e.get(o);if(void 0===u){if(!a&&i(o)){const e=s(o),{outputs:i}=n(o);for(const n of i)if(he(n)){const r=s(n[0]);t(e,r,n[1],n[2])}else{const t=r(n[0]);e.disconnect(t,n[1])}}e.set(o,l)}else e.set(o,u+l)})(D,ve,ie,Ae,xe,se),Q,Xe,yt,((e,t,n,s,r,i,a,o)=>(l,u)=>{const c=t.get(l);if(void 0===c)throw new Error("Missing the expected cycle count.");const h=i(l.context),d=o(h);if(c===u){if(t.delete(l),!d&&a(l)){const t=s(l),{outputs:i}=n(l);for(const n of i)if(he(n)){const r=s(n[0]);e(t,r,n[1],n[2])}else{const e=r(n[0]);t.connect(e,n[1])}}}else t.set(l,c-u)})(ge,D,ie,Ae,xe,Xt,se,Qt),((e,t,n)=>function s(r,i){const a=ce(i)?i:n(e,i);if((e=>"delayTime"in e)(a))return[];if(r[0]===a)return[r];if(r.includes(a))return[];const{outputs:o}=t(a);return Array.from(o).map((e=>s([...r,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Jt,ie,W),en,Xt,nn,sn,rn,Qt,an);var ln;const un=((e,t,n,s,r,i)=>class extends e{constructor(e,n){const a=r(e),o={...X,...n},l=s(a,o);super(e,!1,l,i(a)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(on,Kt,Q,jt,Xt,Qt),cn=new WeakSet,hn=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(qt),dn=(pn=new Uint32Array(1),e=>(pn[0]=e,pn[0]));var pn;const fn=((e,t)=>n=>{n.copyFromChannel=(s,r,i=0)=>{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=a<0?-a:0;e+a{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=a<0?-a:0;e+at=>{t.copyFromChannel=(n=>(s,r,i=0)=>{const a=e(i),o=e(r);if(a(s,r,i=0)=>{const a=e(i),o=e(r);if(a{let l=null;return class u{constructor(u){if(null===r)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:c,numberOfChannels:h,sampleRate:d}={...ee,...u};null===l&&(l=new r(1,1,44100));const p=null!==s&&t(i,i)?new s({length:c,numberOfChannels:h,sampleRate:d}):l.createBuffer(h,c,d);if(0===p.numberOfChannels)throw n();return"function"!=typeof p.copyFromChannel?(a(p),J(p)):t(Y,(()=>Y(p)))||o(p),e.add(p),p}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===u.prototype||e.has(t)}}})(cn,Wt,yt,hn,Yt,(e=>()=>{if(null===e)return!1;try{new e({length:1,sampleRate:44100})}catch{return!1}return!0})(hn),fn,mn),yn=(e=>(t,n)=>{const s=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(s).connect(t.destination);const r=()=>{n.removeEventListener("ended",r),n.disconnect(s),s.disconnect()};n.addEventListener("ended",r)})(pt),bn=((e,t,n)=>async(s,r,i)=>{const a=t(s);await Promise.all(Array.from(a.activeInputs).map((async([t,s])=>{const a=e(t),o=await a.render(t,r);n(t)||o.connect(i,s)})))})(Ht,ae,Ce),wn=(e=>(t,n,s)=>e(n,t,s))(bn),vn=((e,t,n,s,r,i,a,o,l,u,c)=>(h,d)=>{const p=h.createBufferSource();return nt(p,d),rt(p,d,"playbackRate"),tt(p,d,"buffer"),tt(p,d,"loop"),tt(p,d,"loopEnd"),tt(p,d,"loopStart"),t(n,(()=>n(h)))||(e=>{e.start=(t=>{let n=!1;return(s=0,r=0,i)=>{if(n)throw Ke();t.call(e,s,r,i),n=!0}})(e.start)})(p),t(s,(()=>s(h)))||l(p),t(r,(()=>r(h)))||u(p,h),t(i,(()=>i(h)))||it(p),t(a,(()=>a(h)))||c(p,h),t(o,(()=>o(h)))||at(p),e(h,p),p})(yn,Wt,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),Tt,Nt,Ot,(e=>{e.start=(t=>(n=0,s=0,r)=>{const i=e.buffer,a=null===i?s:Math.min(i.duration,s);null!==i&&a>i.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,r)})(e.start)}),(e=>(t,n)=>{const s=n.createBuffer(1,1,44100);null===t.buffer&&(t.buffer=s),e(t,"buffer",(e=>()=>{const n=e.call(t);return n===s?null:n}),(e=>n=>e.call(t,null===n?s:n)))})(Et),Mt),An=((e,t)=>(n,s,r)=>(e(s).replay(r),t(s,n,r)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(ae),bn),xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,u){const c=i.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={buffer:c.buffer,channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,loop:c.loop,loopEnd:c.loopEnd,loopStart:c.loopStart,playbackRate:c.playbackRate.value};c=t(u,e),null!==a&&c.start(...a),null!==o&&c.stop(o)}return i.set(u,c),h?await e(u,l.playbackRate,c.playbackRate):await s(u,l.playbackRate,c.playbackRate),await r(l,u,c),c})(l,u)}}})(wn,vn,Ae,An,$t),Cn=((e,t,n,s,r,i,a,o,l,u,c,h,d)=>(p,f,m,g=null,y=null)=>{const b=m.value,w=new S(b),v=f?s(w):null,A={get defaultValue(){return b},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===y?m.minValue:y},get value(){return m.value},set value(e){m.value=e,A.setValueAtTime(e,p.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===v&&w.flush(p.context.currentTime),w.add(r(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(w).pop();null===v&&w.flush(p.context.currentTime),w.add(r(e));const n=Array.from(w).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return A},cancelScheduledValues:e=>(null===v&&w.flush(p.context.currentTime),w.add(i(e)),m.cancelScheduledValues(e),A),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),A},linearRampToValueAtTime(e,t){const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(o(e,t)),m.linearRampToValueAtTime(e,t),A},setTargetAtTime:(e,t,n)=>(null===v&&w.flush(p.context.currentTime),w.add(l(e,t,n)),m.setTargetAtTime(e,t,n),A),setValueAtTime:(e,t)=>(null===v&&w.flush(p.context.currentTime),w.add(u(e,t)),m.setValueAtTime(e,t),A),setValueCurveAtTime(e,t,n){const s=e instanceof Float32Array?e:new Float32Array(e);if(null!==h&&"webkitAudioContext"===h.name){const e=t+n,r=p.context.sampleRate,i=Math.ceil(t*r),a=Math.floor(e*r),o=a-i,l=new Float32Array(o);for(let e=0;e{kn.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),Jt,N,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:s}=n;t.exponentialRampToValueAtTime(s,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:s}=n;t.linearRampToValueAtTime(s,e)}else if("setTarget"===n.type){const{startTime:e,target:s,timeConstant:r}=n;t.setTargetAtTime(s,e,r)}else if("setValue"===n.type){const{startTime:e,value:s}=n;t.setValueAtTime(s,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:s,values:r}=n;t.setValueCurveAtTime(r,s,e)}}}})),(e=>({cancelTime:e,type:"cancelAndHold"})),(e=>({cancelTime:e,type:"cancelScheduledValues"})),((e,t)=>({endTime:t,type:"exponentialRampToValue",value:e})),((e,t)=>({endTime:t,type:"linearRampToValue",value:e})),((e,t,n)=>({startTime:t,target:e,timeConstant:n,type:"setTarget"})),l,u,tn,It);var kn;const Sn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const o=i(e),l={...re,...s},u=r(o,l),c=a(o),h=c?t():null;super(e,!1,u,h),this._audioBufferSourceNodeRenderer=h,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=u,this._onended=null,this._playbackRate=n(this,c,u.playbackRate,ne,te)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?o(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){j(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(on,xn,Cn,Ke,vn,Xt,Qt,Ft),_n=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,n){const s=i(e),l=a(s),u=r(s,n,l);super(e,!1,u,l?t(o):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=u}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(on,(e=>{const t=new WeakMap;return{render(n,s){const r=t.get(s);return void 0!==r?Promise.resolve(r):(async(n,s)=>{const r=s.destination;return t.set(s,r),await e(n,s,r),r})(n,s)}}}),Q,Ke,((e,t)=>(n,s,r)=>{const i=n.destination;if(i.channelCount!==s)try{i.channelCount=s}catch{}r&&"explicit"!==i.channelCountMode&&(i.channelCountMode="explicit"),0===i.maxChannelCount&&Object.defineProperty(i,"maxChannelCount",{value:s});const a=e(n,{channelCount:s,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{i.channelCount=t}catch(e){if(t>i.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>i.maxChannelCount}),a.connect(i),a})(pt,Et),Xt,Qt,$t),En=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(o,e)}return i.set(o,l),u?(await e(o,a.Q,l.Q),await e(o,a.detune,l.detune),await e(o,a.frequency,l.frequency),await e(o,a.gain,l.gain)):(await s(o,a.Q,l.Q),await s(o,a.detune,l.detune),await s(o,a.frequency,l.frequency),await s(o,a.gain,l.gain)),await r(a,o,l),l})(a,o)}}})(wn,ut,Ae,An,$t),In=(e=>(t,n)=>e.set(t,n))(Pt),Tn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const l=i(e),u={...Le,...s},c=r(l,u),h=a(l);super(e,!1,c,h?n():null),this._Q=t(this,h,c.Q,ne,te),this._detune=t(this,h,c.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,h,c.frequency,e.sampleRate/2,0),this._gain=t(this,h,c.gain,40*Math.log10(ne),te),this._nativeBiquadFilterNode=c,o(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw s();throw e}if(e.length!==t.length||t.length!==n.length)throw s()}})(on,Cn,En,Xe,ut,Xt,Qt,In),Nn=((e,t)=>(n,s,r)=>{const i=new Set;return n.connect=(r=>(a,o=0,l=0)=>{const u=0===i.size;if(t(a))return r.call(n,a,o,l),e(i,[a,o,l],(e=>e[0]===a&&e[1]===o&&e[2]===l),!0),u&&s(),a;r.call(n,a,o),e(i,[a,o],(e=>e[0]===a&&e[1]===o),!0),u&&s()})(n.connect),n.disconnect=(e=>(s,a,o)=>{const l=i.size>0;if(void 0===s)e.apply(n),i.clear();else if("number"==typeof s){e.call(n,s);for(const e of i)e[1]===s&&i.delete(e)}else{t(s)?e.call(n,s,a,o):e.call(n,s,a);for(const e of i)e[0]!==s||void 0!==a&&e[1]!==a||void 0!==o&&e[2]!==o||i.delete(e)}const u=0===i.size;l&&u&&r()})(n.disconnect),n})(de,sn),On=((e,t)=>(n,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw e()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw e()}});const r=n.createBufferSource();t(s,(()=>{const e=s.numberOfInputs;for(let t=0;tr.disconnect(s)))})(Ke,Nn),Rn=((e,t)=>(n,s)=>{const r=n.createChannelMerger(s.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,r),nt(r,s),r})(tn,On),Dn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(Rn,Ae,$t),Mn=((e,t,n,s,r)=>class extends e{constructor(e,i){const a=s(e),o={...Pe,...i};super(e,!1,n(a,o),r(a)?t():null)}})(on,Dn,Rn,Xt,Qt),Fn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(ct,Ae,$t),Bn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l=i({...Ve,...a});super(e,!1,n(o,l),r(o)?t():null)}})(on,Fn,ct,Xt,Qt,(e=>({...e,channelCount:e.numberOfOutputs}))),zn=((e,t,n,s)=>(r,{offset:i,...a})=>{const o=r.createBuffer(1,2,44100),l=t(r,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),u=n(r,{...a,gain:i}),c=o.getChannelData(0);c[0]=1,c[1]=1,l.buffer=o,l.loop=!0;const h={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get offset(){return u.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(r,l),s(ht(h,u),(()=>l.connect(u)),(()=>l.disconnect(u)))})(yn,vn,pt,Nn),Ln=((e,t,n,s,r)=>(i,a)=>{if(void 0===i.createConstantSource)return n(i,a);const o=i.createConstantSource();return nt(o,a),rt(o,a,"offset"),t(s,(()=>s(i)))||it(o),t(r,(()=>r(i)))||at(o),e(i,o),o})(yn,Wt,zn,Tt,Ot),Pn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,u){const c=i.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,offset:c.offset.value};c=t(u,e),null!==a&&c.start(a),null!==o&&c.stop(o)}return i.set(u,c),h?await e(u,l.offset,c.offset):await s(u,l.offset,c.offset),await r(l,u,c),c})(l,u)}}})(wn,Ln,Ae,An,$t),Vn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...We,...a},u=s(o,l),c=i(o),h=c?n():null;super(e,!1,u,h),this._constantSourceNodeRenderer=h,this._nativeConstantSourceNode=u,this._offset=t(this,c,u.offset,ne,te),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(on,Cn,Pn,Ln,Xt,Qt,Ft),Wn=((e,t)=>(n,s)=>{const r=n.createConvolver();if(nt(r,s),s.disableNormalization===r.normalize&&(r.normalize=!s.disableNormalization),tt(r,s,"buffer"),s.channelCount>2)throw e();if(t(r,"channelCount",(e=>()=>e.call(r)),(t=>n=>{if(n>2)throw e();return t.call(r,n)})),"max"===s.channelCountMode)throw e();return t(r,"channelCountMode",(e=>()=>e.call(r)),(t=>n=>{if("max"===n)throw e();return t.call(r,n)})),r})(yt,Et),Gn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(Wn,Ae,$t),Un=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l={...Ge,...a},u=n(o,l);super(e,!1,u,r(o)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=u,null!==l.buffer&&i(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,i(this,0)}else this._isBufferNullified=!1,i(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(on,Gn,Wn,Xt,Qt,In),qn=((e,t,n,s,r)=>i=>{const a=new WeakMap;return{render(o,l){const u=a.get(l);return void 0!==u?Promise.resolve(u):(async(o,l)=>{let u=n(o);const c=Z(u,l);if(!c){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:i};u=t(l,e)}return a.set(l,u),c?await e(l,o.delayTime,u.delayTime):await s(l,o.delayTime,u.delayTime),await r(o,l,u),u})(o,l)}}})(wn,dt,Ae,An,$t),jn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),u={...qe,...o},c=s(l,u),h=i(l);super(e,!1,c,h?n(u.maxDelayTime):null),this._delayTime=t(this,h,c.delayTime),a(this,u.maxDelayTime)}get delayTime(){return this._delayTime}})(on,Cn,qn,dt,Xt,Qt,In),Hn=(e=>(t,n)=>{const s=t.createDynamicsCompressor();if(nt(s,n),n.channelCount>2)throw e();if("max"===n.channelCountMode)throw e();return rt(s,n,"attack"),rt(s,n,"knee"),rt(s,n,"ratio"),rt(s,n,"release"),rt(s,n,"threshold"),s})(yt),$n=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(o,e)}return i.set(o,l),u?(await e(o,a.attack,l.attack),await e(o,a.knee,l.knee),await e(o,a.ratio,l.ratio),await e(o,a.release,l.release),await e(o,a.threshold,l.threshold)):(await s(o,a.attack,l.attack),await s(o,a.knee,l.knee),await s(o,a.ratio,l.ratio),await s(o,a.release,l.release),await s(o,a.threshold,l.threshold)),await r(a,o,l),l})(a,o)}}})(wn,Hn,Ae,An,$t),Kn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,r){const l=i(e),u={...He,...r},c=s(l,u),h=a(l);super(e,!1,c,h?n():null),this._attack=t(this,h,c.attack),this._knee=t(this,h,c.knee),this._nativeDynamicsCompressorNode=c,this._ratio=t(this,h,c.ratio),this._release=t(this,h,c.release),this._threshold=t(this,h,c.threshold),o(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,r()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,r()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(on,Cn,$n,Hn,yt,Xt,Qt,In),Xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(o,e)}return i.set(o,l),u?await e(o,a.gain,l.gain):await s(o,a.gain,l.gain),await r(a,o,l),l})(a,o)}}})(wn,pt,Ae,An,$t),Zn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...$e,...a},u=s(o,l),c=i(o);super(e,!1,u,c?n():null),this._gain=t(this,c,u.gain,ne,te)}get gain(){return this._gain}})(on,Cn,Xn,pt,Xt,Qt),Yn=((e,t,n,s)=>(r,i,{channelCount:a,channelCountMode:o,channelInterpretation:l,feedback:u,feedforward:c})=>{const h=ot(i,r.sampleRate),d=u instanceof Float64Array?u:new Float64Array(u),p=c instanceof Float64Array?c:new Float64Array(c),f=d.length,m=p.length,g=Math.min(f,m);if(0===f||f>20)throw s();if(0===d[0])throw t();if(0===m||m>20)throw s();if(0===p[0])throw t();if(1!==d[0]){for(let e=0;e{const t=e.inputBuffer,n=e.outputBuffer,s=t.numberOfChannels;for(let e=0;ey.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>y.dispatchEvent(e[0]),getFrequencyResponse(t,n,s){if(t.length!==n.length||n.length!==s.length)throw e();const r=t.length;for(let e=0;ey.removeEventListener(e[0],e[1],e[2])},y)})(Xe,Ke,gt,yt),Qn=((e,t,n,s)=>r=>e(Je,(()=>Je(r)))?Promise.resolve(e(s,s)).then((e=>{if(!e){const e=n(r,512,0,1);r.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>r.currentTime,e.connect(r.destination)}return r.startRendering()})):new Promise((e=>{const n=t(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});r.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(r.destination),r.startRendering()})))(Wt,pt,gt,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),s=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{s.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(pt,Yt)),Jn=((e,t,n,s,r)=>(i,a)=>{const o=new WeakMap;let l=null;const u=async(u,c)=>{let h=null,d=t(u);const p=Z(d,c);if(void 0===c.createIIRFilter?h=e(c,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(d=c.createIIRFilter(a,i)),o.set(c,null===h?d:h),null!==h){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(u.context.destination.channelCount,u.context.length,c.sampleRate);l=(async()=>{await s(u,e,e.destination);return((e,t,n,s)=>{const r=n instanceof Float64Array?n:new Float64Array(n),i=s instanceof Float64Array?s:new Float64Array(s),a=r.length,o=i.length,l=Math.min(a,o);if(1!==r[0]){for(let e=0;e(t,n,s)=>{if(void 0===t.createIIRFilter)return e(t,n,s);const r=t.createIIRFilter(s.feedforward,s.feedback);return nt(r,s),r})(Yn),ts=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l=r(o),u={...Ze,...a},c=t(o,l?null:e.baseLatency,u);super(e,!1,c,l?n(u.feedback,u.feedforward):null),(e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,s,r)=>{if(n.length!==s.length||s.length!==r.length)throw Xe();return t.call(e,n,s,r)})})(c),this._nativeIIRFilterNode=c,i(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(on,es,Jn,Xt,Qt,In),ns=((e,t,n,s,r,i,a,o)=>(l,u)=>{const c=u.listener,{forwardX:h,forwardY:d,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:y,upY:b,upZ:w}=void 0===c.forwardX?(()=>{const h=new Float32Array(1),d=t(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=a(u);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const y=()=>{if(f)return;f=!0;const e=s(u,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[i(e,h,0),i(e,h,1),i(e,h,2),i(e,h,3),i(e,h,4),i(e,h,5)];t.some(((e,t)=>e!==m[t]))&&(c.setOrientation(...t),m=t);const n=[i(e,h,6),i(e,h,7),i(e,h,8)];n.some(((e,t)=>e!==g[t]))&&(c.setPosition(...n),g=n)},d.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,c.setOrientation(...m))},w=e=>t=>{t!==g[e]&&(g[e]=t,c.setPosition(...g))},v=(t,s,i)=>{const a=n(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:s});a.connect(d,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>s});const c=e({context:l},p,a.offset,ne,te);var h,f,m,g,b,w,v;return o(c,"value",(e=>()=>e.call(c)),(e=>t=>{try{e.call(c,t)}catch(e){if(9!==e.code)throw e}y(),p&&i(t)})),c.cancelAndHoldAtTime=(h=c.cancelAndHoldAtTime,p?()=>{throw r()}:(...e)=>{const t=h.apply(c,e);return y(),t}),c.cancelScheduledValues=(f=c.cancelScheduledValues,p?()=>{throw r()}:(...e)=>{const t=f.apply(c,e);return y(),t}),c.exponentialRampToValueAtTime=(m=c.exponentialRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=m.apply(c,e);return y(),t}),c.linearRampToValueAtTime=(g=c.linearRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=g.apply(c,e);return y(),t}),c.setTargetAtTime=(b=c.setTargetAtTime,p?()=>{throw r()}:(...e)=>{const t=b.apply(c,e);return y(),t}),c.setValueAtTime=(w=c.setValueAtTime,p?()=>{throw r()}:(...e)=>{const t=w.apply(c,e);return y(),t}),c.setValueCurveAtTime=(v=c.setValueCurveAtTime,p?()=>{throw r()}:(...e)=>{const t=v.apply(c,e);return y(),t}),c};return{forwardX:v(0,0,b(0)),forwardY:v(1,0,b(1)),forwardZ:v(2,-1,b(2)),positionX:v(6,0,w(0)),positionY:v(7,0,w(1)),positionZ:v(8,0,w(2)),upX:v(3,0,b(3)),upY:v(4,1,b(4)),upZ:v(5,0,b(5))}})():c;return{get forwardX(){return h},get forwardY(){return d},get forwardZ(){return p},get positionX(){return f},get positionY(){return m},get positionZ(){return g},get upX(){return y},get upY(){return b},get upZ(){return w}}})(Cn,Rn,Ln,gt,yt,St,Qt,Et),ss=new WeakMap,rs=((e,t,n,s,r,i)=>class extends n{constructor(n,i){super(n),this._nativeContext=n,O.set(this,n),s(n)&&r.set(n,new Set),this._destination=new e(this,i),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?i(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(_n,ns,en,Qt,ss,Ft),is=((e,t,n,s,r,i)=>(a,o)=>{const l=a.createOscillator();return nt(l,o),rt(l,o,"detune"),rt(l,o,"frequency"),void 0!==o.periodicWave?l.setPeriodicWave(o.periodicWave):tt(l,o,"type"),t(n,(()=>n(a)))||it(l),t(s,(()=>s(a)))||i(l,a),t(r,(()=>r(a)))||at(l),e(a,l),l})(yn,Wt,Tt,Nt,Ot,Mt),as=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null,l=null;return{set periodicWave(e){a=e},set start(e){o=e},set stop(e){l=e},render(u,c){const h=i.get(c);return void 0!==h?Promise.resolve(h):(async(u,c)=>{let h=n(u);const d=Z(h,c);if(!d){const e={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,detune:h.detune.value,frequency:h.frequency.value,periodicWave:null===a?void 0:a,type:h.type};h=t(c,e),null!==o&&h.start(o),null!==l&&h.stop(l)}return i.set(c,h),d?(await e(c,u.detune,h.detune),await e(c,u.frequency,h.frequency)):(await s(c,u.detune,h.detune),await s(c,u.frequency,h.frequency)),await r(u,c,h),h})(u,c)}}})(wn,is,Ae,An,$t),os=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...wt,...a},u=n(o,l),c=i(o),h=c?s():null,d=e.sampleRate/2;super(e,!1,u,h),this._detune=t(this,c,u.detune,153600,-153600),this._frequency=t(this,c,u.frequency,d,-d),this._nativeOscillatorNode=u,this._onended=null,this._oscillatorNodeRenderer=h,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(on,Cn,is,as,Xt,Qt,Ft),ls=(e=>(t,n)=>{const s=e(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=t.createBuffer(1,2,44100);return s.buffer=r,s.loop=!0,s.connect(n),s.start(),()=>{s.stop(),s.disconnect(n)}})(vn),us=((e,t,n,s,r)=>(i,{curve:a,oversample:o,...l})=>{const u=i.createWaveShaper(),c=i.createWaveShaper();nt(u,l),nt(c,l);const h=n(i,{...l,gain:1}),d=n(i,{...l,gain:-1}),p=n(i,{...l,gain:1}),f=n(i,{...l,gain:-1});let m=null,g=!1,y=null;const b={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){h.channelCount=e,d.channelCount=e,u.channelCount=e,p.channelCount=e,c.channelCount=e,f.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){h.channelCountMode=e,d.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e,c.channelCountMode=e,f.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){h.channelInterpretation=e,d.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e,c.channelInterpretation=e,f.channelInterpretation=e},get context(){return u.context},get curve(){return y},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)u.curve=n,c.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),s=new Float32Array(e+2-e%2);t[0]=n[0],s[0]=-n[e-1];const r=Math.ceil((e+1)/2),i=(e+1)/2-1;for(let a=1;ah.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>h.dispatchEvent(e[0]),removeEventListener:(...e)=>h.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),o!==b.oversample&&(b.oversample=o);return r(ht(b,p),(()=>{h.connect(u).connect(p),h.connect(d).connect(c).connect(f).connect(p),g=!0,s(y)&&(m=e(i,h))}),(()=>{h.disconnect(u),u.disconnect(p),h.disconnect(d),d.disconnect(c),c.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))})(ls,Ke,pt,_t,Nn),cs=((e,t,n,s,r,i,a)=>(o,l)=>{const u=o.createWaveShaper();if(null!==i&&"webkitAudioContext"===i.name&&void 0===o.createGain().gain.automationRate)return n(o,l);nt(u,l);const c=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==c&&c.length<2)throw t();tt(u,{curve:c},"curve"),tt(u,l,"oversample");let h=null,d=!1;a(u,"curve",(e=>()=>e.call(u)),(t=>n=>(t.call(u,n),d&&(s(n)&&null===h?h=e(o,u):s(n)||null===h||(h(),h=null)),n)));return r(u,(()=>{d=!0,s(u.curve)&&(h=e(o,u))}),(()=>{d=!1,null!==h&&(h(),h=null)}))})(ls,Ke,us,_t,Nn,tn,Et),hs=((e,t,n,s,r,i,a,o,l,u)=>(c,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:y,orientationZ:b,panningModel:w,positionX:v,positionY:A,positionZ:x,refDistance:C,rolloffFactor:k,...S})=>{const _=c.createPanner();if(S.channelCount>2)throw a();if("max"===S.channelCountMode)throw a();nt(_,S);const E={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},I=n(c,{...E,channelInterpretation:"speakers",numberOfInputs:6}),T=s(c,{...S,gain:1}),N=s(c,{...E,gain:1}),O=s(c,{...E,gain:0}),R=s(c,{...E,gain:0}),D=s(c,{...E,gain:0}),M=s(c,{...E,gain:0}),F=s(c,{...E,gain:0}),B=r(c,256,6,1),z=i(c,{...E,curve:new Float32Array([1,1]),oversample:"none"});let L=[g,y,b],P=[v,A,x];const V=new Float32Array(1);B.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,V,0),l(e,V,1),l(e,V,2)];t.some(((e,t)=>e!==L[t]))&&(_.setOrientation(...t),L=t);const n=[l(e,V,3),l(e,V,4),l(e,V,5)];n.some(((e,t)=>e!==P[t]))&&(_.setPosition(...n),P=n)},Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(D.gain,"defaultValue",{get:()=>0}),Object.defineProperty(M.gain,"defaultValue",{get:()=>0}),Object.defineProperty(F.gain,"defaultValue",{get:()=>0});const W={get bufferSize(){},get channelCount(){return _.channelCount},set channelCount(e){if(e>2)throw a();T.channelCount=e,_.channelCount=e},get channelCountMode(){return _.channelCountMode},set channelCountMode(e){if("max"===e)throw a();T.channelCountMode=e,_.channelCountMode=e},get channelInterpretation(){return _.channelInterpretation},set channelInterpretation(e){T.channelInterpretation=e,_.channelInterpretation=e},get coneInnerAngle(){return _.coneInnerAngle},set coneInnerAngle(e){_.coneInnerAngle=e},get coneOuterAngle(){return _.coneOuterAngle},set coneOuterAngle(e){_.coneOuterAngle=e},get coneOuterGain(){return _.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();_.coneOuterGain=e},get context(){return _.context},get distanceModel(){return _.distanceModel},set distanceModel(e){_.distanceModel=e},get inputs(){return[T]},get maxDistance(){return _.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;_.maxDistance=e},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},get orientationX(){return N.gain},get orientationY(){return O.gain},get orientationZ(){return R.gain},get panningModel(){return _.panningModel},set panningModel(e){_.panningModel=e},get positionX(){return D.gain},get positionY(){return M.gain},get positionZ(){return F.gain},get refDistance(){return _.refDistance},set refDistance(e){if(e<0)throw new RangeError;_.refDistance=e},get rolloffFactor(){return _.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;_.rolloffFactor=e},addEventListener:(...e)=>T.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>T.dispatchEvent(e[0]),removeEventListener:(...e)=>T.removeEventListener(e[0],e[1],e[2])};h!==W.coneInnerAngle&&(W.coneInnerAngle=h),d!==W.coneOuterAngle&&(W.coneOuterAngle=d),p!==W.coneOuterGain&&(W.coneOuterGain=p),f!==W.distanceModel&&(W.distanceModel=f),m!==W.maxDistance&&(W.maxDistance=m),g!==W.orientationX.value&&(W.orientationX.value=g),y!==W.orientationY.value&&(W.orientationY.value=y),b!==W.orientationZ.value&&(W.orientationZ.value=b),w!==W.panningModel&&(W.panningModel=w),v!==W.positionX.value&&(W.positionX.value=v),A!==W.positionY.value&&(W.positionY.value=A),x!==W.positionZ.value&&(W.positionZ.value=x),C!==W.refDistance&&(W.refDistance=C),k!==W.rolloffFactor&&(W.rolloffFactor=k),1===L[0]&&0===L[1]&&0===L[2]||_.setOrientation(...L),0===P[0]&&0===P[1]&&0===P[2]||_.setPosition(...P);return u(ht(W,_),(()=>{T.connect(_),e(T,z,0,0),z.connect(N).connect(I,0,0),z.connect(O).connect(I,0,1),z.connect(R).connect(I,0,2),z.connect(D).connect(I,0,3),z.connect(M).connect(I,0,4),z.connect(F).connect(I,0,5),I.connect(B).connect(c.destination)}),(()=>{T.disconnect(_),o(T,z,0,0),z.disconnect(N),N.disconnect(I),z.disconnect(O),O.disconnect(I),z.disconnect(R),R.disconnect(I),z.disconnect(D),D.disconnect(I),z.disconnect(M),M.disconnect(I),z.disconnect(F),F.disconnect(I),I.disconnect(B),B.disconnect(c.destination)}))})(ge,Ke,Rn,pt,gt,cs,yt,ve,St,Nn),ds=(e=>(t,n)=>{const s=t.createPanner();return void 0===s.orientationX?e(t,n):(nt(s,n),rt(s,n,"orientationX"),rt(s,n,"orientationY"),rt(s,n,"orientationZ"),rt(s,n,"positionX"),rt(s,n,"positionY"),rt(s,n,"positionZ"),tt(s,n,"coneInnerAngle"),tt(s,n,"coneOuterAngle"),tt(s,n,"coneOuterGain"),tt(s,n,"distanceModel"),tt(s,n,"maxDistance"),tt(s,n,"panningModel"),tt(s,n,"refDistance"),tt(s,n,"rolloffFactor"),s)})(hs),ps=((e,t,n,s,r,i,a,o,l,u)=>()=>{const c=new WeakMap;let h=null;return{render(d,p){const f=c.get(p);return void 0!==f?Promise.resolve(f):(async(d,p)=>{let f=null,m=i(d);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},y={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=Z(m,p);if("bufferSize"in m)f=s(p,{...g,gain:1});else if(!b){const e={...y,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=r(p,e)}if(c.set(p,null===f?m:f),null!==f){if(null===h){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(6,d.context.length,p.sampleRate),s=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});s.connect(e.destination),h=(async()=>{const t=await Promise.all([d.orientationX,d.orientationY,d.orientationZ,d.positionX,d.positionY,d.positionZ].map((async(t,s)=>{const r=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===s?1:0});return await o(e,t,r.offset),r})));for(let e=0;e<6;e+=1)t[e].connect(s,0,e),t[e].start(0);return u(e)})()}const e=await h,i=s(p,{...g,gain:1});await l(d,p,i);const c=[];for(let t=0;te!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/p.sampleRate;w.gain.setValueAtTime(0,a),w=s(p,{...g,gain:0}),v=r(p,{...y,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),w.gain.setValueAtTime(1,a),i.connect(w).connect(v.inputs[0]),v.connect(f)}}return f}return b?(await e(p,d.orientationX,m.orientationX),await e(p,d.orientationY,m.orientationY),await e(p,d.orientationZ,m.orientationZ),await e(p,d.positionX,m.positionX),await e(p,d.positionY,m.positionY),await e(p,d.positionZ,m.positionZ)):(await o(p,d.orientationX,m.orientationX),await o(p,d.orientationY,m.orientationY),await o(p,d.orientationZ,m.orientationZ),await o(p,d.positionX,m.positionX),await o(p,d.positionY,m.positionY),await o(p,d.positionZ,m.positionZ)),me(m)?await l(d,p,m.inputs[0]):await l(d,p,m),m})(d,p)}}})(wn,Rn,Ln,pt,ds,Ae,Yt,An,$t,Qn),fs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),u={...vt,...o},c=n(l,u),h=i(l);super(e,!1,c,h?s():null),this._nativePannerNode=c,this._orientationX=t(this,h,c.orientationX,ne,te),this._orientationY=t(this,h,c.orientationY,ne,te),this._orientationZ=t(this,h,c.orientationZ,ne,te),this._positionX=t(this,h,c.positionX,ne,te),this._positionY=t(this,h,c.positionY,ne,te),this._positionZ=t(this,h,c.positionZ,ne,te),a(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(on,Cn,ds,ps,Xt,Qt,In),ms=(e=>(t,{disableNormalization:n,imag:s,real:r})=>{const i=s instanceof Float32Array?s:new Float32Array(s),a=r instanceof Float32Array?r:new Float32Array(r),o=t.createPeriodicWave(a,i,{disableNormalization:n});if(Array.from(s).length<2)throw e();return o})(Q),gs=((e,t,n,s)=>class r{constructor(r,i){const a=t(r),o=s({...At,...i}),l=e(a,o);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===r.prototype||n.has(e)}})(ms,Xt,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),ys=((e,t,n,s,r,i)=>{const a=16385,o=new Float32Array([1,1]),l=Math.PI/2,u={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},c={...u,oversample:"none"},h=(e,i,h,d,p)=>{if(1===i)return((e,t,r,i)=>{const h=new Float32Array(a),d=new Float32Array(a);for(let e=0;e{const d=new Float32Array(a),p=new Float32Array(a),f=new Float32Array(a),m=new Float32Array(a),g=Math.floor(8192.5);for(let e=0;eg){const t=(e-g)/(16384-g)*l;d[e]=Math.cos(t),p[e]=Math.sin(t),f[e]=0,m[e]=1}else{const t=e/(16384-g)*l;d[e]=1,p[e]=0,f[e]=Math.cos(t),m[e]=Math.sin(t)}const y=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...u,gain:0}),w=s(e,{...c,curve:d}),v=n(e,{...u,gain:0}),A=s(e,{...c,curve:p}),x=s(e,{...c,curve:o}),C=n(e,{...u,gain:0}),k=s(e,{...c,curve:f}),S=n(e,{...u,gain:0}),_=s(e,{...c,curve:m});return{connectGraph(){r.connect(y),r.connect(void 0===x.inputs?x:x.inputs[0]),y.connect(b,0),y.connect(v,0),y.connect(C,1),y.connect(S,1),x.connect(i),i.connect(void 0===w.inputs?w:w.inputs[0]),i.connect(void 0===A.inputs?A:A.inputs[0]),i.connect(void 0===k.inputs?k:k.inputs[0]),i.connect(void 0===_.inputs?_:_.inputs[0]),w.connect(b.gain),A.connect(v.gain),k.connect(C.gain),_.connect(S.gain),b.connect(h,0,0),C.connect(h,0,0),v.connect(h,0,1),S.connect(h,0,1)},disconnectGraph(){r.disconnect(y),r.disconnect(void 0===x.inputs?x:x.inputs[0]),y.disconnect(b,0),y.disconnect(v,0),y.disconnect(C,1),y.disconnect(S,1),x.disconnect(i),i.disconnect(void 0===w.inputs?w:w.inputs[0]),i.disconnect(void 0===A.inputs?A:A.inputs[0]),i.disconnect(void 0===k.inputs?k:k.inputs[0]),i.disconnect(void 0===_.inputs?_:_.inputs[0]),w.disconnect(b.gain),A.disconnect(v.gain),k.disconnect(C.gain),_.disconnect(S.gain),b.disconnect(h,0,0),C.disconnect(h,0,0),v.disconnect(h,0,1),S.disconnect(h,0,1)}}})(e,h,d,p);throw r()};return(t,{channelCount:s,channelCountMode:a,pan:o,...l})=>{if("max"===a)throw r();const u=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),c=n(t,{...l,channelCount:s,channelCountMode:a,gain:1}),d=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:o});let{connectGraph:p,disconnectGraph:f}=h(t,s,c,d,u);Object.defineProperty(d.gain,"defaultValue",{get:()=>0}),Object.defineProperty(d.gain,"maxValue",{get:()=>1}),Object.defineProperty(d.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount!==e&&(g&&f(),({connectGraph:p,disconnectGraph:f}=h(t,e,c,d,u)),g&&p()),c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw r();c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[c]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get pan(){return d.gain},addEventListener:(...e)=>c.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>c.dispatchEvent(e[0]),removeEventListener:(...e)=>c.removeEventListener(e[0],e[1],e[2])};let g=!1;return i(ht(m,u),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}})(Rn,ct,pt,cs,yt,Nn),bs=((e,t)=>(n,s)=>{const r=s.channelCountMode;if("clamped-max"===r)throw t();if(void 0===n.createStereoPanner)return e(n,s);const i=n.createStereoPanner();return nt(i,s),rt(i,s,"pan"),Object.defineProperty(i,"channelCountMode",{get:()=>r,set:e=>{if(e!==r)throw t()}}),i})(ys,yt),ws=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(o,e)}return i.set(o,l),u?await e(o,a.pan,l.pan):await s(o,a.pan,l.pan),me(l)?await r(a,o,l.inputs[0]):await r(a,o,l),l})(a,o)}}})(wn,bs,Ae,An,$t),vs=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...xt,...a},u=n(o,l),c=i(o);super(e,!1,u,c?s():null),this._pan=t(this,c,u.pan)}get pan(){return this._pan}})(on,Cn,bs,ws,Xt,Qt),As=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(cs,Ae,$t),xs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,t){const o=r(e),l={...kt,...t},u=n(o,l);super(e,!0,u,i(o)?s():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=u,a(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(on,Ke,cs,As,Xt,Qt,In),Cs=(e=>null!==e&&e.isSecureContext)(qt),ks=(e=>(t,n,s)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return s()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(qt),Ss=new WeakMap,_s=((e,t)=>n=>{let s=e.get(n);if(void 0!==s)return s;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),e.set(n,s),s})(Ss,Yt),Es=Cs?((e,t,n,s,r,i,a,o,l,u,c,h,d)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const y=c.get(f);if(void 0!==y&&y.has(m))return Promise.resolve();const b=u.get(f);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const w=i(f),v=void 0===w.audioWorklet?r(m).then((([e,t])=>{const[s,r]=L(e,t);return n(`${s};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${r}\n})})(window,'_AWGS')`)})).then((()=>{const e=d._AWGS.pop();if(void 0===e)throw new SyntaxError;s(w.currentTime,w.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const s=M.get(w);if(void 0!==s){if(s.has(e))throw t();V(n),P(n.parameterDescriptors),s.set(e,n)}else V(n),P(n.parameterDescriptors),M.set(w,new Map([[e,n]]))}),w.sampleRate,void 0,void 0)))})):Promise.all([r(m),Promise.resolve(e(h,h))]).then((([[e,t],n])=>{const s=p+1;p=s;const[r,i]=L(e,t),u=new Blob([`${r};((AudioWorkletProcessor,registerProcessor)=>{${i}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${s}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),c=URL.createObjectURL(u);return w.audioWorklet.addModule(c,g).then((()=>{if(o(w))return w;const e=a(w);return e.audioWorklet.addModule(c,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${s}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(c)))}));return void 0===b?u.set(f,new Map([[m,v]])):b.set(m,v),v.then((()=>{const e=c.get(f);void 0===e?c.set(f,new Set([m])):e.add(m)})).finally((()=>{const e=u.get(f);void 0!==e&&e.delete(m)})),v}})(Wt,yt,(e=>t=>new Promise(((n,s)=>{if(null===e)return void s(new SyntaxError);const r=e.document.head;if(null===r)s(new SyntaxError);else{const i=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(a),l=e.onerror,u=()=>{e.onerror=l,URL.revokeObjectURL(o)};e.onerror=(t,n,r,i,a)=>n===o||n===e.location.href&&1===r&&1===i?(u(),s(a),!1):null!==l?l(t,n,r,i,a):void 0,i.onerror=()=>{u(),s(new SyntaxError)},i.onload=()=>{u(),n()},i.src=o,i.type="module",r.appendChild(i)}})))(qt),ks,(e=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw e()})((()=>new DOMException("","AbortError"))),Xt,_s,Qt,an,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new t(1,128,44100),r=URL.createObjectURL(n);let i=!1,a=!1;try{await s.audioWorklet.addModule(r);const t=new e(s,"a",{numberOfOutputs:0}),n=s.createOscillator();t.port.onmessage=()=>i=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await s.startRendering(),await new Promise((e=>setTimeout(e)))}catch{}finally{URL.revokeObjectURL(r)}return i&&!a})(an,Yt),qt):void 0,Is=((e,t)=>n=>e(n)||t(n))(nn,Qt),Ts=((e,t,n,s,r,i,a,o,l,u,c)=>(h,d)=>{const p=a(h)?h:i(h);if(r.has(d)){const e=n();return Promise.reject(e)}try{r.add(d)}catch{}return t(l,(()=>l(p)))?p.decodeAudioData(d).then((n=>(Ue(d).catch((()=>{})),t(o,(()=>o(n)))||c(n),e.add(n),n))):new Promise(((t,n)=>{const r=async()=>{try{await Ue(d)}catch{}},i=e=>{n(e),r()};try{p.decodeAudioData(d,(n=>{"function"!=typeof n.copyFromChannel&&(u(n),J(n)),e.add(n),r().then((()=>t(n)))}),(e=>{i(null===e?s():e)}))}catch(e){i(e)}}))})(cn,Wt,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,Xt,Is,Y,Je,fn,mn),Ns=((e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m,g,y,b,w)=>class extends f{constructor(t,n){super(t,n),this._nativeContext=t,this._audioWorklet=void 0===e?void 0:{addModule:(t,n)=>e(this,t,n)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new r(this)}createBuffer(e,t,s){return new n({length:t,numberOfChannels:e,sampleRate:s})}createBufferSource(){return new s(this)}createChannelMerger(e=6){return new i(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new a(this,{numberOfOutputs:e})}createConstantSource(){return new o(this)}createConvolver(){return new l(this)}createDelay(e=1){return new c(this,{maxDelayTime:e})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(e,t){return new p(this,{feedback:t,feedforward:e})}createOscillator(){return new m(this)}createPanner(){return new g(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new y(this,{...n,imag:t,real:e})}createStereoPanner(){return new b(this)}createWaveShaper(){return new w(this)}decodeAudioData(e,t,n){return u(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}})(Es,un,gn,Sn,Tn,Mn,Bn,Vn,Un,Ts,jn,Kn,Zn,ts,rs,os,fs,gs,vs,xs),Os=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(on,((e,t)=>e.createMediaElementSource(t.mediaElement)),Xt,Qt),Rs=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e);if(s(i))throw new TypeError;const a={...Qe,...r},o=t(i,a);super(e,!1,o,null),this._nativeMediaStreamAudioDestinationNode=o}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(on,((e,t)=>{const n=e.createMediaStreamDestination();return nt(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),Xt,Qt),Ds=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(on,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.idt.id?1:0));const s=n.slice(0,1),r=e.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(r,"mediaStream",{value:t}),r}),Xt,Qt),Ms=((e,t)=>(n,{mediaStreamTrack:s})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(s);const r=new MediaStream([s]),i=n.createMediaStreamSource(r);if("audio"!==s.kind)throw e();if(t(n))throw new TypeError;return i})(Ke,Qt),Fs=((e,t,n)=>class extends e{constructor(e,s){const r=n(e);super(e,!0,t(r,s),null)}})(on,Ms,Xt),Bs=((e,t,n,s,r,i,a,o,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw s();if(!ue(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:r}=e,{sampleRate:i}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===r?512/i:"interactive"===r||void 0===r?256/i:"playback"===r?1024/i:128*Math.max(2,Math.min(128,Math.round(r*i/128)))/i,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),le(this)})))}createMediaElementSource(e){return new r(this,{mediaElement:e})}createMediaStreamDestination(){return new i(this)}createMediaStreamSource(e){return new a(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new o(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(Ns,Ke,yt,Ct,Os,Rs,Ds,Fs,tn),zs=(e=>t=>{const n=e.get(t);if(void 0===n)throw new Error("The context has no set of AudioWorkletNodes.");return n})(ss),Ls=(e=>(t,n)=>{e(t).add(n)})(zs),Ps=(e=>(t,n,s=0,r=0)=>{const i=t[s];if(void 0===i)throw e();return Ee(n)?i.connect(n,0,r):i.connect(n,0)})(Q),Vs=(e=>(t,n)=>{e(t).delete(n)})(zs),Ws=(e=>(t,n=void 0,s=void 0,r=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?je(e,t,n).disconnect():Ee(n)?void 0===s?t.forEach((e=>e.disconnect(n))):void 0===r?je(e,t,s).disconnect(n,0):je(e,t,s).disconnect(n,0,r):void 0===s?t.forEach((e=>e.disconnect(n))):je(e,t,s).disconnect(n,0))(Q),Gs=new WeakMap,Us=((e,t)=>n=>t(e,n))(Gs,W),qs=((e,t,n,s,r,i,a,o,l,u,c,h,d)=>(p,f,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const y=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(y.some((e=>e<1)))throw l();if(y.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,w=y.reduce(((e,t)=>e+t),0),v=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+v>6||w>6)throw l();const A=new MessageChannel,x=[],C=[];for(let e=0;evoid 0===e?0:e},maxValue:{get:()=>void 0===t?ne:t},minValue:{get:()=>void 0===n?te:n}}),k.push(r)}const S=s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+v)}),_=ot(f,p.sampleRate),E=o(p,_,b+v,Math.max(1,w)),I=r(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),T=[];for(let e=0;e{const n=k[t];return n.connect(S,0,b+t),n.start(0),[e,n.offset]})));S.connect(E);let O=g.channelInterpretation,R=null;const D=0===g.numberOfOutputs?[E]:T,M={get bufferSize(){return _},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return O},set channelInterpretation(e){for(const t of x)t.channelInterpretation=e;O=e},get context(){return E.context},get inputs(){return x},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return R},set onprocessorerror(e){"function"==typeof R&&M.removeEventListener("processorerror",R),R="function"==typeof e?e:null,"function"==typeof R&&M.addEventListener("processorerror",R)},get parameters(){return N},get port(){return A.port2},addEventListener:(...e)=>E.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,D),disconnect:u.bind(null,D),dispatchEvent:(...e)=>E.dispatchEvent(e[0]),removeEventListener:(...e)=>E.removeEventListener(e[0],e[1],e[2])},B=new Map;var z,L;A.port1.addEventListener=(z=A.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=B.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{c(p.currentTime,p.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return z.call(A.port1,e[0],e[1],e[2])}),A.port1.removeEventListener=(L=A.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=B.get(e[1]);void 0!==t&&(B.delete(e[1]),e[1]=t)}return L.call(A.port1,e[0],e[1],e[2])});let P=null;Object.defineProperty(A.port1,"onmessage",{get:()=>P,set:e=>{"function"==typeof P&&A.port1.removeEventListener("message",P),P="function"==typeof e?e:null,"function"==typeof P&&(A.port1.addEventListener("message",P),A.port1.start())}}),m.prototype.port=A.port1;let V=null;const W=((e,t,n,s)=>{let r=F.get(e);void 0===r&&(r=new WeakMap,F.set(e,r));const i=lt(n,s);return r.set(t,i),i})(p,M,m,g);W.then((e=>V=e));const G=Be(g.numberOfInputs,g.channelCount),U=Be(g.numberOfOutputs,y),q=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let j=!0;const H=()=>{g.numberOfOutputs>0&&E.disconnect(I);for(let e=0,t=0;e{if(null!==V){const n=h(M);for(let s=0;s<_;s+=128){for(let t=0;t{Me(e,q,t,b+n,s)}));for(let e=0;e{if(n[t].size>0)return $.set(t,_/128),e;const s=$.get(t);return void 0===s?[]:(e.every((e=>e.every((e=>0===e))))&&(1===s?$.delete(t):$.set(t,s-1)),e)})),r=c(p.currentTime+s/p.sampleRate,p.sampleRate,(()=>V.process(e,U,q)));j=r;for(let e=0,n=0;eE.connect(X).connect(p.destination),Y=()=>{E.disconnect(X),X.disconnect()};return Z(),d(M,(()=>{if(j){Y(),g.numberOfOutputs>0&&E.connect(I);for(let e=0,t=0;e{j&&(Z(),H()),K=!1}))})(Ps,Q,Ke,Rn,ct,Ln,pt,gt,yt,Ws,ks,Us,Nn),js=((e,t,n,s,r)=>(i,a,o,l,u,c)=>{if(null!==o)try{const t=new o(i,l,c),s=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>c.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),t.addEventListener=(d=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=s.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},s.set(t,e[1]))}}return d.call(t,"error",e[1],e[2]),d.call(t,...e)}),t.removeEventListener=(h=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=s.get(e[1]);void 0!==t&&(s.delete(e[1]),e[1]=t)}return h.call(t,"error",e[1],e[2]),h.call(t,e[0],e[1],e[2])}),0!==c.numberOfOutputs){const e=n(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(i.destination);return r(t,(()=>e.disconnect()),(()=>e.connect(i.destination)))}return t}catch(e){if(11===e.code)throw s();throw e}var h,d;if(void 0===u)throw s();return(e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}})(c),t(i,a,u,c)})(Ke,qs,pt,yt,Nn),Hs=((e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m)=>(g,y,b)=>{const w=new WeakMap;let v=null;return{render(A,x){o(x,A);const C=w.get(x);return void 0!==C?Promise.resolve(C):(async(o,A)=>{let x=c(o),C=null;const k=Z(x,A),S=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(null===h){const e=S.reduce(((e,t)=>e+t),0),n=r(A,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),i=[];for(let e=0;e{const l=new d(n,128*Math.ceil(o.context.length/128),A.sampleRate),u=[],c=[];for(let e=0;e{const t=i(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await p(l,e,t.offset),t}))),g=s(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;ef(o,l,e)))),m(l)};v=ze(o,0===n?null:await l(),A,y,S,b,u)}const e=await v,t=n(A,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,c,h]=C;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;et=>e.get(t))(Ss),Ks=(e=>(t,n)=>{e.set(t,n)})(Gs),Xs=Cs?((e,t,n,s,r,i,a,o,l,u,c,h,d,p)=>class extends t{constructor(t,p,f){var m;const g=o(t),y=l(g),b=c({...De,...f});d(b);const w=M.get(g),v=null==w?void 0:w.get(p),A=y||"closed"!==g.state?g:null!==(m=a(g))&&void 0!==m?m:g,x=r(A,y?null:t.baseLatency,u,p,v,b);super(t,!0,x,y?s(p,b,v):null);const C=[];x.parameters.forEach(((e,t)=>{const s=n(this,y,e);C.push([t,s])})),this._nativeAudioWorkletNode=x,this._onprocessorerror=null,this._parameters=new Re(C),y&&e(g,this);const{activeInputs:k}=i(this);h(x,k)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(e){const t="function"==typeof e?p(this,e):null;this._nativeAudioWorkletNode.onprocessorerror=t;const n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==n&&n===t?e:n}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}})(Ls,on,Cn,Hs,js,ie,$s,Xt,Qt,an,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),Ks,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),Ft):void 0,Zs=(((e,t,n,s,r)=>{})(Ke,yt,Ct,rs,tn),((e,t)=>(n,s,r)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,s,r)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(yt,Yt)),Ys=((e,t,n,s,r,i,a,o)=>(l,u)=>n(l).render(l,u).then((()=>Promise.all(Array.from(s(u)).map((e=>n(e).render(e,u)))))).then((()=>r(u))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),J(n)):t(i,(()=>i(n)))||o(n),e.add(n),n))))(cn,Wt,Ht,zs,Qn,Y,fn,mn),Qs=(((e,t,n,s,r)=>{})(Wt,Ke,Zs,rs,Ys),((e,t,n,s,r)=>class extends e{constructor(e,n,r){let i;if("number"==typeof e&&void 0!==n&&void 0!==r)i={length:n,numberOfChannels:e,sampleRate:r};else{if("object"!=typeof e)throw new Error("The given parameters are not valid.");i=e}const{length:a,numberOfChannels:o,sampleRate:l}={...bt,...i},u=s(o,a,l);t(Je,(()=>Je(u)))||u.addEventListener("statechange",(()=>{let e=0;const t=n=>{"running"===this._state&&(e>0?(u.removeEventListener("statechange",t),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):e+=1)};return t})()),super(u,o),this._length=a,this._nativeOfflineAudioContext=u,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(n()):(this._state="running",r(this.destination,this._nativeOfflineAudioContext).finally((()=>{this._state=null,le(this)})))}_waitForThePromiseToSettle(e){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(e):setTimeout((()=>this._waitForThePromiseToSettle(e)))}})(Ns,Wt,Ke,Zs,Ys)),Js=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,nn),er=((e,t)=>n=>e.has(n)||t(n))(I,sn),tr=((e,t)=>n=>e.has(n)||t(n))(N,rn),nr=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,Qt),sr=()=>(async(e,t,n,s,r,i,a,o,l,u,c,h,d,p,f,m)=>{if(e(t,t)&&e(n,n)&&e(r,r)&&e(i,i)&&e(o,o)&&e(l,l)&&e(u,u)&&e(c,c)&&e(h,h)&&e(d,d)&&e(p,p))return(await Promise.all([e(s,s),e(a,a),e(f,f),e(m,m)])).every((e=>e));return!1})(Wt,(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createBuffer(1,1,44100);if(void 0===t.copyToChannel)return!0;const n=new Float32Array(2);try{t.copyFromChannel(n,0,0)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;if(void 0!==e.prototype&&void 0!==e.prototype.close)return!0;const t=new e,n=void 0!==t.close;try{t.close()}catch{}return n})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);return new Promise((e=>{let n=!0;const s=s=>{n&&(n=!1,t.startRendering(),e(s instanceof TypeError))};let r;try{r=t.decodeAudioData(null,(()=>{}),s)}catch(e){s(e)}void 0!==r&&r.catch(s)}))})(Yt),(e=>()=>{if(null===e)return!1;let t;try{t=new e({latencyHint:"balanced"})}catch{return!1}return t.close(),!0})(tn),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createGain(),n=t.connect(t)===t;return t.disconnect(t),n})(Yt),((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new MessageChannel,r=new t(1,128,44100),i=URL.createObjectURL(n);let a=!1;try{await r.audioWorklet.addModule(i);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();await new Promise((e=>{t.port.onmessage=()=>e(),t.port.postMessage(s.port2,[s.port2])})),t.port.onmessage=()=>a=!0,n.connect(t),n.start(0),await r.startRendering(),a=await new Promise((e=>{s.port1.onmessage=({data:t})=>e(1===t),s.port1.postMessage(0)}))}catch{}finally{s.port1.close(),URL.revokeObjectURL(i)}return a})(an,Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createChannelMerger();if("max"===t.channelCountMode)return!0;try{t.channelCount=2}catch{return!0}return!1})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100);return void 0===t.createConstantSource||t.createConstantSource().offset.maxValue!==Number.POSITIVE_INFINITY})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100),n=t.createConvolver();n.buffer=t.createBuffer(1,1,t.sampleRate);try{n.buffer=t.createBuffer(1,1,t.sampleRate)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createConvolver();try{t.channelCount=1}catch{return!1}return!0})(Yt),Rt,(e=>()=>null!==e&&e.hasOwnProperty("isSecureContext"))(qt),(e=>()=>{if(null===e)return!1;const t=new e;try{return t.createMediaStreamSource(new MediaStream),!1}catch(e){return!0}finally{t.close()}})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);if(void 0===t.createStereoPanner)return Promise.resolve(!0);if(void 0===t.createConstantSource)return Promise.resolve(!0);const n=t.createConstantSource(),s=t.createStereoPanner();return n.channelCount=1,n.offset.value=1,s.channelCount=1,n.start(),n.connect(s).connect(t.destination),t.startRendering().then((e=>1!==e.getChannelData(0)[0]))})(Yt),Dt);function rr(e,t){if(!e)throw new Error(t)}function ir(e,t,n=1/0){if(!(t<=e&&e<=n))throw new RangeError(`Value must be within [${t}, ${n}], got: ${e}`)}function ar(e){e.isOffline||"running"===e.state||cr('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let or=console;function lr(e){or=e}function ur(...e){or.log(...e)}function cr(...e){or.warn(...e)}function hr(e){return void 0===e}function dr(e){return!hr(e)}function pr(e){return"function"==typeof e}function fr(e){return"number"==typeof e}function mr(e){return"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object}function gr(e){return"boolean"==typeof e}function yr(e){return Array.isArray(e)}function br(e){return"string"==typeof e}function wr(e){return br(e)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(e)}const vr="object"==typeof self?self:null,Ar=vr&&(vr.hasOwnProperty("AudioContext")||vr.hasOwnProperty("webkitAudioContext"));function xr(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function Cr(e,t,n,s){return new(n||(n=Promise))((function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;class kr{constructor(e,t,n){this._callback=e,this._type=t,this._updateInterval=n,this._createClock()}_createWorker(){const e=new Blob([`\n\t\t\t// the initial timeout time\n\t\t\tlet timeoutTime = ${(1e3*this._updateInterval).toFixed(1)};\n\t\t\t// onmessage callback\n\t\t\tself.onmessage = function(msg){\n\t\t\t\ttimeoutTime = parseInt(msg.data);\n\t\t\t};\n\t\t\t// the tick function which posts a message\n\t\t\t// and schedules a new tick\n\t\t\tfunction tick(){\n\t\t\t\tsetTimeout(tick, timeoutTime);\n\t\t\t\tself.postMessage('tick');\n\t\t\t}\n\t\t\t// call tick initially\n\t\t\ttick();\n\t\t\t`],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);n.onmessage=this._callback.bind(this),this._worker=n}_createTimeout(){this._timeout=setTimeout((()=>{this._createTimeout(),this._callback()}),1e3*this._updateInterval)}_createClock(){if("worker"===this._type)try{this._createWorker()}catch(e){this._type="timeout",this._createClock()}else"timeout"===this._type&&this._createTimeout()}_disposeClock(){this._timeout&&(clearTimeout(this._timeout),this._timeout=0),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){this._updateInterval=Math.max(e,128/44100),"worker"===this._type&&this._worker.postMessage(Math.max(1e3*e,1))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}}function Sr(e){return tr(e)}function _r(e){return er(e)}function Er(e){return nr(e)}function Ir(e){return Js(e)}function Tr(e){return e instanceof AudioBuffer}function Nr(e,t){return"value"===e||Sr(t)||_r(t)||Tr(t)}function Or(e,...t){if(!t.length)return e;const n=t.shift();if(mr(e)&&mr(n))for(const t in n)Nr(t,n[t])?e[t]=n[t]:mr(n[t])?(e[t]||Object.assign(e,{[t]:{}}),Or(e[t],n[t])):Object.assign(e,{[t]:n[t]});return Or(e,...t)}function Rr(e,t,n=[],s){const r={},i=Array.from(t);if(mr(i[0])&&s&&!Reflect.has(i[0],s)){Object.keys(i[0]).some((t=>Reflect.has(e,t)))||(Or(r,{[s]:i[0]}),n.splice(n.indexOf(s),1),i.shift())}if(1===i.length&&mr(i[0]))Or(r,i[0]);else for(let e=0;e{Reflect.has(e,t)&&delete e[t]})),e}class Fr{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||vr&&this.toString()===vr.TONE_DEBUG_CLASS)&&ur(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Fr.version=i;const Br=1e-6;function zr(e,t){return e>t+Br}function Lr(e,t){return zr(e,t)||Vr(e,t)}function Pr(e,t){return e+Brthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(e){const t=this._timeline.indexOf(e);return-1!==t&&this._timeline.splice(t,1),this}get(e,t="time"){const n=this._search(e,t);return-1!==n?this._timeline[n]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t="time"){const n=this._search(e,t);return n+10&&this._timeline[t-1].time=0?this._timeline[n-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(Vr(this._timeline[t].time,e)){for(let n=t;n>=0&&Vr(this._timeline[n].time,e);n--)t=n;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else 1===this._timeline.length&&Lr(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){const t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){const t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t="time"){if(0===this._timeline.length)return-1;let n=0;const s=this._timeline.length;let r=s;if(s>0&&this._timeline[s-1][t]<=e)return s-1;for(;n=0&&this._timeline[n].time>=e;)n--;return this._iterate(t,n+1),this}forEachAtTime(e,t){const n=this._search(e);if(-1!==n&&Vr(this._timeline[n].time,e)){let s=n;for(let t=n;t>=0&&Vr(this._timeline[t].time,e);t--)s=t;this._iterate((e=>{t(e)}),s,n)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Ur=[];function qr(e){Ur.push(e)}const jr=[];function Hr(e){jr.push(e)}class $r extends Fr{constructor(){super(...arguments),this.name="Emitter"}on(e,t){return e.split(/\W+/).forEach((e=>{hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e)||(this._events[e]=[]),this._events[e].push(t)})),this}once(e,t){const n=(...s)=>{t(...s),this.off(e,n)};return this.on(e,n),this}off(e,t){return e.split(/\W+/).forEach((n=>{if(hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e))if(hr(t))this._events[e]=[];else{const n=this._events[e];for(let e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1)}})),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){const n=this._events[e].slice(0);for(let e=0,s=n.length;e{const n=Object.getOwnPropertyDescriptor($r.prototype,t);Object.defineProperty(e.prototype,t,n)}))}dispose(){return super.dispose(),this._events=void 0,this}}class Kr extends $r{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}class Xr extends Kr{constructor(){super(),this.name="Context",this._constants=new Map,this._timeouts=new Gr,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;const e=Rr(Xr.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=function(e){return new Bs(e)}({latencyHint:e.latencyHint}),this._ticker=new kr(this.emit.bind(this,"tick"),e.clockSource,e.updateInterval),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this._setLatencyHint(e.latencyHint),this.lookAhead=e.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){var e;return this._initialized||(e=this,Ur.forEach((t=>t(e))),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,t,n){return this._context.createBuffer(e,t,n)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,n){return this._context.createPeriodicWave(e,t,n)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamSource(e)}createMediaElementSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaElementSource(e)}createMediaStreamDestination(){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){rr(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){rr(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){rr(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){rr(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,t){return function(e,t,n){return rr(dr(Xs),"This node only works in a secure context (https or localhost)"),new Xs(e,t,n)}(this.rawContext,e,t)}addAudioWorkletModule(e,t){return Cr(this,void 0,void 0,(function*(){rr(dr(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(t)||this._workletModules.set(t,this.rawContext.audioWorklet.addModule(e)),yield this._workletModules.get(t)}))}workletsAreReady(){return Cr(this,void 0,void 0,(function*(){const e=[];this._workletModules.forEach((t=>e.push(t))),yield Promise.all(e)}))}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get latencyHint(){return this._latencyHint}_setLatencyHint(e){let t=0;if(this._latencyHint=e,br(e))switch(e){case"interactive":t=.1;break;case"playback":t=.5;break;case"balanced":t=.25}this.lookAhead=t,this.updateInterval=t/2}get rawContext(){return this._context}now(){return this._context.currentTime+this.lookAhead}immediate(){return this._context.currentTime}resume(){return Ir(this._context)?this._context.resume():Promise.resolve()}close(){return Cr(this,void 0,void 0,(function*(){var e;Ir(this._context)&&(yield this._context.close()),this._initialized&&(e=this,jr.forEach((t=>t(e))))}))}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),n=t.getChannelData(0);for(let t=0;tthis._constants[e].disconnect())),this}_timeoutLoop(){const e=this.now();let t=this._timeouts.peek();for(;this._timeouts.length&&t&&t.time<=e;)t.callback(),this._timeouts.shift(),t=this._timeouts.peek()}setTimeout(e,t){this._timeoutIds++;const n=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:n+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach((t=>{t.id===e&&this._timeouts.remove(t)})),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){const n=++this._timeoutIds,s=()=>{const r=this.now();this._timeouts.add({callback:()=>{e(),s()},id:n,time:r+t})};return s(),n}}function Zr(e,t){yr(t)?t.forEach((t=>Zr(e,t))):Object.defineProperty(e,t,{enumerable:!0,writable:!1})}function Yr(e,t){yr(t)?t.forEach((t=>Yr(e,t))):Object.defineProperty(e,t,{writable:!0})}const Qr=()=>{};class Jr extends Fr{constructor(){super(),this.name="ToneAudioBuffer",this.onload=Qr;const e=Rr(Jr.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,e.url&&Tr(e.url)||e.url instanceof Jr?this.set(e.url):br(e.url)&&this.load(e.url).catch(e.onerror)}static getDefaults(){return{onerror:Qr,onload:Qr,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:si().sampleRate}set(e){return e instanceof Jr?e.loaded?this._buffer=e.get():e.onload=()=>{this.set(e),this.onload(this)}:this._buffer=e,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return Cr(this,void 0,void 0,(function*(){const t=Jr.load(e).then((e=>{this.set(e),this.onload(this)}));Jr.downloads.push(t);try{yield t}finally{const e=Jr.downloads.indexOf(t);Jr.downloads.splice(e,1)}return this}))}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){const t=yr(e)&&e[0].length>0,n=t?e.length:1,s=t?e[0].length:e.length,r=si(),i=r.createBuffer(n,s,r.sampleRate),a=t||1!==n?e:[e];for(let e=0;ee/t)),this.fromArray(e)}return this}toArray(e){if(fr(e))return this.getChannelData(e);if(1===this.numberOfChannels)return this.toArray(0);{const e=[];for(let t=0;t0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(e){return(new Jr).fromArray(e)}static fromUrl(e){return Cr(this,void 0,void 0,(function*(){const t=new Jr;return yield t.load(e)}))}static load(e){return Cr(this,void 0,void 0,(function*(){const t=e.match(/\[([^\]\[]+\|.+)\]$/);if(t){const n=t[1].split("|");let s=n[0];for(const e of n)if(Jr.supportsType(e)){s=e;break}e=e.replace(t[0],s)}const n=""===Jr.baseUrl||Jr.baseUrl.endsWith("/")?Jr.baseUrl:Jr.baseUrl+"/",s=yield fetch(n+e);if(!s.ok)throw new Error(`could not load url: ${e}`);const r=yield s.arrayBuffer();return yield si().decodeAudioData(r)}))}static supportsType(e){const t=e.split("."),n=t[t.length-1];return""!==document.createElement("audio").canPlayType("audio/"+n)}static loaded(){return Cr(this,void 0,void 0,(function*(){for(yield Promise.resolve();Jr.downloads.length;)yield Jr.downloads[0]}))}}Jr.baseUrl="",Jr.downloads=[];class ei extends Xr{constructor(){var e,t,n;super({clockSource:"offline",context:Er(arguments[0])?arguments[0]:(e=arguments[0],t=arguments[1]*arguments[2],n=arguments[2],new Qs(e,t,n)),lookAhead:0,updateInterval:Er(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Er(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return Cr(this,void 0,void 0,(function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,t++;const n=Math.floor(this.sampleRate/128);e&&t%n==0&&(yield new Promise((e=>setTimeout(e,1))))}}))}render(e=!0){return Cr(this,void 0,void 0,(function*(){yield this.workletsAreReady(),yield this._renderClock(e);const t=yield this._context.startRendering();return new Jr(t)}))}close(){return Promise.resolve()}}const ti=new class extends Kr{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,n){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,n){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e,t){return Cr(this,void 0,void 0,(function*(){return Promise.resolve()}))}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}};let ni=ti;function si(){return ni===ti&&Ar&&ri(new Xr),ni}function ri(e){ni=Ir(e)?new Xr(e):Er(e)?new ei(e):e}function ii(){return ni.resume()}if(vr&&!vr.TONE_SILENCE_LOGGING){let e="v";"dev"===i&&(e="")}function ai(e){return Math.pow(10,e/20)}function oi(e){return Math.log(e)/Math.LN10*20}function li(e){return Math.pow(2,e/12)}let ui=440;function ci(e){return Math.round(hi(e))}function hi(e){return 69+12*Math.log2(e/ui)}function di(e){return ui*Math.pow(2,(e-69)/12)}class pi extends Fr{constructor(e,t,n){super(),this.defaultUnits="s",this._val=t,this._units=n,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{const n=parseInt(e,10),s="."===t?1.5:1;return 1===n?this._beatsToUnits(this._getTimeSignature())*s:this._beatsToUnits(4/n)*s},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{const t=parseInt(e,10);return this._beatsToUnits(8/(3*Math.floor(t)))},regexp:/^(\d+)t$/i},tr:{method:(e,t,n)=>{let s=0;return e&&"0"!==e&&(s+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s+=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s+=this._beatsToUnits(parseFloat(n)/4)),s},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof pi&&this.fromType(this._val),hr(this._val))return this._noArg();if(br(this._val)&&hr(this._units)){for(const e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(mr(this._val)){let e=0;for(const t in this._val)if(dr(this._val[t])){const n=this._val[t];e+=new this.constructor(this.context,t).valueOf()*n}return e}if(dr(this._units)){const e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}return br(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi()}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return 1e3*this.toSeconds()}}class fi extends pi{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{const t=new fi(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(e,t=1){const n=new this.constructor(this.context,e).valueOf(),s=this.valueOf();return s+(Math.round(s/n)*n-s)*t}toNotation(){const e=this.toSeconds(),t=["1m"];for(let e=1;e<9;e++){const n=Math.pow(2,e);t.push(n+"n."),t.push(n+"n"),t.push(n+"t")}t.push("0");let n=t[0],s=new fi(this.context,t[0]).toSeconds();return t.forEach((t=>{const r=new fi(this.context,t).toSeconds();Math.abs(r-e)3&&(s=parseFloat(parseFloat(r).toFixed(3)));return[n,t,s].join(":")}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.round(t*this._getPPQ())}toSeconds(){return this.valueOf()}toMidi(){return ci(this.toFrequency())}_now(){return this.context.now()}}function mi(e,t){return new fi(si(),e,t)}class gi extends fi{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return ui}static set A4(e){!function(e){ui=e}(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return"midi"===this.defaultUnits?e:gi.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(e,t){const n=yi[e.toLowerCase()]+12*(parseInt(t,10)+1);return"midi"===this.defaultUnits?n:gi.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,n){let s=1;return e&&"0"!==e&&(s*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s*=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s*=this._beatsToUnits(parseFloat(n)/4)),s}}})}transpose(e){return new gi(this.context,this.valueOf()*li(e))}harmonize(e){return e.map((e=>this.transpose(e)))}toMidi(){return ci(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/gi.A4);let n=Math.round(12*t)+57;const s=Math.floor(n/12);s<0&&(n+=-12*s);return bi[n%12]+s.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(60*e/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return di(e)}static ftom(e){return ci(e)}}const yi={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},bi=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function wi(e,t){return new gi(si(),e,t)}class vi extends fi{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}function Ai(e,t){return new vi(si(),e,t)}class xi extends Fr{constructor(){super();const e=Rr(xi.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:si()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return new fi(this.context,e).toSeconds()}toFrequency(e){return new gi(this.context,e).toFrequency()}toTicks(e){return new vi(this.context,e).toTicks()}_getPartialProperties(e){const t=this.get();return Object.keys(t).forEach((n=>{hr(e[n])&&delete t[n]})),t}get(){const e=this.constructor.getDefaults();return Object.keys(e).forEach((t=>{if(Reflect.has(this,t)){const n=this[t];dr(n)&&dr(n.value)&&dr(n.setValueAtTime)?e[t]=n.value:n instanceof xi?e[t]=n._getPartialProperties(e[t]):yr(n)||fr(n)||br(n)||gr(n)?e[t]=n:delete e[t]}})),e}set(e){return Object.keys(e).forEach((t=>{Reflect.has(this,t)&&dr(this[t])&&(this[t]&&dr(this[t].value)&&dr(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof xi?this[t].set(e[t]):this[t]=e[t])})),this}}class Ci extends Gr{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){const t=this.get(e);return null!==t?t.state:this._initial}setStateAtTime(e,t,n){return ir(t,0),this.add(Object.assign({},n,{state:e,time:t})),this}getLastState(e,t){for(let n=this._search(t);n>=0;n--){const t=this._timeline[n];if(t.state===e)return t}}getNextState(e,t){const n=this._search(t);if(-1!==n)for(let t=n;t0,"timeConstant must be a number greater than 0");const r=this.toSeconds(t);return this._assertRange(s),rr(isFinite(s)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:n,time:r,type:"setTargetAtTime",value:s}),this.log(this.units,"setTargetAtTime",e,r,n),this._param.setTargetAtTime(s,r,n),this}setValueCurveAtTime(e,t,n,s=1){n=this.toSeconds(n),t=this.toSeconds(t);const r=this._fromType(e[0])*s;this.setValueAtTime(this._toType(r),t);const i=n/(e.length-1);for(let n=1;n{"cancelScheduledValues"===t.type?e.cancelScheduledValues(t.time):"setTargetAtTime"===t.type?e.setTargetAtTime(t.value,t.time,t.constant):e[t.type](t.value,t.time)})),this}setParam(e){rr(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,n,s,r){return n+(t-n)*Math.exp(-(r-e)/s)}_linearInterpolate(e,t,n,s,r){return t+(r-e)/(n-e)*(s-t)}_exponentialInterpolate(e,t,n,s,r){return t*Math.pow(s/t,(r-e)/(n-e))}}class Si extends xi{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return dr(this.input)?Sr(this.input)||this.input instanceof ki?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dr(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return dr(e)&&(e instanceof Si||_r(e))}_getInternalNodes(){const e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach((t=>{t.channelCount=e.channelCount,t.channelCountMode=e.channelCountMode,t.channelInterpretation=e.channelInterpretation}))}_getChannelProperties(){const e=this._getInternalNodes();rr(e.length>0,"ToneAudioNode does not have any internal nodes");const t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,n=0){return Ei(this,e,t,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return cr("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,n=0){return Ii(this,e,t,n),this}chain(...e){return _i(this,...e),this}fan(...e){return e.forEach((e=>this.connect(e))),this}dispose(){return super.dispose(),dr(this.input)&&(this.input instanceof Si?this.input.dispose():_r(this.input)&&this.input.disconnect()),dr(this.output)&&(this.output instanceof Si?this.output.dispose():_r(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function _i(...e){const t=e.shift();e.reduce(((e,t)=>(e instanceof Si?e.connect(t):_r(e)&&Ei(e,t),t)),t)}function Ei(e,t,n=0,s=0){for(rr(dr(e),"Cannot connect from undefined node"),rr(dr(t),"Cannot connect to undefined node"),(t instanceof Si||_r(t))&&rr(t.numberOfInputs>0,"Cannot connect to node with no inputs"),rr(e.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof Si||t instanceof ki;)dr(t.input)&&(t=t.input);for(;e instanceof Si;)dr(e.output)&&(e=e.output);Sr(t)?e.connect(t,n):e.connect(t,n,s)}function Ii(e,t,n=0,s=0){if(dr(t))for(;t instanceof Si;)t=t.input;for(;!_r(e);)dr(e.output)&&(e=e.output);Sr(t)?e.disconnect(t,n):_r(t)?e.disconnect(t,n,s):e.disconnect()}class Ti extends Si{constructor(){super(Rr(Ti.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=Rr(Ti.getDefaults(),arguments,["gain","units"]);this.gain=new ki({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),Zr(this,"gain")}static getDefaults(){return Object.assign(Si.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class Ni extends Si{constructor(e){super(e),this.onended=Qr,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new Ti({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const t=this.toSeconds(e);return-1!==this._startTime&&t>=this._startTime&&(-1===this._stopTime||t<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign(Si.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Qr})}_startGain(e,t=1){rr(-1===this._startTime,"Source cannot be started more than once");const n=this.toSeconds(this._fadeIn);return this._startTime=e+n,this._startTime=Math.max(this._startTime,this.context.currentTime),n>0?(this._gainNode.gain.setValueAtTime(0,e),"linear"===this._curve?this._gainNode.gain.linearRampToValueAtTime(t,e+n):this._gainNode.gain.exponentialApproachValueAtTime(t,e,n)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){rr(-1!==this._startTime,"'start' must be called before 'stop'"),this.cancelStop();const t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.context.currentTime),t>0?"linear"===this._curve?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout((()=>{const e="exponential"===this._curve?2*t:0;this._stopSource(this.now()+e),this._onended()}),this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==Qr&&(this.onended(this),this.onended=Qr,!this.context.isOffline)){const e=()=>this.dispose();void 0!==window.requestIdleCallback?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),rr(-1!==this._startTime,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.disconnect(),this}}class Oi extends Ni{constructor(){super(Rr(Oi.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=Rr(Oi.getDefaults(),arguments,["offset"]);Ei(this._source,this._gainNode),this.offset=new ki({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(Ni.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ri extends Si{constructor(){super(Rr(Ri.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=Rr(Ri.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Oi({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(Si.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,n=0){return Di(this,e,t,n),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,n){return this._param.exponentialRampTo(e,t,n),this}linearRampTo(e,t,n){return this._param.linearRampTo(e,t,n),this}targetRampTo(e,t,n){return this._param.targetRampTo(e,t,n),this}exponentialApproachValueAtTime(e,t,n){return this._param.exponentialApproachValueAtTime(e,t,n),this}setTargetAtTime(e,t,n){return this._param.setTargetAtTime(e,t,n),this}setValueCurveAtTime(e,t,n,s){return this._param.setValueCurveAtTime(e,t,n,s),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,n){return this._param.rampTo(e,t,n),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}}function Di(e,t,n,s){(t instanceof ki||Sr(t)||t instanceof Ri&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ri&&(t.overridden=!0)),Ei(e,t,n,s)}class Mi extends ki{constructor(){super(Rr(Mi.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Gr(1/0),this._multiplier=1;const e=Rr(Mi.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(ki.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,t,n){t=this.toSeconds(t),this.setRampPoint(t);const s=this._fromType(e),r=this._events.get(t),i=Math.round(Math.max(1/n,1));for(let e=0;e<=i;e++){const i=n*e+t,a=this._exponentialApproach(r.time,r.value,s,n,i);this.linearRampToValueAtTime(this._toType(a),i)}return this}setValueAtTime(e,t){const n=this.toSeconds(t);super.setValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,0),this}linearRampToValueAtTime(e,t){const n=this.toSeconds(t);super.linearRampToValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);const n=this._fromType(e),s=this._events.get(t),r=Math.round(Math.max(10*(t-s.time),1)),i=(t-s.time)/r;for(let e=0;e<=r;e++){const r=i*e+s.time,a=this._exponentialInterpolate(s.time,s.value,t,n,r);this.linearRampToValueAtTime(this._toType(a),r)}return this}_getTicksUntilEvent(e,t){if(null===e)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(hr(e.ticks)){const t=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(t,e.time)}const n=this._fromType(this.getValueAtTime(e.time));let s=this._fromType(this.getValueAtTime(t));const r=this._events.get(t);return r&&r.time===t&&"setValueAtTime"===r.type&&(s=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(n+s)+e.ticks}getTicksAtTime(e){const t=this.toSeconds(e),n=this._events.get(t);return Math.max(this._getTicksUntilEvent(n,t),0)}getDurationOfTicks(e,t){const n=this.toSeconds(t),s=this.getTicksAtTime(t);return this.getTimeOfTick(s+e)-n}getTimeOfTick(e){const t=this._events.get(e,"ticks"),n=this._events.getAfter(e,"ticks");if(t&&t.ticks===e)return t.time;if(t&&n&&"linearRampToValueAtTime"===n.type&&t.value!==n.value){const s=this._fromType(this.getValueAtTime(t.time)),r=(this._fromType(this.getValueAtTime(n.time))-s)/(n.time-t.time),i=Math.sqrt(Math.pow(s,2)-2*r*(t.ticks-e)),a=(-s+i)/r;return(a>0?a:(-s-i)/r)+t.time}return t?0===t.value?1/0:t.time+(e-t.ticks)/t.value:e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){const n=this.toSeconds(t),s=this.toSeconds(e),r=this.getTicksAtTime(n);return this.getTicksAtTime(n+s)-r}_fromType(e){return"bpm"===this.units&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return"bpm"===this.units&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){const t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}}class Fi extends Ri{constructor(){super(Rr(Fi.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=Rr(Fi.getDefaults(),arguments,["value"]);this.input=this._param=new Mi({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(Ri.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}}class Bi extends xi{constructor(){super(Rr(Bi.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new Ci,this._tickOffset=new Gr;const e=Rr(Bi.getDefaults(),arguments,["frequency"]);this.frequency=new Fi({context:this.context,units:e.units,value:e.frequency}),Zr(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},xi.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){const n=this.toSeconds(e);return"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),dr(t)&&this.setTicksAtTime(t,n)),this}stop(e){const t=this.toSeconds(e);if("stopped"===this._state.getValueAtTime(t)){const e=this._state.get(t);e&&e.time>0&&(this._tickOffset.cancel(e.time),this._state.cancel(e.time))}return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this.setTicksAtTime(0,t),this}pause(e){const t=this.toSeconds(e);return"started"===this._state.getValueAtTime(t)&&this._state.setStateAtTime("paused",t),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this}getTicksAtTime(e){const t=this.toSeconds(e),n=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);let r=n,i=0;return this._state.forEachBetween(n.time,t+this.sampleTime,(e=>{let t=r.time;const n=this._tickOffset.get(e.time);n&&n.time>=r.time&&(i=n.ticks,t=n.time),"started"===r.state&&"started"!==e.state&&(i+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(t)),r=e})),this._state.remove(s),i}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){const t=this.now(),n=this.frequency.timeToTicks(e,t);this.setTicksAtTime(n,t)}getSecondsAtTime(e){e=this.toSeconds(e);const t=this._state.getLastState("stopped",e),n={state:"paused",time:e};this._state.add(n);let s=t,r=0;return this._state.forEachBetween(t.time,e+this.sampleTime,(e=>{let t=s.time;const n=this._tickOffset.get(e.time);n&&n.time>=s.time&&(r=n.seconds,t=n.time),"started"===s.state&&"started"!==e.state&&(r+=e.time-t),s=e})),this._state.remove(n),r}setTicksAtTime(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){const n=this._tickOffset.get(t),s=this._state.get(t),r=Math.max(n.time,s.time),i=this.frequency.getTicksAtTime(r)+e-n.ticks;return this.frequency.getTimeOfTick(i)}forEachTickBetween(e,t,n){let s=this._state.get(e);this._state.forEachBetween(e,t,(t=>{s&&"started"===s.state&&"started"!==t.state&&this.forEachTickBetween(Math.max(s.time,e),t.time-this.sampleTime,n),s=t}));let r=null;if(s&&"started"===s.state){const i=Math.max(s.time,e),a=this.frequency.getTicksAtTime(i),o=a-this.frequency.getTicksAtTime(s.time);let l=Math.ceil(o)-o;l=Vr(l,1)?0:l;let u=this.frequency.getTimeOfTick(a+l);for(;u{switch(e.state){case"started":const t=this._tickSource.getTicksAtTime(e.time);this.emit("start",e.time,t);break;case"stopped":0!==e.time&&this.emit("stop",e.time);break;case"paused":this.emit("pause",e.time)}})),this._tickSource.forEachTickBetween(e,t,((e,t)=>{this.callback(e,t)})))}getStateAtTime(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}$r.mixin(zi);class Li extends Si{constructor(){super(Rr(Li.getDefaults(),arguments,["delayTime","maxDelay"])),this.name="Delay";const e=Rr(Li.getDefaults(),arguments,["delayTime","maxDelay"]),t=this.toSeconds(e.maxDelay);this._maxDelay=Math.max(t,this.toSeconds(e.delayTime)),this._delayNode=this.input=this.output=this.context.createDelay(t),this.delayTime=new ki({context:this.context,param:this._delayNode.delayTime,units:"time",value:e.delayTime,minValue:0,maxValue:this.maxDelay}),Zr(this,"delayTime")}static getDefaults(){return Object.assign(Si.getDefaults(),{delayTime:0,maxDelay:1})}get maxDelay(){return this._maxDelay}dispose(){return super.dispose(),this._delayNode.disconnect(),this.delayTime.dispose(),this}}function Pi(e,t,n=2,s=si().sampleRate){return Cr(this,void 0,void 0,(function*(){const r=si(),i=new ei(n,t,s);ri(i),yield e(i);const a=i.render();ri(r);const o=yield a;return new Jr(o)}))}class Vi extends Fr{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=Rr(Vi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach((t=>{this._loadingCount++;const n=e.urls[t];this.add(t,n,this._bufferLoaded.bind(this,e.onload),e.onerror)}))}static getDefaults(){return{baseUrl:"",onerror:Qr,onload:Qr,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return rr(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,0===this._loadingCount&&e&&e()}get loaded(){return Array.from(this._buffers).every((([e,t])=>t.loaded))}add(e,t,n=Qr,s=Qr){return br(t)?this._buffers.set(e.toString(),new Jr(this.baseUrl+t,n,s)):this._buffers.set(e.toString(),new Jr(t,n,s)),this}dispose(){return super.dispose(),this._buffers.forEach((e=>e.dispose())),this._buffers.clear(),this}}class Wi extends gi{constructor(){super(...arguments),this.name="MidiClass",this.defaultUnits="midi"}_frequencyToUnits(e){return ci(super._frequencyToUnits(e))}_ticksToUnits(e){return ci(super._ticksToUnits(e))}_beatsToUnits(e){return ci(super._beatsToUnits(e))}_secondsToUnits(e){return ci(super._secondsToUnits(e))}toMidi(){return this.valueOf()}toFrequency(){return di(this.toMidi())}transpose(e){return new Wi(this.context,this.toMidi()+e)}}function Gi(e,t){return new Wi(si(),e,t)}class Ui extends vi{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}function qi(e,t){return new Ui(si(),e,t)}class ji extends xi{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Gr,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),1===this._events.length&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){const e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){const t=this._events.shift();t&&e-t.time<=this.expiration&&t.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}qr((e=>{e.draw=new ji({context:e})})),Hr((e=>{e.draw.dispose()}));class Hi extends Fr{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){rr(dr(e.time),"Events must have a time property"),rr(dr(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let t=new $i(e.time,e.time+e.duration,e);for(null===this._root?this._root=t:this._root.insert(t),this._length++;null!==t;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(null!==this._root){const t=[];this._root.search(e.time,t);for(const n of t)if(n.event===e){this._removeNode(n),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,(e=>this.remove(e))),this}_setRoot(e){this._root=e,null!==this._root&&(this._root.parent=null)}_replaceNodeInParent(e,t){null!==e.parent?(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent)):this._setRoot(t)}_removeNode(e){if(null===e.left&&null===e.right)this._replaceNodeInParent(e,null);else if(null===e.right)this._replaceNodeInParent(e,e.left);else if(null===e.left)this._replaceNodeInParent(e,e.right);else{let t,n=null;if(e.getBalance()>0)if(null===e.left.right)t=e.left,t.right=e.right,n=t;else{for(t=e.left.right;null!==t.right;)t=t.right;t.parent&&(t.parent.right=t.left,n=t.parent,t.left=e.left,t.right=e.right)}else if(null===e.right.left)t=e.right,t.left=e.left,n=t;else{for(t=e.right.left;null!==t.left;)t=t.left;t.parent&&(t.parent.left=t.right,n=t.parent,t.left=e.left,t.right=e.right)}null!==e.parent?e.isLeftChild()?e.parent.left=t:e.parent.right=t:this._setRoot(t),n&&this._rebalance(n)}e.dispose()}_rotateLeft(e){const t=e.parent,n=e.isLeftChild(),s=e.right;s&&(e.right=s.left,s.left=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rotateRight(e){const t=e.parent,n=e.isLeftChild(),s=e.left;s&&(e.left=s.right,s.right=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rebalance(e){const t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(null!==this._root){const t=[];if(this._root.search(e,t),t.length>0){let e=t[0];for(let n=1;ne.low&&(e=t[n]);return e.event}}return null}forEach(e){if(null!==this._root){const t=[];this._root.traverse((e=>t.push(e))),t.forEach((t=>{t.event&&e(t.event)}))}return this}forEachAtTime(e,t){if(null!==this._root){const n=[];this._root.search(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}forEachFrom(e,t){if(null!==this._root){const n=[];this._root.searchAfter(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}dispose(){return super.dispose(),null!==this._root&&this._root.traverse((e=>e.dispose())),this._root=null,this}}class $i{constructor(e,t,n){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=n,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?null===this.left?this.left=e:this.left.insert(e):null===this.right?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(null!==this.left&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),this.low>e||null!==this.right&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),null!==this.left&&this.left.searchAfter(e,t)),null!==this.right&&this.right.searchAfter(e,t)}traverse(e){e(this),null!==this.left&&this.left.traverse(e),null!==this.right&&this.right.traverse(e)}updateHeight(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return null!==this.left&&null!==this.right?e=this.left.height-this.right.height:null!==this.left?e=this.left.height+1:null!==this.right&&(e=-(this.right.height+1)),e}isLeftChild(){return null!==this.parent&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Ki extends Si{constructor(){super(Rr(Ki.getDefaults(),arguments,["volume"])),this.name="Volume";const e=Rr(Ki.getDefaults(),arguments,["volume"]);this.input=this.output=new Ti({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,Zr(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}class Xi extends Si{constructor(){super(Rr(Xi.getDefaults(),arguments)),this.name="Destination",this.input=new Ki({context:this.context}),this.output=new Ti({context:this.context}),this.volume=this.input.volume;const e=Rr(Xi.getDefaults(),arguments);_i(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),_i(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}qr((e=>{e.destination=new Xi({context:e})})),Hr((e=>{e.destination.dispose()}));class Zi extends Fr{constructor(e){super(),this.name="TimelineValue",this._timeline=new Gr({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){const t=this._timeline.get(e);return t?t.value:this._initialValue}}class Yi{constructor(e,t){this.id=Yi._eventId++;const n=Object.assign(Yi.getDefaults(),t);this.transport=e,this.callback=n.callback,this._once=n.once,this.time=n.time}static getDefaults(){return{callback:Qr,once:!1,time:0}}invoke(e){this.callback&&(this.callback(e),this._once&&this.transport.clear(this.id))}dispose(){return this.callback=void 0,this}}Yi._eventId=0;class Qi extends Yi{constructor(e,t){super(e,t),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const n=Object.assign(Qi.getDefaults(),t);this.duration=new Ui(e.context,n.duration).valueOf(),this._interval=new Ui(e.context,n.interval).valueOf(),this._nextTick=n.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Yi.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvents(e){const t=this.transport.getTicksAtTime(e);t>=this.time&&t>=this._nextTick&&this._nextTick+this._intervalthis.time&&(this._nextTick=this.time+Math.ceil((t-this.time)/this._interval)*this._interval),this._currentId=this.transport.scheduleOnce(this.invoke.bind(this),new Ui(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Ui(this.context,this._nextTick).toSeconds())}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this}}class Ji extends xi{constructor(){super(Rr(Ji.getDefaults(),arguments)),this.name="Transport",this._loop=new Zi(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Gr,this._repeatedEvents=new Hi,this._syncedSignals=[],this._swingAmount=0;const e=Rr(Ji.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new zi({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),Zr(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(xi.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&t%this._ppq!=0&&t%(2*this._swingTicks)!=0){const n=t%(2*this._swingTicks)/(2*this._swingTicks),s=Math.sin(n*Math.PI)*this._swingAmount;e+=new Ui(this.context,2*this._swingTicks/3).toSeconds()*s}this._timeline.forEachAtTime(t,(t=>t.invoke(e)))}schedule(e,t){const n=new Yi(this,{callback:e,time:new vi(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(e,t,n,s=1/0){const r=new Qi(this,{callback:e,duration:new fi(this.context,s).toTicks(),interval:new fi(this.context,t).toTicks(),time:new vi(this.context,n).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const n=new Yi(this,{callback:e,once:!0,time:new vi(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){const t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){const t=this.toTicks(e);return this._timeline.forEachFrom(t,(e=>this.clear(e.id))),this._repeatedEvents.forEachFrom(t,(e=>this.clear(e.id))),this}_bindClockEvents(){this._clock.on("start",((e,t)=>{t=new Ui(this.context,t).toSeconds(),this.emit("start",e,t)})),this._clock.on("stop",(e=>{this.emit("stop",e)})),this._clock.on("pause",(e=>{this.emit("pause",e)}))}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){let n;return dr(t)&&(n=this.toTicks(t)),this._clock.start(e,n),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),"started"!==this._clock.getStateAtTime(e)?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){yr(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new fi(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new fi(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new Ui(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){const e=this.now(),t=this._clock.getTicksAtTime(e);return new Ui(this.context,t).toBarsBeatsSixteenths()}set position(e){const t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){const t=this.now(),n=this._clock.frequency.timeToTicks(e,t);this.ticks=n}get progress(){if(this.loop){const e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){const t=this.now();if("started"===this.state){const n=this._clock.getTicksAtTime(t),s=t+this._clock.frequency.getDurationOfTicks(Math.ceil(n)-n,t);this.emit("stop",s),this._clock.setTicksAtTime(e,s),this.emit("start",s,this._clock.getSecondsAtTime(s))}else this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return Math.round(this._clock.getTicksAtTime(e))}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),"started"!==this.state)return 0;{const t=this.now(),n=e-this.getTicksAtTime(t)%e;return this._clock.nextTickTime(n,t)}}syncSignal(e,t){if(!t){const n=this.now();if(0!==e.getValueAtTime(n)){const s=1/(60/this.bpm.getValueAtTime(n)/this.PPQ);t=e.getValueAtTime(n)/s}else t=0}const n=new Ti(t);return this.bpm.connect(n),n.connect(e._param),this._syncedSignals.push({initial:e.value,ratio:n,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){const n=this._syncedSignals[t];n.signal===e&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Yr(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}$r.mixin(Ji),qr((e=>{e.transport=new Ji({context:e})})),Hr((e=>{e.transport.dispose()}));class ea extends Si{constructor(e){super(e),this.input=void 0,this._state=new Ci("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=Qr,this._syncedStop=Qr,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Ki({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,onstop:Qr,volume:0})}get state(){return this._synced?"started"===this.context.transport.state?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,n){let s=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(s=this._clampToCurrentTime(s),this._synced||"started"!==this._state.getValueAtTime(s))if(this.log("start",s),this._state.setStateAtTime("started",s),this._synced){const e=this._state.get(s);e&&(e.offset=this.toSeconds(Dr(t,0)),e.duration=n?this.toSeconds(n):void 0);const r=this.context.transport.schedule((e=>{this._start(e,t,n)}),s);this._scheduled.push(r),"started"===this.context.transport.state&&this.context.transport.getSecondsAtTime(this.immediate())>s&&this._syncedStart(this.now(),this.context.transport.seconds)}else ar(this.context),this._start(s,t,n);else rr(zr(s,this._state.get(s).time),"Start time must be strictly greater than previous start time"),this._state.cancel(s),this._state.setStateAtTime("started",s),this.log("restart",s),this.restart(s,t,n);return this}stop(e){let t=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),"started"===this._state.getValueAtTime(t)||dr(this._state.getNextState("started",t))){if(this.log("stop",t),this._synced){const e=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(e)}else this._stop(t);this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(e,t,n){return e=this.toSeconds(e),"started"===this._state.getValueAtTime(e)&&(this._state.cancel(e),this._restart(e,t,n)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(t>0){const n=this._state.get(t);if(n&&"started"===n.state&&n.time!==t){const s=t-this.toSeconds(n.time);let r;n.duration&&(r=this.toSeconds(n.duration)-s),this._start(e,this.toSeconds(n.offset)+s,r)}}},this._syncedStop=e=>{const t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));"started"===this._state.getValueAtTime(t)&&this._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach((e=>this.context.transport.clear(e))),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Qr,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class ta extends Ni{constructor(){super(Rr(ta.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=Rr(ta.getDefaults(),arguments,["url","onload"]);Ei(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new ki({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new Jr(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(Ni.getDefaults(),{url:new Jr,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,n,s=1){rr(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(e);this._startGain(r,s),t=this.loop?Dr(t,this.loopStart):Dr(t,0);let i=Math.max(this.toSeconds(t),0);if(this.loop){const e=this.toSeconds(this.loopEnd)||this.buffer.duration,t=this.toSeconds(this.loopStart),n=e-t;Lr(i,e)&&(i=(i-t)%n+t),Vr(i,this.buffer.duration)&&(i=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Pr(i,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,i)),dr(n)){let e=this.toSeconds(n);e=Math.max(e,0),this.stop(r+e)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class na extends ea{constructor(){super(Rr(na.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=Rr(na.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(rr(e in ia,"Noise: invalid type: "+e),this._type!==e&&(this._type=e,"started"===this.state)){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._source&&(this._source.playbackRate.value=e)}_start(e){const t=ia[this._type];this._source=new ta({url:t,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(e),Math.random()*(t.duration-.001))}_stop(e){this._source&&(this._source.stop(this.toSeconds(e)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(e){this._stop(e),this._start(e)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const sa=220500,ra={brown:null,pink:null,white:null},ia={get brown(){if(!ra.brown){const e=[];for(let t=0;t<2;t++){const n=new Float32Array(sa);e[t]=n;let s=0;for(let e=0;et.label===e||t.deviceId===e)),!this._device&&t.length>0&&(this._device=t[0]),rr(dr(this._device),`No matching device ${e}`));const n={audio:{echoCancellation:!1,sampleRate:this.context.sampleRate,noiseSuppression:!1,mozNoiseSuppression:!1}};this._device&&(n.audio.deviceId=this._device.deviceId);const s=yield navigator.mediaDevices.getUserMedia(n);if(!this._stream){this._stream=s;const e=this.context.createMediaStreamSource(s);Ei(e,this.output),this._mediaStream=e}return this}))}close(){return this._stream&&this._mediaStream&&(this._stream.getAudioTracks().forEach((e=>{e.stop()})),this._stream=void 0,this._mediaStream.disconnect(),this._mediaStream=void 0),this._device=void 0,this}static enumerateDevices(){return Cr(this,void 0,void 0,(function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter((e=>"audioinput"===e.kind))}))}get state(){return this._stream&&this._stream.active?"started":"stopped"}get deviceId(){return this._device?this._device.deviceId:void 0}get groupId(){return this._device?this._device.groupId:void 0}get label(){return this._device?this._device.label:void 0}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this.close(),this._volume.dispose(),this.volume.dispose(),this}static get supported(){return dr(navigator.mediaDevices)&&dr(navigator.mediaDevices.getUserMedia)}}function oa(e,t){return Cr(this,void 0,void 0,(function*(){const n=t/e.context.sampleRate,s=new ei(1,n,e.context.sampleRate);new e.constructor(Object.assign(e.get(),{frequency:2/n,detune:0,context:s})).toDestination().start(0);return(yield s.render()).getChannelData(0)}))}class la extends Ni{constructor(){super(Rr(la.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];const e=Rr(la.getDefaults(),arguments,["frequency","type"]);Ei(this._oscillator,this._gainNode),this.type=e.type,this.frequency=new ki({context:this.context,param:this._oscillator.frequency,units:"frequency",value:e.frequency}),this.detune=new ki({context:this.context,param:this._oscillator.detune,units:"cents",value:e.detune}),Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(Ni.getDefaults(),{detune:0,frequency:440,type:"sine"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._oscillator.start(t),this}_stopSource(e){this._oscillator.stop(e)}setPeriodicWave(e){return this._oscillator.setPeriodicWave(e),this}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}}class ua extends ea{constructor(){super(Rr(ua.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const e=Rr(ua.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),Zr(this,"frequency"),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),Zr(this,"detune"),this._partials=e.partials,this._partialCount=e.partialCount,this._type=e.type,e.partialCount&&"custom"!==e.type&&(this._type=this.baseType+e.partialCount.toString()),this.phase=e.phase}static getDefaults(){return Object.assign(ea.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(e){const t=this.toSeconds(e),n=new la({context:this.context,onended:()=>this.onstop(this)});this._oscillator=n,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(t)}_stop(e){const t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){const t=this.toSeconds(e);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if("custom"===this._type){return ua._periodicWaveCache.find((e=>{return e.phase===this._phase&&(t=e.partials,n=this._partials,t.length===n.length&&t.every(((e,t)=>n[t]===e)));var t,n}))}{const e=ua._periodicWaveCache.find((e=>e.type===this._type&&e.phase===this._phase));return this._partialCount=e?e.partialCount:this._partialCount,e}}get type(){return this._type}set type(e){this._type=e;const t=-1!==["sine","square","sawtooth","triangle"].indexOf(e);if(0===this._phase&&t)this._wave=void 0,this._partialCount=0,null!==this._oscillator&&(this._oscillator.type=e);else{const t=this._getCachedPeriodicWave();if(dr(t)){const{partials:e,wave:n}=t;this._wave=n,this._partials=e,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}else{const[t,n]=this._getRealImaginary(e,this._phase),s=this.context.createPeriodicWave(t,n);this._wave=s,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave),ua._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:t,type:this._type,wave:this._wave}),ua._periodicWaveCache.length>100&&ua._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(e){this.partialCount&&"custom"!==this._type&&"custom"!==e?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){ir(e,0);let t=this._type;const n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(n&&(t=n[1]),"custom"!==this._type)this.type=0===e?t:t+e.toString();else{const t=new Float32Array(e);this._partials.forEach(((e,n)=>t[n]=e)),this._partials=Array.from(t),this.type=this._type}}_getRealImaginary(e,t){let n=2048;const s=new Float32Array(n),r=new Float32Array(n);let i=1;if("custom"===e){if(i=this._partials.length+1,this._partialCount=this._partials.length,n=i,0===this._partials.length)return[s,r]}else{const t=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);t?(i=parseInt(t[2],10)+1,this._partialCount=parseInt(t[2],10),e=t[1],i=Math.max(i,2),n=i):this._partialCount=0,this._partials=[]}for(let a=1;a>1&1?-1:1):0,this._partials[a-1]=o;break;case"custom":o=this._partials[a-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}0!==o?(s[a]=-o*Math.sin(t*a),r[a]=o*Math.cos(t*a)):(s[a]=0,r[a]=0)}return[s,r]}_inverseFFT(e,t,n){let s=0;const r=e.length;for(let i=0;it.includes(e))),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class da extends ca{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new ha({context:this.context,mapping:e=>(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class pa extends Ri{constructor(){super(Object.assign(Rr(pa.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=Rr(pa.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new Ti({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class fa extends ea{constructor(){super(Rr(fa.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new da({context:this.context}),this._modulationNode=new Ti({context:this.context});const e=Rr(fa.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ua({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new ua({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Zr(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ua.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class ma extends ea{constructor(){super(Rr(ma.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new Ti({context:this.context,gain:0});const e=Rr(ma.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ua({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new ua({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new pa({context:this.context,units:"positive",value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Zr(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ua.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class ga extends ea{constructor(){super(Rr(ga.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new Ti({context:this.context,gain:0}),this._thresh=new ha({context:this.context,mapping:e=>e<=0?-1:1});const e=Rr(ga.getDefaults(),arguments,["frequency","width"]);this.width=new Ri({context:this.context,units:"audioRange",value:e.width}),this._triangle=new ua({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Zr(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ea.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class ya extends ea{constructor(){super(Rr(ya.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=Rr(ya.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(ua.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach((t=>t.start(e)))}_stop(e){e=this.toSeconds(e),this._forEach((t=>t.stop(e)))}_restart(e){this._forEach((t=>t.restart(e)))}_forEach(e){for(let t=0;tt.type=e))}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){const t=-e/2,n=e/(this._oscillators.length-1);this._forEach(((e,s)=>e.detune.value=t+n*s))}}get count(){return this._oscillators.length}set count(e){if(ir(e,1),this._oscillators.length!==e){this._forEach((e=>e.dispose())),this._oscillators=[];for(let t=0;tthis.onstop(this):Qr});"custom"===this.type&&(n.partials=this._partials),this.frequency.connect(n.frequency),this.detune.connect(n.detune),n.detune.overridden=!1,n.connect(this.output),this._oscillators[t]=n}this.spread=this._spread,"started"===this.state&&this._forEach((e=>e.start()))}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach(((e,t)=>e.phase=this._phase+t/this.count*360))}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach((t=>t.baseType=e)),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach((t=>t.partials=e)))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach((t=>t.partialCount=e)),this._type=this._oscillators[0].type}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach((e=>e.dispose())),this}}class ba extends ea{constructor(){super(Rr(ba.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new pa({context:this.context,value:2});const e=Rr(ba.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new ga({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new ua({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Zr(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ea.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const wa={am:fa,fat:ya,fm:ma,oscillator:ua,pulse:ga,pwm:ba};class va extends ea{constructor(){super(Rr(va.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=Rr(va.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),Zr(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(ua.getDefaults(),ma.getDefaults(),fa.getDefaults(),ya.getDefaults(),ga.getDefaults(),ba.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some((e=>this._sourceType===e))&&(e=this._sourceType),e+this._oscillator.type}set type(e){"fm"===e.substr(0,2)?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"am"===e.substr(0,2)?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"fat"===e.substr(0,3)?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):"pwm"===e?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):"pulse"===e?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;const t=wa[e],n=this.now();if(this._oscillator){const e=this._oscillator;e.stop(n),this.context.setTimeout((()=>e.dispose()),this.blockTime)}this._oscillator=new t({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),"started"===this.state&&this._oscillator.start(n)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t="sine";"pwm"!==this._oscillator.type&&"pulse"!==this._oscillator.type&&(t=this._oscillator.type),"fm"===e?this.type="fm"+t:"am"===e?this.type="am"+t:"fat"===e?this.type="fat"+t:"oscillator"===e?this.type=t:"pulse"===e?this.type="pulse":"pwm"===e&&(this.type="pwm")}_getOscType(e,t){return e instanceof wa[t]}get baseType(){return this._oscillator.baseType}set baseType(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||"pulse"===e||"pwm"===e||(this._oscillator.baseType=e)}get width(){return this._getOscType(this._oscillator,"pulse")?this._oscillator.width:void 0}get count(){return this._getOscType(this._oscillator,"fat")?this._oscillator.count:void 0}set count(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.count=e)}get spread(){return this._getOscType(this._oscillator,"fat")?this._oscillator.spread:void 0}set spread(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.spread=e)}get modulationType(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.modulationType:void 0}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&br(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){return this._getOscType(this._oscillator,"fm")?this._oscillator.modulationIndex:void 0}get harmonicity(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.harmonicity:void 0}get modulationFrequency(){return this._getOscType(this._oscillator,"pwm")?this._oscillator.modulationFrequency:void 0}asArray(e=1024){return Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class Aa extends Ri{constructor(){super(Object.assign(Rr(Aa.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new Ti({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,_i(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class xa extends ca{constructor(){super(Object.assign(Rr(xa.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=Rr(xa.getDefaults(),arguments,["min","max"]);this._mult=this.input=new pa({context:this.context,value:e.max-e.min}),this._add=this.output=new Aa({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ca.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(e){this._min=e,this._setRange()}get max(){return this._max}set max(e){this._max=e,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}class Ca extends ca{constructor(){super(Object.assign(Rr(Ca.getDefaults(),arguments))),this.name="Zero",this._gain=new Ti({context:this.context}),this.output=this._gain,this.input=void 0,Ei(this.context.getConstant(0),this._gain)}dispose(){return super.dispose(),Ii(this.context.getConstant(0),this._gain),this}}class ka extends Si{constructor(){super(Rr(ka.getDefaults(),arguments,["frequency","min","max"])),this.name="LFO",this._stoppedValue=0,this._units="number",this.convert=!0,this._fromType=ki.prototype._fromType,this._toType=ki.prototype._toType,this._is=ki.prototype._is,this._clampValue=ki.prototype._clampValue;const e=Rr(ka.getDefaults(),arguments,["frequency","min","max"]);this._oscillator=new ua(e),this.frequency=this._oscillator.frequency,this._amplitudeGain=new Ti({context:this.context,gain:e.amplitude,units:"normalRange"}),this.amplitude=this._amplitudeGain.gain,this._stoppedSignal=new Ri({context:this.context,units:"audioRange",value:0}),this._zeros=new Ca({context:this.context}),this._a2g=new da({context:this.context}),this._scaler=this.output=new xa({context:this.context,max:e.max,min:e.min}),this.units=e.units,this.min=e.min,this.max=e.max,this._oscillator.chain(this._amplitudeGain,this._a2g,this._scaler),this._zeros.connect(this._a2g),this._stoppedSignal.connect(this._a2g),Zr(this,["amplitude","frequency"]),this.phase=e.phase}static getDefaults(){return Object.assign(ua.getDefaults(),{amplitude:1,frequency:"4n",max:1,min:0,type:"sine",units:"number"})}start(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(0,e),this._oscillator.start(e),this}stop(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(this._stoppedValue,e),this._oscillator.stop(e),this}sync(){return this._oscillator.sync(),this._oscillator.syncFrequency(),this}unsync(){return this._oscillator.unsync(),this._oscillator.unsyncFrequency(),this}_setStoppedValue(){this._stoppedValue=this._oscillator.getInitialValue(),this._stoppedSignal.value=this._stoppedValue}get min(){return this._toType(this._scaler.min)}set min(e){e=this._fromType(e),this._scaler.min=e}get max(){return this._toType(this._scaler.max)}set max(e){e=this._fromType(e),this._scaler.max=e}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e,this._setStoppedValue()}get partials(){return this._oscillator.partials}set partials(e){this._oscillator.partials=e,this._setStoppedValue()}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e,this._setStoppedValue()}get units(){return this._units}set units(e){const t=this.min,n=this.max;this._units=e,this.min=t,this.max=n}get state(){return this._oscillator.state}connect(e,t,n){return(e instanceof ki||e instanceof Ri)&&(this.convert=e.convert,this.units=e.units),Di(this,e,t,n),this}dispose(){return super.dispose(),this._oscillator.dispose(),this._stoppedSignal.dispose(),this._zeros.dispose(),this._scaler.dispose(),this._a2g.dispose(),this._amplitudeGain.dispose(),this.amplitude.dispose(),this}}function Sa(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ir(s,e,t),n.set(this,s)}})}}function _a(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ir(this.toSeconds(s),e,t),n.set(this,s)}})}}class Ea extends ea{constructor(){super(Rr(Ea.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=Rr(Ea.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1,reverse:!1})}load(e){return Cr(this,void 0,void 0,(function*(){return yield this._buffer.load(e),this._onload(),this}))}_onload(e=Qr){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),0!==this._activeSources.size||this._synced||"started"!==this._state.getValueAtTime(this.now())||(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,t,n){return super.start(e,t,n),this}_start(e,t,n){t=this._loop?Dr(t,this._loopStart):Dr(t,0);const s=this.toSeconds(t),r=n;n=Dr(n,Math.max(this._buffer.duration-s,0));let i=this.toSeconds(n);i/=this._playbackRate,e=this.toSeconds(e);const a=new ta({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);this._loop||this._synced||(this._state.cancel(e+i),this._state.setStateAtTime("stopped",e+i,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&hr(r)?a.start(e,s):a.start(e,s,i-this.toSeconds(this.fadeOut))}_stop(e){const t=this.toSeconds(e);this._activeSources.forEach((e=>e.stop(t)))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}seek(e,t){const n=this.toSeconds(t);if("started"===this._state.getValueAtTime(n)){const t=this.toSeconds(e);this._stop(n),this._start(n,t)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopStart=e}))}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopEnd=e}))}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach((t=>{t.loop=e})),e)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const t=this.now(),n=this._state.getNextState("stopped",t);n&&n.implicitEnd&&(this._state.cancel(n.time),this._activeSources.forEach((e=>e.cancelStop()))),this._activeSources.forEach((n=>{n.playbackRate.setValueAtTime(e,t)}))}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach((e=>e.dispose())),this._activeSources.clear(),this._buffer.dispose(),this}}xr([_a(0)],Ea.prototype,"fadeIn",void 0),xr([_a(0)],Ea.prototype,"fadeOut",void 0);class Ia extends Si{constructor(){super(Rr(Ia.getDefaults(),arguments,["urls","onload"],"urls")),this.name="Players",this.input=void 0,this._players=new Map;const e=Rr(Ia.getDefaults(),arguments,["urls","onload"],"urls");this._volume=this.output=new Ki({context:this.context,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this._buffers=new Vi({urls:e.urls,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.mute=e.mute,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{baseUrl:"",fadeIn:0,fadeOut:0,mute:!1,onload:Qr,onerror:Qr,urls:{},volume:0})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._players.forEach((t=>{t.fadeIn=e}))}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._players.forEach((t=>{t.fadeOut=e}))}get state(){return Array.from(this._players).some((([e,t])=>"started"===t.state))?"started":"stopped"}has(e){return this._buffers.has(e)}player(e){if(rr(this.has(e),`No Player with the name ${e} exists on this object`),!this._players.has(e)){const t=new Ea({context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,url:this._buffers.get(e)}).connect(this.output);this._players.set(e,t)}return this._players.get(e)}get loaded(){return this._buffers.loaded}add(e,t,n){return rr(!this._buffers.has(e),"A buffer with that name already exists on this object"),this._buffers.add(e,t,n),this}stopAll(e){return this._players.forEach((t=>t.stop(e))),this}dispose(){return super.dispose(),this._volume.dispose(),this.volume.dispose(),this._players.forEach((e=>e.dispose())),this._buffers.dispose(),this}}class Ta extends ea{constructor(){super(Rr(Ta.getDefaults(),arguments,["url","onload"])),this.name="GrainPlayer",this._loopStart=0,this._loopEnd=0,this._activeSources=[];const e=Rr(Ta.getDefaults(),arguments,["url","onload"]);this.buffer=new Jr({onload:e.onload,onerror:e.onerror,reverse:e.reverse,url:e.url}),this._clock=new zi({context:this.context,callback:this._tick.bind(this),frequency:1/e.grainSize}),this._playbackRate=e.playbackRate,this._grainSize=e.grainSize,this._overlap=e.overlap,this.detune=e.detune,this.overlap=e.overlap,this.loop=e.loop,this.playbackRate=e.playbackRate,this.grainSize=e.grainSize,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.reverse=e.reverse,this._clock.on("stop",this._onstop.bind(this))}static getDefaults(){return Object.assign(ea.getDefaults(),{onload:Qr,onerror:Qr,overlap:.1,grainSize:.2,playbackRate:1,detune:0,loop:!1,loopStart:0,loopEnd:0,reverse:!1})}_start(e,t,n){t=Dr(t,0),t=this.toSeconds(t),e=this.toSeconds(e);const s=1/this._clock.frequency.getValueAtTime(e);this._clock.start(e,t/s),n&&this.stop(e+this.toSeconds(n))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}_stop(e){this._clock.stop(e)}_onstop(e){this._activeSources.forEach((t=>{t.fadeOut=0,t.stop(e)})),this.onstop(this)}_tick(e){const t=this._clock.getTicksAtTime(e),n=t*this._grainSize;if(this.log("offset",n),!this.loop&&n>this.buffer.duration)return void this.stop(e);const s=n{const e=this._activeSources.indexOf(r);-1!==e&&this._activeSources.splice(e,1)}}get playbackRate(){return this._playbackRate}set playbackRate(e){ir(e,.001),this._playbackRate=e,this.grainSize=this._grainSize}get loopStart(){return this._loopStart}set loopStart(e){this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._loopStart=this.toSeconds(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._loopEnd=this.toSeconds(e)}get reverse(){return this.buffer.reverse}set reverse(e){this.buffer.reverse=e}get grainSize(){return this._grainSize}set grainSize(e){this._grainSize=this.toSeconds(e),this._clock.frequency.setValueAtTime(this._playbackRate/this._grainSize,this.now())}get overlap(){return this._overlap}set overlap(e){const t=this.toSeconds(e);ir(t,0),this._overlap=t}get loaded(){return this.buffer.loaded}dispose(){return super.dispose(),this.buffer.dispose(),this._clock.dispose(),this._activeSources.forEach((e=>e.dispose())),this}}class Na extends ca{constructor(){super(...arguments),this.name="Abs",this._abs=new ha({context:this.context,mapping:e=>Math.abs(e)<.001?0:Math.abs(e)}),this.input=this._abs,this.output=this._abs}dispose(){return super.dispose(),this._abs.dispose(),this}}class Oa extends ca{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new ha({context:this.context,mapping:e=>2*Math.abs(e)-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Ra extends ca{constructor(){super(...arguments),this.name="Negate",this._multiply=new pa({context:this.context,value:-1}),this.input=this._multiply,this.output=this._multiply}dispose(){return super.dispose(),this._multiply.dispose(),this}}class Da extends Ri{constructor(){super(Object.assign(Rr(Da.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Subtract",this._sum=new Ti({context:this.context}),this.input=this._sum,this.output=this._sum,this._neg=new Ra({context:this.context}),this.subtrahend=this._param,_i(this._constantSource,this._neg,this._sum)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._neg.dispose(),this._sum.dispose(),this}}class Ma extends ca{constructor(){super(Object.assign(Rr(Ma.getDefaults(),arguments))),this.name="GreaterThanZero",this._thresh=this.output=new ha({context:this.context,length:127,mapping:e=>e<=0?0:1}),this._scale=this.input=new pa({context:this.context,value:1e4}),this._scale.connect(this._thresh)}dispose(){return super.dispose(),this._scale.dispose(),this._thresh.dispose(),this}}class Fa extends Ri{constructor(){super(Object.assign(Rr(Fa.getDefaults(),arguments,["value"]))),this.name="GreaterThan",this.override=!1;const e=Rr(Fa.getDefaults(),arguments,["value"]);this._subtract=this.input=new Da({context:this.context,value:e.value}),this._gtz=this.output=new Ma({context:this.context}),this.comparator=this._param=this._subtract.subtrahend,Zr(this,"comparator"),this._subtract.connect(this._gtz)}static getDefaults(){return Object.assign(Ri.getDefaults(),{value:0})}dispose(){return super.dispose(),this._gtz.dispose(),this._subtract.dispose(),this.comparator.dispose(),this}}class Ba extends ca{constructor(){super(Object.assign(Rr(Ba.getDefaults(),arguments,["value"]))),this.name="Pow";const e=Rr(Ba.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new ha({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(ca.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class za extends xa{constructor(){super(Object.assign(Rr(za.getDefaults(),arguments,["min","max","exponent"]))),this.name="ScaleExp";const e=Rr(za.getDefaults(),arguments,["min","max","exponent"]);this.input=this._exp=new Ba({context:this.context,value:e.exponent}),this._exp.connect(this._mult)}static getDefaults(){return Object.assign(xa.getDefaults(),{exponent:1})}get exponent(){return this._exp.value}set exponent(e){this._exp.value=e}dispose(){return super.dispose(),this._exp.dispose(),this}}class La extends Ri{constructor(){super(Rr(Ri.getDefaults(),arguments,["value","units"])),this.name="SyncedSignal",this.override=!1;const e=Rr(Ri.getDefaults(),arguments,["value","units"]);this._lastVal=e.value,this._synced=this.context.transport.scheduleRepeat(this._onTick.bind(this),"1i"),this._syncedCallback=this._anchorValue.bind(this),this.context.transport.on("start",this._syncedCallback),this.context.transport.on("pause",this._syncedCallback),this.context.transport.on("stop",this._syncedCallback),this._constantSource.disconnect(),this._constantSource.stop(0),this._constantSource=this.output=new Oi({context:this.context,offset:e.value,units:e.units}).start(0),this.setValueAtTime(e.value,0)}_onTick(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal!==t&&(this._lastVal=t,this._constantSource.offset.setValueAtTime(t,e))}_anchorValue(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal=t,this._constantSource.offset.cancelAndHoldAtTime(e),this._constantSource.offset.setValueAtTime(t,e)}getValueAtTime(e){const t=new vi(this.context,e).toSeconds();return super.getValueAtTime(t)}setValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.setValueAtTime(e,n),this}linearRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.linearRampToValueAtTime(e,n),this}exponentialRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.exponentialRampToValueAtTime(e,n),this}setTargetAtTime(e,t,n){const s=new vi(this.context,t).toSeconds();return super.setTargetAtTime(e,s,n),this}cancelScheduledValues(e){const t=new vi(this.context,e).toSeconds();return super.cancelScheduledValues(t),this}setValueCurveAtTime(e,t,n,s){const r=new vi(this.context,t).toSeconds();return n=this.toSeconds(n),super.setValueCurveAtTime(e,r,n,s),this}cancelAndHoldAtTime(e){const t=new vi(this.context,e).toSeconds();return super.cancelAndHoldAtTime(t),this}setRampPoint(e){const t=new vi(this.context,e).toSeconds();return super.setRampPoint(t),this}exponentialRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.exponentialRampTo(e,t,s),this}linearRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.linearRampTo(e,t,s),this}targetRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.targetRampTo(e,t,s),this}dispose(){return super.dispose(),this.context.transport.clear(this._synced),this.context.transport.off("start",this._syncedCallback),this.context.transport.off("pause",this._syncedCallback),this.context.transport.off("stop",this._syncedCallback),this._constantSource.dispose(),this}}class Pa extends Si{constructor(){super(Rr(Pa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ri({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=Rr(Pa.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign(Si.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(br(e))return e;{let n;for(n in Va)if(Va[n][t]===e)return n;return e}}_setCurve(e,t,n){if(br(n)&&Reflect.has(Va,n)){const s=Va[n];mr(s)?"_decayCurve"!==e&&(this[e]=s[t]):this[e]=s}else{if(!yr(n)||"_decayCurve"===e)throw new Error("Envelope: invalid curve: "+n);this[e]=n}}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._decayCurve}set decayCurve(e){rr(["linear","exponential"].some((t=>t===e)),`Invalid envelope curve: ${e}`),this._decayCurve=e}triggerAttack(e,t=1){this.log("triggerAttack",e,t),e=this.toSeconds(e);let n=this.toSeconds(this.attack);const s=this.toSeconds(this.decay),r=this.getValueAtTime(e);if(r>0){n=(1-r)/(1/n)}if(n0){const n=this.toSeconds(this.release);n{const e=128;let t,n;const s=[];for(t=0;t{const s=e[t],r=this.context.transport.schedule((s=>{e[t]=s,n.apply(this,e)}),s);this._scheduledEvents.push(r)}}unsync(){return this._scheduledEvents.forEach((e=>this.context.transport.clear(e))),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n),i=this.toSeconds(t);return this.triggerAttack(e,r,s),this.triggerRelease(r+i),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ga extends Wa{constructor(){super(Rr(Ga.getDefaults(),arguments));const e=Rr(Ga.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Wa.getDefaults(),{detune:0,onsilence:Qr,portamento:0})}triggerAttack(e,t,n=1){this.log("triggerAttack",e,t,n);const s=this.toSeconds(t);return this._triggerEnvelopeAttack(s,n),this.setNote(e,s),this}triggerRelease(e){this.log("triggerRelease",e);const t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){const n=this.toSeconds(t),s=e instanceof gi?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(n)>.05){const e=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(s,e,n)}else this.frequency.setValueAtTime(s,n);return this}}xr([_a(0)],Ga.prototype,"portamento",void 0);class Ua extends Pa{constructor(){super(Rr(Ua.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new Ti({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class qa extends Ga{constructor(){super(Rr(qa.getDefaults(),arguments)),this.name="Synth";const e=Rr(qa.getDefaults(),arguments);this.oscillator=new va(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Ua(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),Zr(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ja extends Ga{constructor(){super(Rr(ja.getDefaults(),arguments)),this.name="ModulationSynth";const e=Rr(ja.getDefaults(),arguments);this._carrier=new qa({context:this.context,oscillator:e.oscillator,envelope:e.envelope,onsilence:()=>this.onsilence(this),volume:-10}),this._modulator=new qa({context:this.context,oscillator:e.modulation,envelope:e.modulationEnvelope,volume:-10}),this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope,this.modulation=this._modulator.oscillator,this.modulationEnvelope=this._modulator.envelope,this.frequency=new Ri({context:this.context,units:"frequency"}),this.detune=new Ri({context:this.context,value:e.detune,units:"cents"}),this.harmonicity=new pa({context:this.context,value:e.harmonicity,minValue:0}),this._modulationNode=new Ti({context:this.context,gain:0}),Zr(this,["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{harmonicity:3,oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"sine"}),envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.01,decay:.01,sustain:1,release:.5}),modulation:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"square"}),modulationEnvelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.5,decay:0,sustain:1,release:.5})})}_triggerEnvelopeAttack(e,t){this._carrier._triggerEnvelopeAttack(e,t),this._modulator._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this._carrier._triggerEnvelopeRelease(e),this._modulator._triggerEnvelopeRelease(e),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this._carrier.dispose(),this._modulator.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._modulationNode.dispose(),this}}class Ha extends ja{constructor(){super(Rr(Ha.getDefaults(),arguments)),this.name="AMSynth",this._modulationScale=new da({context:this.context}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output)}dispose(){return super.dispose(),this._modulationScale.dispose(),this}}class $a extends Si{constructor(){super(Rr($a.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=Rr($a.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new ki({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new ki({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new ki({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new ki({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(Si.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(e){rr(-1!==["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(e),`Invalid filter type: ${e}`),this._filter.type=e}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.type=e))}get rolloff(){return this._rolloff}set rolloff(e){const t=fr(e)?e:parseInt(e,10),n=[-12,-24,-48,-96];let s=n.indexOf(t);rr(-1!==s,`rolloff can only be ${n.join(", ")}`),s+=1,this._rolloff=t,this.input.disconnect(),this._filters.forEach((e=>e.disconnect())),this._filters=new Array(s);for(let e=0;e1));return this._filters.forEach((()=>{t.getFrequencyResponse(e).forEach(((e,t)=>n[t]*=e))})),t.dispose(),n}dispose(){return super.dispose(),this._filters.forEach((e=>{e.dispose()})),Yr(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Xa extends Pa{constructor(){super(Rr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=Rr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Ba({context:this.context,value:e.exponent}),this._scale=this.output=new xa({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pa.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);ir(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._scale.max=this._baseFrequency*Math.pow(2,e)}get exponent(){return this._exponent.value}set exponent(e){this._exponent.value=e}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class Za extends Ga{constructor(){super(Rr(Za.getDefaults(),arguments)),this.name="MonoSynth";const e=Rr(Za.getDefaults(),arguments);this.oscillator=new va(Object.assign(e.oscillator,{context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new Ka(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new Xa(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Ua(Object.assign(e.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Zr(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Mr(Ka.getDefaults(),Object.keys(Si.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Mr(Xa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Mr(va.getDefaults(),Object.keys(ea.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(e,t=1){if(this.envelope.triggerAttack(e,t),this.filterEnvelope.triggerAttack(e),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.filterEnvelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Ya extends Ga{constructor(){super(Rr(Ya.getDefaults(),arguments)),this.name="DuoSynth";const e=Rr(Ya.getDefaults(),arguments);this.voice0=new Za(Object.assign(e.voice0,{context:this.context,onsilence:()=>this.onsilence(this)})),this.voice1=new Za(Object.assign(e.voice1,{context:this.context})),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this._vibrato=new ka({frequency:e.vibratoRate,context:this.context,min:-50,max:50}),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new Ti({context:this.context,units:"normalRange",gain:e.vibratoAmount}),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new Ri({context:this.context,units:"frequency",value:440}),this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.detune.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),Zr(this,["voice0","voice1","frequency","vibratoAmount","vibratoRate"])}getLevelAtTime(e){return e=this.toSeconds(e),this.voice0.envelope.getValueAtTime(e)+this.voice1.envelope.getValueAtTime(e)}static getDefaults(){return Or(Ga.getDefaults(),{vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:Or(Mr(Za.getDefaults(),Object.keys(Ga.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}),voice1:Or(Mr(Za.getDefaults(),Object.keys(Ga.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}})})}_triggerEnvelopeAttack(e,t){this.voice0._triggerEnvelopeAttack(e,t),this.voice1._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this.voice0._triggerEnvelopeRelease(e),this.voice1._triggerEnvelopeRelease(e),this}dispose(){return super.dispose(),this.voice0.dispose(),this.voice1.dispose(),this.frequency.dispose(),this.detune.dispose(),this._vibrato.dispose(),this.vibratoRate.dispose(),this._vibratoGain.dispose(),this.harmonicity.dispose(),this}}class Qa extends ja{constructor(){super(Rr(Qa.getDefaults(),arguments)),this.name="FMSynth";const e=Rr(Qa.getDefaults(),arguments);this.modulationIndex=new pa({context:this.context,value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output)}static getDefaults(){return Object.assign(ja.getDefaults(),{modulationIndex:10})}dispose(){return super.dispose(),this.modulationIndex.dispose(),this}}const Ja=[1,1.483,1.932,2.546,2.63,3.897];class eo extends Ga{constructor(){super(Rr(eo.getDefaults(),arguments)),this.name="MetalSynth",this._oscillators=[],this._freqMultipliers=[];const e=Rr(eo.getDefaults(),arguments);this.detune=new Ri({context:this.context,units:"cents",value:e.detune}),this.frequency=new Ri({context:this.context,units:"frequency"}),this._amplitude=new Ti({context:this.context,gain:0}).connect(this.output),this._highpass=new Ka({Q:0,context:this.context,type:"highpass"}).connect(this._amplitude);for(let t=0;tthis.onsilence(this):Qr,type:"square"});n.connect(this._highpass),this._oscillators[t]=n;const s=new pa({context:this.context,value:Ja[t]});this._freqMultipliers[t]=s,this.frequency.chain(s,n.frequency),this.detune.connect(n.detune)}this._filterFreqScaler=new xa({context:this.context,max:7e3,min:this.toFrequency(e.resonance)}),this.envelope=new Pa({attack:e.envelope.attack,attackCurve:"linear",context:this.context,decay:e.envelope.decay,release:e.envelope.release,sustain:0}),this.envelope.chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitude.gain),this._octaves=e.octaves,this.octaves=e.octaves}static getDefaults(){return Or(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.001,decay:1.4,release:.2}),harmonicity:5.1,modulationIndex:32,octaves:1.5,resonance:4e3})}_triggerEnvelopeAttack(e,t=1){return this.envelope.triggerAttack(e,t),this._oscillators.forEach((t=>t.start(e))),0===this.envelope.sustain&&this._oscillators.forEach((t=>{t.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay))})),this}_triggerEnvelopeRelease(e){return this.envelope.triggerRelease(e),this._oscillators.forEach((t=>t.stop(e+this.toSeconds(this.envelope.release)))),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}get modulationIndex(){return this._oscillators[0].modulationIndex.value}set modulationIndex(e){this._oscillators.forEach((t=>t.modulationIndex.value=e))}get harmonicity(){return this._oscillators[0].harmonicity.value}set harmonicity(e){this._oscillators.forEach((t=>t.harmonicity.value=e))}get resonance(){return this._filterFreqScaler.min}set resonance(e){this._filterFreqScaler.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._filterFreqScaler.max=this._filterFreqScaler.min*Math.pow(2,e)}dispose(){return super.dispose(),this._oscillators.forEach((e=>e.dispose())),this._freqMultipliers.forEach((e=>e.dispose())),this.frequency.dispose(),this.detune.dispose(),this._filterFreqScaler.dispose(),this._amplitude.dispose(),this.envelope.dispose(),this._highpass.dispose(),this}}class to extends qa{constructor(){super(Rr(to.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=Rr(to.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Zr(this,["oscillator","envelope"])}static getDefaults(){return Or(Ga.getDefaults(),qa.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,t){const n=this.toSeconds(t),s=this.toFrequency(e instanceof gi?e.toFrequency():e),r=s*this.octaves;return this.oscillator.frequency.setValueAtTime(r,n),this.oscillator.frequency.exponentialRampToValueAtTime(s,n+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}xr([Sa(0)],to.prototype,"octaves",void 0),xr([_a(0)],to.prototype,"pitchDecay",void 0);class no extends Wa{constructor(){super(Rr(no.getDefaults(),arguments)),this.name="NoiseSynth";const e=Rr(no.getDefaults(),arguments);this.noise=new na(Object.assign({context:this.context},e.noise)),this.envelope=new Ua(Object.assign({context:this.context},e.envelope)),this.noise.chain(this.envelope,this.output)}static getDefaults(){return Object.assign(Wa.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{decay:.1,sustain:0}),noise:Object.assign(Mr(na.getDefaults(),Object.keys(ea.getDefaults())),{type:"white"})})}triggerAttack(e,t=1){return e=this.toSeconds(e),this.envelope.triggerAttack(e,t),this.noise.start(e),0===this.envelope.sustain&&this.noise.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay)),this}triggerRelease(e){return e=this.toSeconds(e),this.envelope.triggerRelease(e),this.noise.stop(e+this.toSeconds(this.envelope.release)),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0)),this}triggerAttackRelease(e,t,n=1){return t=this.toSeconds(t),e=this.toSeconds(e),this.triggerAttack(t,n),this.triggerRelease(t+e),this}dispose(){return super.dispose(),this.noise.dispose(),this.envelope.dispose(),this}}const so=new Set;function ro(e){so.add(e)}function io(e,t){const n=`registerProcessor("${e}", ${t})`;so.add(n)}class ao extends Si{constructor(e){super(e),this.name="ToneAudioWorklet",this.workletOptions={},this.onprocessorerror=Qr;const t=URL.createObjectURL(new Blob([Array.from(so).join("\n")],{type:"text/javascript"})),n=this._audioWorkletName();this._dummyGain=this.context.createGain(),this._dummyParam=this._dummyGain.gain,this.context.addAudioWorkletModule(t,n).then((()=>{this.disposed||(this._worklet=this.context.createAudioWorkletNode(n,this.workletOptions),this._worklet.onprocessorerror=this.onprocessorerror.bind(this),this.onReady(this._worklet))}))}dispose(){return super.dispose(),this._dummyGain.disconnect(),this._worklet&&(this._worklet.port.postMessage("dispose"),this._worklet.disconnect()),this}}ro('\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it\'s disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === "dispose") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n');ro("\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n");ro("\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels; i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n");const oo="feedback-comb-filter";io(oo,'\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: "delayTime",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}, {\n\t\t\t\tname: "feedback",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n');class lo extends ao{constructor(){super(Rr(lo.getDefaults(),arguments,["delayTime","resonance"])),this.name="FeedbackCombFilter";const e=Rr(lo.getDefaults(),arguments,["delayTime","resonance"]);this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this.delayTime=new ki({context:this.context,value:e.delayTime,units:"time",minValue:0,maxValue:1,param:this._dummyParam,swappable:!0}),this.resonance=new ki({context:this.context,value:e.resonance,units:"normalRange",param:this._dummyParam,swappable:!0}),Zr(this,["resonance","delayTime"])}_audioWorkletName(){return oo}static getDefaults(){return Object.assign(Si.getDefaults(),{delayTime:.1,resonance:.5})}onReady(e){_i(this.input,e,this.output);const t=e.parameters.get("delayTime");this.delayTime.setParam(t);const n=e.parameters.get("feedback");this.resonance.setParam(n)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.delayTime.dispose(),this.resonance.dispose(),this}}class uo extends Si{constructor(){super(Rr(uo.getDefaults(),arguments,["frequency","type"])),this.name="OnePoleFilter";const e=Rr(uo.getDefaults(),arguments,["frequency","type"]);this._frequency=e.frequency,this._type=e.type,this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this._createFilter()}static getDefaults(){return Object.assign(Si.getDefaults(),{frequency:880,type:"lowpass"})}_createFilter(){const e=this._filter,t=this.toFrequency(this._frequency),n=1/(2*Math.PI*t);if("lowpass"===this._type){const e=1/(n*this.context.sampleRate),t=e-1;this._filter=this.context.createIIRFilter([e,0],[1,t])}else{const e=1/(n*this.context.sampleRate)-1;this._filter=this.context.createIIRFilter([1,-1],[1,e])}this.input.chain(this._filter,this.output),e&&this.context.setTimeout((()=>{this.disposed||(this.input.disconnect(e),e.disconnect())}),this.blockTime)}get frequency(){return this._frequency}set frequency(e){this._frequency=e,this._createFilter()}get type(){return this._type}set type(e){this._type=e,this._createFilter()}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.voice===e));this._activeVoices.splice(t,1)}_getNextAvailableVoice(){if(this._availableVoices.length)return this._availableVoices.shift();if(this._voices.lengthMath.ceil(this._averageActiveVoices+1)){const e=this._availableVoices.shift(),t=this._voices.indexOf(e);this._voices.splice(t,1),this.context.isOffline||e.dispose()}}_triggerAttack(e,t,n){e.forEach((e=>{const s=new Wi(this.context,e).toMidi(),r=this._getNextAvailableVoice();r&&(r.triggerAttack(e,t,n),this._activeVoices.push({midi:s,voice:r,released:!1}),this.log("triggerAttack",e,t))}))}_triggerRelease(e,t){e.forEach((e=>{const n=new Wi(this.context,e).toMidi(),s=this._activeVoices.find((({midi:e,released:t})=>e===n&&!t));s&&(s.voice.triggerRelease(t),s.released=!0,this.log("triggerRelease",e,t))}))}_scheduleEvent(e,t,n,s){rr(!this.disposed,"Synth was already disposed"),n<=this.now()?"attack"===e?this._triggerAttack(t,n,s):this._triggerRelease(t,n):this.context.setTimeout((()=>{this._scheduleEvent(e,t,n,s)}),n-this.now())}triggerAttack(e,t,n){Array.isArray(e)||(e=[e]);const s=this.toSeconds(t);return this._scheduleEvent("attack",e,s,n),this}triggerRelease(e,t){Array.isArray(e)||(e=[e]);const n=this.toSeconds(t);return this._scheduleEvent("release",e,n),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n);if(this.triggerAttack(e,r,s),yr(t)){rr(yr(e),"If the duration is an array, the notes must also be an array");for(let n=0;n0,"The duration must be greater than 0"),this.triggerRelease(e[n],r+i)}}else{const n=this.toSeconds(t);rr(n>0,"The duration must be greater than 0"),this.triggerRelease(e,r+n)}return this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}set(e){const t=Mr(e,["onsilence","context"]);return this.options=Or(this.options,t),this._voices.forEach((e=>e.set(t))),this._dummyVoice.set(t),this}get(){return this._dummyVoice.get()}releaseAll(e){const t=this.toSeconds(e);return this._activeVoices.forEach((({voice:e})=>{e.triggerRelease(t)})),this}dispose(){return super.dispose(),this._dummyVoice.dispose(),this._voices.forEach((e=>e.dispose())),this._activeVoices=[],this._availableVoices=[],this.context.clearInterval(this._gcTimeout),this}}class fo extends Wa{constructor(){super(Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),t={};Object.keys(e.urls).forEach((n=>{const s=parseInt(n,10);if(rr(wr(n)||fr(s)&&isFinite(s),`url key is neither a note or midi pitch: ${n}`),wr(n)){const s=new gi(this.context,n).toMidi();t[s]=e.urls[n]}else fr(s)&&isFinite(s)&&(t[s]=e.urls[s])})),this._buffers=new Vi({urls:t,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(Wa.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Qr,onerror:Qr,release:.1,urls:{}})}_findClosest(e){let t=0;for(;t<96;){if(this._buffers.has(e+t))return-t;if(this._buffers.has(e-t))return t;t++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,n=1){return this.log("triggerAttack",e,t,n),Array.isArray(e)||(e=[e]),e.forEach((e=>{const s=hi(new gi(this.context,e).toFrequency()),r=Math.round(s),i=s-r,a=this._findClosest(r),o=r-a,l=this._buffers.get(o),u=li(a+i),c=new ta({url:l,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:u}).connect(this.output);c.start(t,0,l.duration/u,n),yr(this._activeSources.get(r))||this._activeSources.set(r,[]),this._activeSources.get(r).push(c),c.onended=()=>{if(this._activeSources&&this._activeSources.has(r)){const e=this._activeSources.get(r),t=e.indexOf(c);-1!==t&&e.splice(t,1)}}})),this}triggerRelease(e,t){return this.log("triggerRelease",e,t),Array.isArray(e)||(e=[e]),e.forEach((e=>{const n=new gi(this.context,e).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const e=this._activeSources.get(n);t=this.toSeconds(t),e.forEach((e=>{e.stop(t)})),this._activeSources.set(n,[])}})),this}releaseAll(e){const t=this.toSeconds(e);return this._activeSources.forEach((e=>{for(;e.length;){e.shift().stop(t)}})),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,t,n,s=1){const r=this.toSeconds(n);return this.triggerAttack(e,r,s),yr(t)?(rr(yr(e),"notes must be an array when duration is array"),e.forEach(((e,n)=>{const s=t[Math.min(n,t.length-1)];this.triggerRelease(e,r+this.toSeconds(s))}))):this.triggerRelease(e,r+this.toSeconds(t)),this}add(e,t,n){if(rr(wr(e)||isFinite(e),`note must be a pitch or midi: ${e}`),wr(e)){const s=new gi(this.context,e).toMidi();this._buffers.add(s,t,n)}else this._buffers.add(e,t,n);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach((e=>{e.forEach((e=>e.dispose()))})),this._activeSources.clear(),this}}xr([_a(0)],fo.prototype,"attack",void 0),xr([_a(0)],fo.prototype,"release",void 0);class mo extends xi{constructor(){super(Rr(mo.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new Ci("stopped"),this._startOffset=0;const e=Rr(mo.getDefaults(),arguments,["callback","value"]);this._loop=e.loop,this.callback=e.callback,this.value=e.value,this._loopStart=this.toTicks(e.loopStart),this._loopEnd=this.toTicks(e.loopEnd),this._playbackRate=e.playbackRate,this._probability=e.probability,this._humanize=e.humanize,this.mute=e.mute,this._playbackRate=e.playbackRate,this._state.increasing=!0,this._rescheduleEvents()}static getDefaults(){return Object.assign(xi.getDefaults(),{callback:Qr,humanize:!1,loop:!1,loopEnd:"1m",loopStart:0,mute:!1,playbackRate:1,probability:1,value:null})}_rescheduleEvents(e=-1){this._state.forEachFrom(e,(e=>{let t;if("started"===e.state){-1!==e.id&&this.context.transport.clear(e.id);const n=e.time+Math.round(this.startOffset/this._playbackRate);if(!0===this._loop||fr(this._loop)&&this._loop>1){t=1/0,fr(this._loop)&&(t=this._loop*this._getLoopDuration());const s=this._state.getAfter(n);null!==s&&(t=Math.min(t,s.time-n)),t!==1/0&&(this._state.setStateAtTime("stopped",n+t+1,{id:-1}),t=new Ui(this.context,t));const r=new Ui(this.context,this._getLoopDuration());e.id=this.context.transport.scheduleRepeat(this._tick.bind(this),r,new Ui(this.context,n),t)}else e.id=this.context.transport.schedule(this._tick.bind(this),new Ui(this.context,n))}}))}get state(){return this._state.getValueAtTime(this.context.transport.ticks)}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e}get probability(){return this._probability}set probability(e){this._probability=e}get humanize(){return this._humanize}set humanize(e){this._humanize=e}start(e){const t=this.toTicks(e);return"stopped"===this._state.getValueAtTime(t)&&(this._state.add({id:-1,state:"started",time:t}),this._rescheduleEvents(t)),this}stop(e){this.cancel(e);const t=this.toTicks(e);if("started"===this._state.getValueAtTime(t)){this._state.setStateAtTime("stopped",t,{id:-1});const e=this._state.getBefore(t);let n=t;null!==e&&(n=e.time),this._rescheduleEvents(n)}return this}cancel(e){e=Dr(e,-1/0);const t=this.toTicks(e);return this._state.forEachFrom(t,(e=>{this.context.transport.clear(e.id)})),this._state.cancel(t),this}_tick(e){const t=this.context.transport.getTicksAtTime(e);if(!this.mute&&"started"===this._state.getValueAtTime(t)){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){let t=.02;gr(this.humanize)||(t=this.toSeconds(this.humanize)),e+=(2*Math.random()-1)*t}this.callback(e,this.value)}}_getLoopDuration(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)}get loop(){return this._loop}set loop(e){this._loop=e,this._rescheduleEvents()}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._rescheduleEvents()}get loopEnd(){return new Ui(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new Ui(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._rescheduleEvents()}get progress(){if(this._loop){const e=this.context.transport.ticks,t=this._state.get(e);if(null!==t&&"started"===t.state){const n=this._getLoopDuration();return(e-t.time)%n/n}return 0}return 0}dispose(){return super.dispose(),this.cancel(),this._state.dispose(),this}}class go extends xi{constructor(){super(Rr(go.getDefaults(),arguments,["callback","interval"])),this.name="Loop";const e=Rr(go.getDefaults(),arguments,["callback","interval"]);this._event=new mo({context:this.context,callback:this._tick.bind(this),loop:!0,loopEnd:e.interval,playbackRate:e.playbackRate,probability:e.probability}),this.callback=e.callback,this.iterations=e.iterations}static getDefaults(){return Object.assign(xi.getDefaults(),{interval:"4n",callback:Qr,playbackRate:1,iterations:1/0,probability:1,mute:!1,humanize:!1})}start(e){return this._event.start(e),this}stop(e){return this._event.stop(e),this}cancel(e){return this._event.cancel(e),this}_tick(e){this.callback(e)}get state(){return this._event.state}get progress(){return this._event.progress}get interval(){return this._event.loopEnd}set interval(e){this._event.loopEnd=e}get playbackRate(){return this._event.playbackRate}set playbackRate(e){this._event.playbackRate=e}get humanize(){return this._event.humanize}set humanize(e){this._event.humanize=e}get probability(){return this._event.probability}set probability(e){this._event.probability=e}get mute(){return this._event.mute}set mute(e){this._event.mute=e}get iterations(){return!0===this._event.loop?1/0:this._event.loop}set iterations(e){this._event.loop=e===1/0||e}dispose(){return super.dispose(),this._event.dispose(),this}}class yo extends mo{constructor(){super(Rr(yo.getDefaults(),arguments,["callback","events"])),this.name="Part",this._state=new Ci("stopped"),this._events=new Set;const e=Rr(yo.getDefaults(),arguments,["callback","events"]);this._state.increasing=!0,e.events.forEach((e=>{yr(e)?this.add(e[0],e[1]):this.add(e)}))}static getDefaults(){return Object.assign(mo.getDefaults(),{events:[]})}start(e,t){const n=this.toTicks(e);if("started"!==this._state.getValueAtTime(n)){t=Dr(t,this._loop?this._loopStart:0),t=this._loop?Dr(t,this._loopStart):Dr(t,0);const e=this.toTicks(t);this._state.add({id:-1,offset:e,state:"started",time:n}),this._forEach((t=>{this._startNote(t,n,e)}))}return this}_startNote(e,t,n){t-=n,this._loop?e.startOffset>=this._loopStart&&e.startOffset=n&&(e.loop=!1,e.start(new Ui(this.context,t))):e.startOffset>=n&&e.start(new Ui(this.context,t))}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e,this._forEach((e=>{e.startOffset+=this._startOffset}))}stop(e){const t=this.toTicks(e);return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this._forEach((t=>{t.stop(e)})),this}at(e,t){const n=new vi(this.context,e).toTicks(),s=new Ui(this.context,1).toSeconds(),r=this._events.values();let i=r.next();for(;!i.done;){const e=i.value;if(Math.abs(n-e.startOffset){"started"===t.state?this._startNote(e,t.time,t.offset):e.stop(new Ui(this.context,t.time))}))}remove(e,t){return mr(e)&&e.hasOwnProperty("time")&&(e=(t=e).time),e=this.toTicks(e),this._events.forEach((n=>{n.startOffset===e&&(hr(t)||dr(t)&&n.value===t)&&(this._events.delete(n),n.dispose())})),this}clear(){return this._forEach((e=>e.dispose())),this._events.clear(),this}cancel(e){return this._forEach((t=>t.cancel(e))),this._state.cancel(this.toTicks(e)),this}_forEach(e){return this._events&&this._events.forEach((t=>{t instanceof yo?t._forEach(e):e(t)})),this}_setAll(e,t){this._forEach((n=>{n[e]=t}))}_tick(e,t){this.mute||this.callback(e,t)}_testLoopBoundries(e){this._loop&&(e.startOffset=this._loopEnd)?e.cancel(0):"stopped"===e.state&&this._restartEvent(e)}get probability(){return this._probability}set probability(e){this._probability=e,this._setAll("probability",e)}get humanize(){return this._humanize}set humanize(e){this._humanize=e,this._setAll("humanize",e)}get loop(){return this._loop}set loop(e){this._loop=e,this._forEach((t=>{t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.loop=e,this._testLoopBoundries(t)}))}get loopEnd(){return new Ui(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._forEach((t=>{t.loopEnd=e,this._testLoopBoundries(t)}))}get loopStart(){return new Ui(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._forEach((e=>{e.loopStart=this.loopStart,this._testLoopBoundries(e)}))}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._setAll("playbackRate",e)}get length(){return this._events.size}dispose(){return super.dispose(),this.clear(),this}}function*bo(e){let t=0;for(;t=0;)t=Ao(t,e),yield e[t],t--}function*vo(e,t){for(;;)yield*t(e)}function Ao(e,t){return Wr(e,0,t.length-1)}function*xo(e,t){let n=t?0:e.length-1;for(;;)n=Ao(n,e),yield e[n],t?(n++,n>=e.length-1&&(t=!1)):(n--,n<=0&&(t=!0))}function*Co(e){let t=0,n=0;for(;t=0;)t=Ao(t,e),yield e[t],n++,t+=n%2?-2:1}function*So(e){const t=[];for(let n=0;n0;){const n=Ao(t.splice(Math.floor(t.length*Math.random()),1)[0],e);yield e[n]}}function*_o(e,t="up",n=0){switch(rr(e.length>0,"The array must have more than one value in it"),t){case"up":yield*vo(e,bo);case"down":yield*vo(e,wo);case"upDown":yield*xo(e,!0);case"downUp":yield*xo(e,!1);case"alternateUp":yield*vo(e,Co);case"alternateDown":yield*vo(e,ko);case"random":yield*function*(e){for(;;){const t=Math.floor(Math.random()*e.length);yield e[t]}}(e);case"randomOnce":yield*vo(e,So);case"randomWalk":yield*function*(e){let t=Math.floor(Math.random()*e.length);for(;;)0===t?t++:t===e.length-1||Math.random()<.5?t--:t++,yield e[t]}(e)}}class Eo extends go{constructor(){super(Rr(Eo.getDefaults(),arguments,["callback","values","pattern"])),this.name="Pattern";const e=Rr(Eo.getDefaults(),arguments,["callback","values","pattern"]);this.callback=e.callback,this._values=e.values,this._pattern=_o(e.values,e.pattern),this._type=e.pattern}static getDefaults(){return Object.assign(go.getDefaults(),{pattern:"up",values:[],callback:Qr})}_tick(e){const t=this._pattern.next();this._value=t.value,this.callback(e,this._value)}get values(){return this._values}set values(e){this._values=e,this.pattern=this._type}get value(){return this._value}get pattern(){return this._type}set pattern(e){this._type=e,this._pattern=_o(this._values,this._type)}}class Io extends mo{constructor(){super(Rr(Io.getDefaults(),arguments,["callback","events","subdivision"])),this.name="Sequence",this._part=new yo({callback:this._seqCallback.bind(this),context:this.context}),this._events=[],this._eventsArray=[];const e=Rr(Io.getDefaults(),arguments,["callback","events","subdivision"]);this._subdivision=this.toTicks(e.subdivision),this.events=e.events,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.playbackRate=e.playbackRate,this.probability=e.probability,this.humanize=e.humanize,this.mute=e.mute,this.playbackRate=e.playbackRate}static getDefaults(){return Object.assign(Mr(mo.getDefaults(),["value"]),{events:[],loop:!0,loopEnd:0,loopStart:0,subdivision:"8n"})}_seqCallback(e,t){null!==t&&this.callback(e,t)}get events(){return this._events}set events(e){this.clear(),this._eventsArray=e,this._events=this._createSequence(this._eventsArray),this._eventsUpdated()}start(e,t){return this._part.start(e,t?this._indexTime(t):t),this}stop(e){return this._part.stop(e),this}get subdivision(){return new Ui(this.context,this._subdivision).toSeconds()}_createSequence(e){return new Proxy(e,{get:(e,t)=>e[t],set:(e,t,n)=>(br(t)&&isFinite(parseInt(t,10))&&yr(n)?e[t]=this._createSequence(n):e[t]=n,this._eventsUpdated(),!0)})}_eventsUpdated(){this._part.clear(),this._rescheduleSequence(this._eventsArray,this._subdivision,this.startOffset),this.loopEnd=this.loopEnd}_rescheduleSequence(e,t,n){e.forEach(((e,s)=>{const r=s*t+n;if(yr(e))this._rescheduleSequence(e,t/e.length,r);else{const t=new Ui(this.context,r,"i").toSeconds();this._part.add(t,e)}}))}_indexTime(e){return new Ui(this.context,e*this._subdivision+this.startOffset).toSeconds()}clear(){return this._part.clear(),this}dispose(){return super.dispose(),this._part.dispose(),this}get loop(){return this._part.loop}set loop(e){this._part.loop=e}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this._part.loopStart=this._indexTime(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this._part.loopEnd=0===e?this._indexTime(this._eventsArray.length):this._indexTime(e)}get startOffset(){return this._part.startOffset}set startOffset(e){this._part.startOffset=e}get playbackRate(){return this._part.playbackRate}set playbackRate(e){this._part.playbackRate=e}get probability(){return this._part.probability}set probability(e){this._part.probability=e}get progress(){return this._part.progress}get humanize(){return this._part.humanize}set humanize(e){this._part.humanize=e}get length(){return this._part.length}}class To extends Si{constructor(){super(Object.assign(Rr(To.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new Oa({context:this.context}),this.a=new Ti({context:this.context,gain:0}),this.b=new Ti({context:this.context,gain:0}),this.output=new Ti({context:this.context}),this._internalChannels=[this.a,this.b];const e=Rr(To.getDefaults(),arguments,["fade"]);this.fade=new Ri({context:this.context,units:"normalRange",value:e.fade}),Zr(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Ei(this._split,this.a.gain,0),Ei(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(Si.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class No extends Si{constructor(e){super(e),this.name="Effect",this._dryWet=new To({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new Ti({context:this.context}),this.effectReturn=new Ti({context:this.context}),this.input=new Ti({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(e.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Zr(this,"wet")}static getDefaults(){return Object.assign(Si.getDefaults(),{wet:1})}connectEffect(e){return this._internalChannels.push(e),this.effectSend.chain(e,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class Oo extends No{constructor(e){super(e),this.name="LFOEffect",this._lfo=new ka({context:this.context,frequency:e.frequency,amplitude:e.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.type=e.type,Zr(this,["frequency","depth"])}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:1,type:"sine",depth:1})}start(e){return this._lfo.start(e),this}stop(e){return this._lfo.stop(e),this}sync(){return this._lfo.sync(),this}unsync(){return this._lfo.unsync(),this}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class Ro extends Oo{constructor(){super(Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"])),this.name="AutoFilter";const e=Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"]);this.filter=new Ka(Object.assign(e.filter,{context:this.context})),this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.octaves=e.octaves,this.baseFrequency=e.baseFrequency}static getDefaults(){return Object.assign(Oo.getDefaults(),{baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}})}get baseFrequency(){return this._lfo.min}set baseFrequency(e){this._lfo.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._lfo.max=this._lfo.min*Math.pow(2,e)}dispose(){return super.dispose(),this.filter.dispose(),this}}class Do extends Si{constructor(){super(Object.assign(Rr(Do.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=Rr(Do.getDefaults(),arguments,["pan"]);this.pan=new ki({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",Zr(this,"pan")}static getDefaults(){return Object.assign(Si.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}class Mo extends Oo{constructor(){super(Rr(Mo.getDefaults(),arguments,["frequency"])),this.name="AutoPanner";const e=Rr(Mo.getDefaults(),arguments,["frequency"]);this._panner=new Do({context:this.context,channelCount:e.channelCount}),this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this._lfo.min=-1,this._lfo.max=1}static getDefaults(){return Object.assign(Oo.getDefaults(),{channelCount:1})}dispose(){return super.dispose(),this._panner.dispose(),this}}class Fo extends Si{constructor(){super(Rr(Fo.getDefaults(),arguments,["smoothing"])),this.name="Follower";const e=Rr(Fo.getDefaults(),arguments,["smoothing"]);this._abs=this.input=new Na({context:this.context}),this._lowpass=this.output=new uo({context:this.context,frequency:1/this.toSeconds(e.smoothing),type:"lowpass"}),this._abs.connect(this._lowpass),this._smoothing=e.smoothing}static getDefaults(){return Object.assign(Si.getDefaults(),{smoothing:.05})}get smoothing(){return this._smoothing}set smoothing(e){this._smoothing=e,this._lowpass.frequency=1/this.toSeconds(this.smoothing)}dispose(){return super.dispose(),this._abs.dispose(),this._lowpass.dispose(),this}}class Bo extends No{constructor(){super(Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"])),this.name="AutoWah";const e=Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"]);this._follower=new Fo({context:this.context,smoothing:e.follower}),this._sweepRange=new za({context:this.context,min:0,max:1,exponent:.5}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this._inputBoost=new Ti({context:this.context}),this._bandpass=new Ka({context:this.context,rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new Ka({context:this.context,type:"peaking"}),this._peaking.gain.value=e.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this._follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=e.sensitivity,Zr(this,["gain","Q"])}static getDefaults(){return Object.assign(No.getDefaults(),{baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:.2})}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._setSweepRange()}get follower(){return this._follower.smoothing}set follower(e){this._follower.smoothing=e}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){this._baseFrequency=this.toFrequency(e),this._setSweepRange()}get sensitivity(){return oi(1/this._inputBoost.gain.value)}set sensitivity(e){this._inputBoost.gain.value=1/ai(e)}_setSweepRange(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)}dispose(){return super.dispose(),this._follower.dispose(),this._sweepRange.dispose(),this._bandpass.dispose(),this._peaking.dispose(),this._inputBoost.dispose(),this}}const zo="bit-crusher";io(zo,"\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n");class Lo extends No{constructor(){super(Rr(Lo.getDefaults(),arguments,["bits"])),this.name="BitCrusher";const e=Rr(Lo.getDefaults(),arguments,["bits"]);this._bitCrusherWorklet=new Po({context:this.context,bits:e.bits}),this.connectEffect(this._bitCrusherWorklet),this.bits=this._bitCrusherWorklet.bits}static getDefaults(){return Object.assign(No.getDefaults(),{bits:4})}dispose(){return super.dispose(),this._bitCrusherWorklet.dispose(),this}}class Po extends ao{constructor(){super(Rr(Po.getDefaults(),arguments)),this.name="BitCrusherWorklet";const e=Rr(Po.getDefaults(),arguments);this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this.bits=new ki({context:this.context,value:e.bits,units:"positive",minValue:1,maxValue:16,param:this._dummyParam,swappable:!0})}static getDefaults(){return Object.assign(ao.getDefaults(),{bits:12})}_audioWorkletName(){return zo}onReady(e){_i(this.input,e,this.output);const t=e.parameters.get("bits");this.bits.setParam(t)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.bits.dispose(),this}}class Vo extends No{constructor(){super(Rr(Vo.getDefaults(),arguments,["order"])),this.name="Chebyshev";const e=Rr(Vo.getDefaults(),arguments,["order"]);this._shaper=new ha({context:this.context,length:4096}),this._order=e.order,this.connectEffect(this._shaper),this.order=e.order,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{order:1,oversample:"none"})}_getCoefficient(e,t,n){return n.has(t)||(0===t?n.set(t,0):1===t?n.set(t,e):n.set(t,2*e*this._getCoefficient(e,t-1,n)-this._getCoefficient(e,t-2,n))),n.get(t)}get order(){return this._order}set order(e){this._order=e,this._shaper.setMap((t=>this._getCoefficient(t,e,new Map)))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class Wo extends Si{constructor(){super(Rr(Wo.getDefaults(),arguments,["channels"])),this.name="Split";const e=Rr(Wo.getDefaults(),arguments,["channels"]);this._splitter=this.input=this.output=this.context.createChannelSplitter(e.channels),this._internalChannels=[this._splitter]}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._splitter.disconnect(),this}}class Go extends Si{constructor(){super(Rr(Go.getDefaults(),arguments,["channels"])),this.name="Merge";const e=Rr(Go.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Uo extends Si{constructor(e){super(e),this.name="StereoEffect",this.input=new Ti({context:this.context}),this.input.channelCount=2,this.input.channelCountMode="explicit",this._dryWet=this.output=new To({context:this.context,fade:e.wet}),this.wet=this._dryWet.fade,this._split=new Wo({context:this.context,channels:2}),this._merge=new Go({context:this.context,channels:2}),this.input.connect(this._split),this.input.connect(this._dryWet.a),this._merge.connect(this._dryWet.b),Zr(this,["wet"])}connectEffectLeft(...e){this._split.connect(e[0],0,0),_i(...e),Ei(e[e.length-1],this._merge,0,0)}connectEffectRight(...e){this._split.connect(e[0],1,0),_i(...e),Ei(e[e.length-1],this._merge,0,1)}static getDefaults(){return Object.assign(Si.getDefaults(),{wet:1})}dispose(){return super.dispose(),this._dryWet.dispose(),this._split.dispose(),this._merge.dispose(),this}}class qo extends Uo{constructor(e){super(e),this.feedback=new Ri({context:this.context,value:e.feedback,units:"normalRange"}),this._feedbackL=new Ti({context:this.context}),this._feedbackR=new Ti({context:this.context}),this._feedbackSplit=new Wo({context:this.context,channels:2}),this._feedbackMerge=new Go({context:this.context,channels:2}),this._merge.connect(this._feedbackSplit),this._feedbackMerge.connect(this._split),this._feedbackSplit.connect(this._feedbackL,0,0),this._feedbackL.connect(this._feedbackMerge,0,0),this._feedbackSplit.connect(this._feedbackR,1,0),this._feedbackR.connect(this._feedbackMerge,0,1),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),Zr(this,["feedback"])}static getDefaults(){return Object.assign(Uo.getDefaults(),{feedback:.5})}dispose(){return super.dispose(),this.feedback.dispose(),this._feedbackL.dispose(),this._feedbackR.dispose(),this._feedbackSplit.dispose(),this._feedbackMerge.dispose(),this}}class jo extends qo{constructor(){super(Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"])),this.name="Chorus";const e=Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"]);this._depth=e.depth,this._delayTime=e.delayTime/1e3,this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._delayNodeL=new Li({context:this.context}),this._delayNodeR=new Li({context:this.context}),this.frequency=this._lfoL.frequency,Zr(this,["frequency"]),this._lfoL.frequency.connect(this._lfoR.frequency),this.connectEffectLeft(this._delayNodeL),this.connectEffectRight(this._delayNodeR),this._lfoL.connect(this._delayNodeL.delayTime),this._lfoR.connect(this._delayNodeR.delayTime),this.depth=this._depth,this.type=e.type,this.spread=e.spread}static getDefaults(){return Object.assign(qo.getDefaults(),{frequency:1.5,delayTime:3.5,depth:.7,type:"sine",spread:180,feedback:0,wet:.5})}get depth(){return this._depth}set depth(e){this._depth=e;const t=this._delayTime*e;this._lfoL.min=Math.max(this._delayTime-t,0),this._lfoL.max=this._delayTime+t,this._lfoR.min=Math.max(this._delayTime-t,0),this._lfoR.max=this._delayTime+t}get delayTime(){return 1e3*this._delayTime}set delayTime(e){this._delayTime=e/1e3,this.depth=this._depth}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._delayNodeL.dispose(),this._delayNodeR.dispose(),this.frequency.dispose(),this}}class Ho extends No{constructor(){super(Rr(Ho.getDefaults(),arguments,["distortion"])),this.name="Distortion";const e=Rr(Ho.getDefaults(),arguments,["distortion"]);this._shaper=new ha({context:this.context,length:4096}),this._distortion=e.distortion,this.connectEffect(this._shaper),this.distortion=e.distortion,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{distortion:.4,oversample:"none"})}get distortion(){return this._distortion}set distortion(e){this._distortion=e;const t=100*e,n=Math.PI/180;this._shaper.setMap((e=>Math.abs(e)<.001?0:(3+t)*e*20*n/(Math.PI+t*Math.abs(e))))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class $o extends No{constructor(e){super(e),this.name="FeedbackEffect",this._feedbackGain=new Ti({context:this.context,gain:e.feedback,units:"normalRange"}),this.feedback=this._feedbackGain.gain,Zr(this,"feedback"),this.effectReturn.chain(this._feedbackGain,this.effectSend)}static getDefaults(){return Object.assign(No.getDefaults(),{feedback:.125})}dispose(){return super.dispose(),this._feedbackGain.dispose(),this.feedback.dispose(),this}}class Ko extends $o{constructor(){super(Rr(Ko.getDefaults(),arguments,["delayTime","feedback"])),this.name="FeedbackDelay";const e=Rr(Ko.getDefaults(),arguments,["delayTime","feedback"]);this._delayNode=new Li({context:this.context,delayTime:e.delayTime,maxDelay:e.maxDelay}),this.delayTime=this._delayNode.delayTime,this.connectEffect(this._delayNode),Zr(this,"delayTime")}static getDefaults(){return Object.assign($o.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._delayNode.dispose(),this.delayTime.dispose(),this}}class Xo extends Si{constructor(e){super(e),this.name="PhaseShiftAllpass",this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this.offset90=new Ti({context:this.context});this._bank0=this._createAllPassFilterBank([.6923878,.9360654322959,.988229522686,.9987488452737]),this._bank1=this._createAllPassFilterBank([.4021921162426,.856171088242,.9722909545651,.9952884791278]),this._oneSampleDelay=this.context.createIIRFilter([0,1],[1,0]),_i(this.input,...this._bank0,this._oneSampleDelay,this.output),_i(this.input,...this._bank1,this.offset90)}_createAllPassFilterBank(e){return e.map((e=>{const t=[[e*e,0,-1],[1,0,-e*e]];return this.context.createIIRFilter(t[0],t[1])}))}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.offset90.dispose(),this._bank0.forEach((e=>e.disconnect())),this._bank1.forEach((e=>e.disconnect())),this._oneSampleDelay.disconnect(),this}}class Zo extends No{constructor(){super(Rr(Zo.getDefaults(),arguments,["frequency"])),this.name="FrequencyShifter";const e=Rr(Zo.getDefaults(),arguments,["frequency"]);this.frequency=new Ri({context:this.context,units:"frequency",value:e.frequency,minValue:-this.context.sampleRate/2,maxValue:this.context.sampleRate/2}),this._sine=new la({context:this.context,type:"sine"}),this._cosine=new ua({context:this.context,phase:-90,type:"sine"}),this._sineMultiply=new pa({context:this.context}),this._cosineMultiply=new pa({context:this.context}),this._negate=new Ra({context:this.context}),this._add=new Aa({context:this.context}),this._phaseShifter=new Xo({context:this.context}),this.effectSend.connect(this._phaseShifter),this.frequency.fan(this._sine.frequency,this._cosine.frequency),this._phaseShifter.offset90.connect(this._cosineMultiply),this._cosine.connect(this._cosineMultiply.factor),this._phaseShifter.connect(this._sineMultiply),this._sine.connect(this._sineMultiply.factor),this._sineMultiply.connect(this._negate),this._cosineMultiply.connect(this._add),this._negate.connect(this._add.addend),this._add.connect(this.effectReturn);const t=this.immediate();this._sine.start(t),this._cosine.start(t)}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:0})}dispose(){return super.dispose(),this.frequency.dispose(),this._add.dispose(),this._cosine.dispose(),this._cosineMultiply.dispose(),this._negate.dispose(),this._phaseShifter.dispose(),this._sine.dispose(),this._sineMultiply.dispose(),this}}const Yo=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100],Qo=[225,556,441,341];class Jo extends Uo{constructor(){super(Rr(Jo.getDefaults(),arguments,["roomSize","dampening"])),this.name="Freeverb",this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];const e=Rr(Jo.getDefaults(),arguments,["roomSize","dampening"]);this.roomSize=new Ri({context:this.context,value:e.roomSize,units:"normalRange"}),this._allpassFiltersL=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._allpassFiltersR=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._combFilters=Yo.map(((t,n)=>{const s=new co({context:this.context,dampening:e.dampening,delayTime:t});return nt.dampening=e))}dispose(){return super.dispose(),this._allpassFiltersL.forEach((e=>e.disconnect())),this._allpassFiltersR.forEach((e=>e.disconnect())),this._combFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this}}const el=[.06748,.06404,.08212,.09004],tl=[.773,.802,.753,.733],nl=[347,113,37];class sl extends Uo{constructor(){super(Rr(sl.getDefaults(),arguments,["roomSize"])),this.name="JCReverb",this._allpassFilters=[],this._feedbackCombFilters=[];const e=Rr(sl.getDefaults(),arguments,["roomSize"]);this.roomSize=new Ri({context:this.context,value:e.roomSize,units:"normalRange"}),this._scaleRoomSize=new xa({context:this.context,min:-.733,max:.197}),this._allpassFilters=nl.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._feedbackCombFilters=el.map(((e,t)=>{const n=new lo({context:this.context,delayTime:e});return this._scaleRoomSize.connect(n.resonance),n.resonance.value=tl[t],te.disconnect())),this._feedbackCombFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this._scaleRoomSize.dispose(),this}}class rl extends qo{constructor(e){super(e),this._feedbackL.disconnect(),this._feedbackL.connect(this._feedbackMerge,0,1),this._feedbackR.disconnect(),this._feedbackR.connect(this._feedbackMerge,0,0),Zr(this,["feedback"])}}class il extends rl{constructor(){super(Rr(il.getDefaults(),arguments,["delayTime","feedback"])),this.name="PingPongDelay";const e=Rr(il.getDefaults(),arguments,["delayTime","feedback"]);this._leftDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightPreDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this.delayTime=new Ri({context:this.context,units:"time",value:e.delayTime}),this.connectEffectLeft(this._leftDelay),this.connectEffectRight(this._rightPreDelay,this._rightDelay),this.delayTime.fan(this._leftDelay.delayTime,this._rightDelay.delayTime,this._rightPreDelay.delayTime),this._feedbackL.disconnect(),this._feedbackL.connect(this._rightDelay),Zr(this,["delayTime"])}static getDefaults(){return Object.assign(rl.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._leftDelay.dispose(),this._rightDelay.dispose(),this._rightPreDelay.dispose(),this.delayTime.dispose(),this}}class al extends $o{constructor(){super(Rr(al.getDefaults(),arguments,["pitch"])),this.name="PitchShift";const e=Rr(al.getDefaults(),arguments,["pitch"]);this._frequency=new Ri({context:this.context}),this._delayA=new Li({maxDelay:1,context:this.context}),this._lfoA=new ka({context:this.context,min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new Li({maxDelay:1,context:this.context}),this._lfoB=new ka({context:this.context,min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new To({context:this.context}),this._crossFadeLFO=new ka({context:this.context,min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new Li({delayTime:e.delayTime,context:this.context}),this.delayTime=this._feedbackDelay.delayTime,Zr(this,"delayTime"),this._pitch=e.pitch,this._windowSize=e.windowSize,this._delayA.connect(this._crossFade.a),this._delayB.connect(this._crossFade.b),this._frequency.fan(this._lfoA.frequency,this._lfoB.frequency,this._crossFadeLFO.frequency),this.effectSend.fan(this._delayA,this._delayB),this._crossFade.chain(this._feedbackDelay,this.effectReturn);const t=this.now();this._lfoA.start(t),this._lfoB.start(t),this._crossFadeLFO.start(t),this.windowSize=this._windowSize}static getDefaults(){return Object.assign($o.getDefaults(),{pitch:0,windowSize:.1,delayTime:0,feedback:0})}get pitch(){return this._pitch}set pitch(e){this._pitch=e;let t=0;e<0?(this._lfoA.min=0,this._lfoA.max=this._windowSize,this._lfoB.min=0,this._lfoB.max=this._windowSize,t=li(e-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,t=li(e)-1),this._frequency.value=t*(1.2/this._windowSize)}get windowSize(){return this._windowSize}set windowSize(e){this._windowSize=this.toSeconds(e),this.pitch=this._pitch}dispose(){return super.dispose(),this._frequency.dispose(),this._delayA.dispose(),this._delayB.dispose(),this._lfoA.dispose(),this._lfoB.dispose(),this._crossFade.dispose(),this._crossFadeLFO.dispose(),this._feedbackDelay.dispose(),this}}class ol extends Uo{constructor(){super(Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"])),this.name="Phaser";const e=Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"]);this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this.Q=new Ri({context:this.context,value:e.Q,units:"positive"}),this._filtersL=this._makeFilters(e.stages,this._lfoL),this._filtersR=this._makeFilters(e.stages,this._lfoR),this.frequency=this._lfoL.frequency,this.frequency.value=e.frequency,this.connectEffectLeft(...this._filtersL),this.connectEffectRight(...this._filtersR),this._lfoL.frequency.connect(this._lfoR.frequency),this.baseFrequency=e.baseFrequency,this.octaves=e.octaves,this._lfoL.start(),this._lfoR.start(),Zr(this,["frequency","Q"])}static getDefaults(){return Object.assign(Uo.getDefaults(),{frequency:.5,octaves:3,stages:10,Q:10,baseFrequency:350})}_makeFilters(e,t){const n=[];for(let s=0;se.disconnect())),this._filtersR.forEach((e=>e.disconnect())),this.frequency.dispose(),this}}class ll extends No{constructor(){super(Rr(ll.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=Rr(ll.getDefaults(),arguments,["decay"]);this._decay=e.decay,this._preDelay=e.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(No.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(e){ir(e=this.toSeconds(e),.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){ir(e=this.toSeconds(e),0),this._preDelay=e,this.generate()}generate(){return Cr(this,void 0,void 0,(function*(){const e=this.ready,t=new ei(2,this._decay+this._preDelay,this.context.sampleRate),n=new na({context:t}),s=new na({context:t}),r=new Go({context:t});n.connect(r,0,0),s.connect(r,0,1);const i=new Ti({context:t}).toDestination();r.connect(i),n.start(0),s.start(0),i.gain.setValueAtTime(0,0),i.gain.setValueAtTime(1,this._preDelay),i.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=t.render();return this.ready=a.then(Qr),yield e,this._convolver.buffer=(yield a).get(),this}))}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class ul extends Si{constructor(){super(Rr(ul.getDefaults(),arguments)),this.name="MidSideSplit",this._split=this.input=new Wo({channels:2,context:this.context}),this._midAdd=new Aa({context:this.context}),this.mid=new pa({context:this.context,value:Math.SQRT1_2}),this._sideSubtract=new Da({context:this.context}),this.side=new pa({context:this.context,value:Math.SQRT1_2}),this._split.connect(this._midAdd,0),this._split.connect(this._midAdd.addend,1),this._split.connect(this._sideSubtract,0),this._split.connect(this._sideSubtract.subtrahend,1),this._midAdd.connect(this.mid),this._sideSubtract.connect(this.side)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midAdd.dispose(),this._sideSubtract.dispose(),this._split.dispose(),this}}class cl extends Si{constructor(){super(Rr(cl.getDefaults(),arguments)),this.name="MidSideMerge",this.mid=new Ti({context:this.context}),this.side=new Ti({context:this.context}),this._left=new Aa({context:this.context}),this._leftMult=new pa({context:this.context,value:Math.SQRT1_2}),this._right=new Da({context:this.context}),this._rightMult=new pa({context:this.context,value:Math.SQRT1_2}),this._merge=this.output=new Go({context:this.context}),this.mid.fan(this._left),this.side.connect(this._left.addend),this.mid.connect(this._right),this.side.connect(this._right.subtrahend),this._left.connect(this._leftMult),this._right.connect(this._rightMult),this._leftMult.connect(this._merge,0,0),this._rightMult.connect(this._merge,0,1)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._leftMult.dispose(),this._rightMult.dispose(),this._left.dispose(),this._right.dispose(),this}}class hl extends No{constructor(e){super(e),this.name="MidSideEffect",this._midSideMerge=new cl({context:this.context}),this._midSideSplit=new ul({context:this.context}),this._midSend=this._midSideSplit.mid,this._sideSend=this._midSideSplit.side,this._midReturn=this._midSideMerge.mid,this._sideReturn=this._midSideMerge.side,this.effectSend.connect(this._midSideSplit),this._midSideMerge.connect(this.effectReturn)}connectEffectMid(...e){this._midSend.chain(...e,this._midReturn)}connectEffectSide(...e){this._sideSend.chain(...e,this._sideReturn)}dispose(){return super.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this._midSend.dispose(),this._sideSend.dispose(),this._midReturn.dispose(),this._sideReturn.dispose(),this}}class dl extends hl{constructor(){super(Rr(dl.getDefaults(),arguments,["width"])),this.name="StereoWidener";const e=Rr(dl.getDefaults(),arguments,["width"]);this.width=new Ri({context:this.context,value:e.width,units:"normalRange"}),Zr(this,["width"]),this._twoTimesWidthMid=new pa({context:this.context,value:2}),this._twoTimesWidthSide=new pa({context:this.context,value:2}),this._midMult=new pa({context:this.context}),this._twoTimesWidthMid.connect(this._midMult.factor),this.connectEffectMid(this._midMult),this._oneMinusWidth=new Da({context:this.context}),this._oneMinusWidth.connect(this._twoTimesWidthMid),Ei(this.context.getConstant(1),this._oneMinusWidth),this.width.connect(this._oneMinusWidth.subtrahend),this._sideMult=new pa({context:this.context}),this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult.factor),this.connectEffectSide(this._sideMult)}static getDefaults(){return Object.assign(hl.getDefaults(),{width:.5})}dispose(){return super.dispose(),this.width.dispose(),this._midMult.dispose(),this._sideMult.dispose(),this._twoTimesWidthMid.dispose(),this._twoTimesWidthSide.dispose(),this._oneMinusWidth.dispose(),this}}class pl extends Uo{constructor(){super(Rr(pl.getDefaults(),arguments,["frequency","depth"])),this.name="Tremolo";const e=Rr(pl.getDefaults(),arguments,["frequency","depth"]);this._lfoL=new ka({context:this.context,type:e.type,min:1,max:0}),this._lfoR=new ka({context:this.context,type:e.type,min:1,max:0}),this._amplitudeL=new Ti({context:this.context}),this._amplitudeR=new Ti({context:this.context}),this.frequency=new Ri({context:this.context,value:e.frequency,units:"frequency"}),this.depth=new Ri({context:this.context,value:e.depth,units:"normalRange"}),Zr(this,["frequency","depth"]),this.connectEffectLeft(this._amplitudeL),this.connectEffectRight(this._amplitudeR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.spread=e.spread}static getDefaults(){return Object.assign(Uo.getDefaults(),{frequency:10,type:"sine",depth:.5,spread:180})}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this.context.transport.syncSignal(this.frequency),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this.context.transport.unsyncSignal(this.frequency),this}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._amplitudeL.dispose(),this._amplitudeR.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class fl extends No{constructor(){super(Rr(fl.getDefaults(),arguments,["frequency","depth"])),this.name="Vibrato";const e=Rr(fl.getDefaults(),arguments,["frequency","depth"]);this._delayNode=new Li({context:this.context,delayTime:0,maxDelay:e.maxDelay}),this._lfo=new ka({context:this.context,type:e.type,min:0,max:e.maxDelay,frequency:e.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=e.depth,Zr(this,["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)}static getDefaults(){return Object.assign(No.getDefaults(),{maxDelay:.005,frequency:5,depth:.1,type:"sine"})}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._delayNode.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class ml extends Si{constructor(){super(Rr(ml.getDefaults(),arguments,["type","size"])),this.name="Analyser",this._analysers=[],this._buffers=[];const e=Rr(ml.getDefaults(),arguments,["type","size"]);this.input=this.output=this._gain=new Ti({context:this.context}),this._split=new Wo({context:this.context,channels:e.channels}),this.input.connect(this._split),ir(e.channels,1);for(let t=0;t{const n=this._buffers[t];"fft"===this._type?e.getFloatFrequencyData(n):"waveform"===this._type&&e.getFloatTimeDomainData(n)})),1===this.channels?this._buffers[0]:this._buffers}get size(){return this._analysers[0].frequencyBinCount}set size(e){this._analysers.forEach(((t,n)=>{t.fftSize=2*e,this._buffers[n]=new Float32Array(e)}))}get channels(){return this._analysers.length}get type(){return this._type}set type(e){rr("waveform"===e||"fft"===e,`Analyser: invalid type: ${e}`),this._type=e}get smoothing(){return this._analysers[0].smoothingTimeConstant}set smoothing(e){this._analysers.forEach((t=>t.smoothingTimeConstant=e))}dispose(){return super.dispose(),this._analysers.forEach((e=>e.disconnect())),this._split.dispose(),this._gain.dispose(),this}}class gl extends Si{constructor(){super(Rr(gl.getDefaults(),arguments)),this.name="MeterBase",this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform"})}dispose(){return super.dispose(),this._analyser.dispose(),this}}class yl extends gl{constructor(){super(Rr(yl.getDefaults(),arguments,["smoothing"])),this.name="Meter",this._rms=0;const e=Rr(yl.getDefaults(),arguments,["smoothing"]);this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform",channels:e.channels}),this.smoothing=e.smoothing,this.normalRange=e.normalRange}static getDefaults(){return Object.assign(gl.getDefaults(),{smoothing:.8,normalRange:!1,channels:1})}getLevel(){return cr("'getLevel' has been changed to 'getValue'"),this.getValue()}getValue(){const e=this._analyser.getValue(),t=(1===this.channels?[e]:e).map((e=>{const t=e.reduce(((e,t)=>e+t*t),0),n=Math.sqrt(t/e.length);return this._rms=Math.max(n,this._rms*this.smoothing),this.normalRange?this._rms:oi(this._rms)}));return 1===this.channels?t[0]:t}get channels(){return this._analyser.channels}dispose(){return super.dispose(),this._analyser.dispose(),this}}class bl extends gl{constructor(){super(Rr(bl.getDefaults(),arguments,["size"])),this.name="FFT";const e=Rr(bl.getDefaults(),arguments,["size"]);this.normalRange=e.normalRange,this._analyser.type="fft",this.size=e.size}static getDefaults(){return Object.assign(Si.getDefaults(),{normalRange:!1,size:1024,smoothing:.8})}getValue(){return this._analyser.getValue().map((e=>this.normalRange?ai(e):e))}get size(){return this._analyser.size}set size(e){this._analyser.size=e}get smoothing(){return this._analyser.smoothing}set smoothing(e){this._analyser.smoothing=e}getFrequencyOfIndex(e){return rr(0<=e&&ee._updateSolo()))}get muted(){return 0===this.input.gain.value}_addSolo(){Al._soloed.has(this.context)||Al._soloed.set(this.context,new Set),Al._soloed.get(this.context).add(this)}_removeSolo(){Al._soloed.has(this.context)&&Al._soloed.get(this.context).delete(this)}_isSoloed(){return Al._soloed.has(this.context)&&Al._soloed.get(this.context).has(this)}_noSolos(){return!Al._soloed.has(this.context)||Al._soloed.has(this.context)&&0===Al._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Al._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Al._allSolos=new Map,Al._soloed=new Map;class xl extends Si{constructor(){super(Rr(xl.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=Rr(xl.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Do({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ki({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Si.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Cl extends Si{constructor(){super(Rr(Cl.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=Rr(Cl.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Al({solo:e.solo,context:this.context}),this._panVol=this.output=new xl({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Si.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return Cl.buses.has(e)||Cl.buses.set(e,new Ti({context:this.context})),Cl.buses.get(e)}send(e,t=0){const n=this._getBus(e),s=new Ti({context:this.context,units:"decibels",gain:t});return this.connect(s),s.connect(n),s}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Cl.buses=new Map;class kl extends Si{constructor(){super(Rr(kl.getDefaults(),arguments)),this.name="Mono",this.input=new Ti({context:this.context}),this._merge=this.output=new Go({channels:2,context:this.context}),this.input.connect(this._merge,0,0),this.input.connect(this._merge,0,1)}dispose(){return super.dispose(),this._merge.dispose(),this.input.dispose(),this}}class Sl extends Si{constructor(){super(Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"])),this.name="MultibandSplit",this.input=new Ti({context:this.context}),this.output=void 0,this.low=new Ka({context:this.context,frequency:0,type:"lowpass"}),this._lowMidFilter=new Ka({context:this.context,frequency:0,type:"highpass"}),this.mid=new Ka({context:this.context,frequency:0,type:"lowpass"}),this.high=new Ka({context:this.context,frequency:0,type:"highpass"}),this._internalChannels=[this.low,this.mid,this.high];const e=Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"]);this.lowFrequency=new Ri({context:this.context,units:"frequency",value:e.lowFrequency}),this.highFrequency=new Ri({context:this.context,units:"frequency",value:e.highFrequency}),this.Q=new Ri({context:this.context,units:"positive",value:e.Q}),this.input.fan(this.low,this.high),this.input.chain(this._lowMidFilter,this.mid),this.lowFrequency.fan(this.low.frequency,this._lowMidFilter.frequency),this.highFrequency.fan(this.mid.frequency,this.high.frequency),this.Q.connect(this.low.Q),this.Q.connect(this._lowMidFilter.Q),this.Q.connect(this.mid.Q),this.Q.connect(this.high.Q),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Si.getDefaults(),{Q:1,highFrequency:2500,lowFrequency:400})}dispose(){return super.dispose(),Yr(this,["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this._lowMidFilter.dispose(),this.mid.dispose(),this.high.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this.Q.dispose(),this}}class _l extends Si{constructor(){super(...arguments),this.name="Listener",this.positionX=new ki({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new ki({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new ki({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new ki({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new ki({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new ki({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new ki({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new ki({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new ki({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(Si.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}qr((e=>{e.listener=new _l({context:e})})),Hr((e=>{e.listener.dispose()}));class El extends Si{constructor(){super(Rr(El.getDefaults(),arguments,["positionX","positionY","positionZ"])),this.name="Panner3D";const e=Rr(El.getDefaults(),arguments,["positionX","positionY","positionZ"]);this._panner=this.input=this.output=this.context.createPanner(),this.panningModel=e.panningModel,this.maxDistance=e.maxDistance,this.distanceModel=e.distanceModel,this.coneOuterGain=e.coneOuterGain,this.coneOuterAngle=e.coneOuterAngle,this.coneInnerAngle=e.coneInnerAngle,this.refDistance=e.refDistance,this.rolloffFactor=e.rolloffFactor,this.positionX=new ki({context:this.context,param:this._panner.positionX,value:e.positionX}),this.positionY=new ki({context:this.context,param:this._panner.positionY,value:e.positionY}),this.positionZ=new ki({context:this.context,param:this._panner.positionZ,value:e.positionZ}),this.orientationX=new ki({context:this.context,param:this._panner.orientationX,value:e.orientationX}),this.orientationY=new ki({context:this.context,param:this._panner.orientationY,value:e.orientationY}),this.orientationZ=new ki({context:this.context,param:this._panner.orientationZ,value:e.orientationZ})}static getDefaults(){return Object.assign(Si.getDefaults(),{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:0,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1})}setPosition(e,t,n){return this.positionX.value=e,this.positionY.value=t,this.positionZ.value=n,this}setOrientation(e,t,n){return this.orientationX.value=e,this.orientationY.value=t,this.orientationZ.value=n,this}get panningModel(){return this._panner.panningModel}set panningModel(e){this._panner.panningModel=e}get refDistance(){return this._panner.refDistance}set refDistance(e){this._panner.refDistance=e}get rolloffFactor(){return this._panner.rolloffFactor}set rolloffFactor(e){this._panner.rolloffFactor=e}get distanceModel(){return this._panner.distanceModel}set distanceModel(e){this._panner.distanceModel=e}get coneInnerAngle(){return this._panner.coneInnerAngle}set coneInnerAngle(e){this._panner.coneInnerAngle=e}get coneOuterAngle(){return this._panner.coneOuterAngle}set coneOuterAngle(e){this._panner.coneOuterAngle=e}get coneOuterGain(){return this._panner.coneOuterGain}set coneOuterGain(e){this._panner.coneOuterGain=e}get maxDistance(){return this._panner.maxDistance}set maxDistance(e){this._panner.maxDistance=e}dispose(){return super.dispose(),this._panner.disconnect(),this.orientationX.dispose(),this.orientationY.dispose(),this.orientationZ.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this}}class Il extends Si{constructor(){super(Rr(Il.getDefaults(),arguments)),this.name="Recorder";const e=Rr(Il.getDefaults(),arguments);this.input=new Ti({context:this.context}),rr(Il.supported,"Media Recorder API is not available"),this._stream=this.context.createMediaStreamDestination(),this.input.connect(this._stream),this._recorder=new MediaRecorder(this._stream.stream,{mimeType:e.mimeType})}static getDefaults(){return Si.getDefaults()}get mimeType(){return this._recorder.mimeType}static get supported(){return null!==vr&&Reflect.has(vr,"MediaRecorder")}get state(){return"inactive"===this._recorder.state?"stopped":"paused"===this._recorder.state?"paused":"started"}start(){return Cr(this,void 0,void 0,(function*(){rr("started"!==this.state,"Recorder is already started");const e=new Promise((e=>{const t=()=>{this._recorder.removeEventListener("start",t,!1),e()};this._recorder.addEventListener("start",t,!1)}));return this._recorder.start(),yield e}))}stop(){return Cr(this,void 0,void 0,(function*(){rr("stopped"!==this.state,"Recorder is not started");const e=new Promise((e=>{const t=n=>{this._recorder.removeEventListener("dataavailable",t,!1),e(n.data)};this._recorder.addEventListener("dataavailable",t,!1)}));return this._recorder.stop(),yield e}))}pause(){return rr("started"===this.state,"Recorder must be started"),this._recorder.pause(),this}dispose(){return super.dispose(),this.input.dispose(),this._stream.disconnect(),this}}class Tl extends Si{constructor(){super(Rr(Tl.getDefaults(),arguments,["threshold","ratio"])),this.name="Compressor",this._compressor=this.context.createDynamicsCompressor(),this.input=this._compressor,this.output=this._compressor;const e=Rr(Tl.getDefaults(),arguments,["threshold","ratio"]);this.threshold=new ki({minValue:this._compressor.threshold.minValue,maxValue:this._compressor.threshold.maxValue,context:this.context,convert:!1,param:this._compressor.threshold,units:"decibels",value:e.threshold}),this.attack=new ki({minValue:this._compressor.attack.minValue,maxValue:this._compressor.attack.maxValue,context:this.context,param:this._compressor.attack,units:"time",value:e.attack}),this.release=new ki({minValue:this._compressor.release.minValue,maxValue:this._compressor.release.maxValue,context:this.context,param:this._compressor.release,units:"time",value:e.release}),this.knee=new ki({minValue:this._compressor.knee.minValue,maxValue:this._compressor.knee.maxValue,context:this.context,convert:!1,param:this._compressor.knee,units:"decibels",value:e.knee}),this.ratio=new ki({minValue:this._compressor.ratio.minValue,maxValue:this._compressor.ratio.maxValue,context:this.context,convert:!1,param:this._compressor.ratio,units:"positive",value:e.ratio}),Zr(this,["knee","release","attack","ratio","threshold"])}static getDefaults(){return Object.assign(Si.getDefaults(),{attack:.003,knee:30,ratio:12,release:.25,threshold:-24})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.disconnect(),this.attack.dispose(),this.release.dispose(),this.threshold.dispose(),this.ratio.dispose(),this.knee.dispose(),this}}class Nl extends Si{constructor(){super(Object.assign(Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]))),this.name="Gate";const e=Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]);this._follower=new Fo({context:this.context,smoothing:e.smoothing}),this._gt=new Fa({context:this.context,value:ai(e.threshold)}),this.input=new Ti({context:this.context}),this._gate=this.output=new Ti({context:this.context}),this.input.connect(this._gate),this.input.chain(this._follower,this._gt,this._gate.gain)}static getDefaults(){return Object.assign(Si.getDefaults(),{smoothing:.1,threshold:-40})}get threshold(){return oi(this._gt.value)}set threshold(e){this._gt.value=ai(e)}get smoothing(){return this._follower.smoothing}set smoothing(e){this._follower.smoothing=e}dispose(){return super.dispose(),this.input.dispose(),this._follower.dispose(),this._gt.dispose(),this._gate.dispose(),this}}class Ol extends Si{constructor(){super(Object.assign(Rr(Ol.getDefaults(),arguments,["threshold"]))),this.name="Limiter";const e=Rr(Ol.getDefaults(),arguments,["threshold"]);this._compressor=this.input=this.output=new Tl({context:this.context,ratio:20,attack:.003,release:.01,threshold:e.threshold}),this.threshold=this._compressor.threshold,Zr(this,"threshold")}static getDefaults(){return Object.assign(Si.getDefaults(),{threshold:-12})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.dispose(),this.threshold.dispose(),this}}class Rl extends Si{constructor(){super(Object.assign(Rr(Rl.getDefaults(),arguments))),this.name="MidSideCompressor";const e=Rr(Rl.getDefaults(),arguments);this._midSideSplit=this.input=new ul({context:this.context}),this._midSideMerge=this.output=new cl({context:this.context}),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.side=new Tl(Object.assign(e.side,{context:this.context})),this._midSideSplit.mid.chain(this.mid,this._midSideMerge.mid),this._midSideSplit.side.chain(this.side,this._midSideMerge.side),Zr(this,["mid","side"])}static getDefaults(){return Object.assign(Si.getDefaults(),{mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},side:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10}})}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this}}class Dl extends Si{constructor(){super(Object.assign(Rr(Dl.getDefaults(),arguments))),this.name="MultibandCompressor";const e=Rr(Dl.getDefaults(),arguments);this._splitter=this.input=new Sl({context:this.context,lowFrequency:e.lowFrequency,highFrequency:e.highFrequency}),this.lowFrequency=this._splitter.lowFrequency,this.highFrequency=this._splitter.highFrequency,this.output=new Ti({context:this.context}),this.low=new Tl(Object.assign(e.low,{context:this.context})),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.high=new Tl(Object.assign(e.high,{context:this.context})),this._splitter.low.chain(this.low,this.output),this._splitter.mid.chain(this.mid,this.output),this._splitter.high.chain(this.high,this.output),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Si.getDefaults(),{lowFrequency:250,highFrequency:2e3,low:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10},mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},high:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16}})}dispose(){return super.dispose(),this._splitter.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.output.dispose(),this}}class Ml extends Si{constructor(){super(Rr(Ml.getDefaults(),arguments,["low","mid","high"])),this.name="EQ3",this.output=new Ti({context:this.context}),this._internalChannels=[];const e=Rr(Ml.getDefaults(),arguments,["low","mid","high"]);this.input=this._multibandSplit=new Sl({context:this.context,highFrequency:e.highFrequency,lowFrequency:e.lowFrequency}),this._lowGain=new Ti({context:this.context,gain:e.low,units:"decibels"}),this._midGain=new Ti({context:this.context,gain:e.mid,units:"decibels"}),this._highGain=new Ti({context:this.context,gain:e.high,units:"decibels"}),this.low=this._lowGain.gain,this.mid=this._midGain.gain,this.high=this._highGain.gain,this.Q=this._multibandSplit.Q,this.lowFrequency=this._multibandSplit.lowFrequency,this.highFrequency=this._multibandSplit.highFrequency,this._multibandSplit.low.chain(this._lowGain,this.output),this._multibandSplit.mid.chain(this._midGain,this.output),this._multibandSplit.high.chain(this._highGain,this.output),Zr(this,["low","mid","high","lowFrequency","highFrequency"]),this._internalChannels=[this._multibandSplit]}static getDefaults(){return Object.assign(Si.getDefaults(),{high:0,highFrequency:2500,low:0,lowFrequency:400,mid:0})}dispose(){return super.dispose(),Yr(this,["low","mid","high","lowFrequency","highFrequency"]),this._multibandSplit.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this._lowGain.dispose(),this._midGain.dispose(),this._highGain.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.Q.dispose(),this}}class Fl extends Si{constructor(){super(Rr(Fl.getDefaults(),arguments,["url","onload"])),this.name="Convolver",this._convolver=this.context.createConvolver();const e=Rr(Fl.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr(e.url,(t=>{this.buffer=t,e.onload()})),this.input=new Ti({context:this.context}),this.output=new Ti({context:this.context}),this._buffer.loaded&&(this.buffer=this._buffer),this.normalize=e.normalize,this.input.chain(this._convolver,this.output)}static getDefaults(){return Object.assign(Si.getDefaults(),{normalize:!0,onload:Qr})}load(e){return Cr(this,void 0,void 0,(function*(){this.buffer=yield this._buffer.load(e)}))}get buffer(){return this._buffer.length?this._buffer:null}set buffer(e){e&&this._buffer.set(e),this._convolver.buffer&&(this.input.disconnect(),this._convolver.disconnect(),this._convolver=this.context.createConvolver(),this.input.chain(this._convolver,this.output));const t=this._buffer.get();this._convolver.buffer=t||null}get normalize(){return this._convolver.normalize}set normalize(e){this._convolver.normalize=e}dispose(){return super.dispose(),this._buffer.dispose(),this._convolver.disconnect(),this}}function Bl(){return si().now()}function zl(){return si().immediate()}const Ll=si().transport;function Pl(){return si().transport}const Vl=si().destination,Wl=si().destination;function Gl(){return si().destination}const Ul=si().listener;function ql(){return si().listener}const jl=si().draw;function Hl(){return si().draw}const $l=si();function Kl(){return Jr.loaded()}const Xl=Jr,Zl=Vi,Yl=ta},8990:function(e,t,n){(function(){"use strict";var e;function t(e){var t=0;return function(){return t>>0)+"_",r=0;return function e(s){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(s||"")+"_"+r++,s)}})),i("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i(t=t||0)&&(t=Math.max(t+s,0));ti)s[n++]=i;else{if(2048>i)s[n++]=i>>6|192;else{if(55296<=i&&57343>=i){if(56319>=i&&r=a){i=1024*(i-55296)+a-56320+65536,s[n++]=i>>18|240,s[n++]=i>>12&63|128,s[n++]=i>>6&63|128,s[n++]=63&i|128;continue}r--}if(t)throw Error("Found an unpaired surrogate");i=65533}s[n++]=i>>12|224,s[n++]=i>>6&63|128}s[n++]=63&i|128}}e=s.subarray(0,n)}return e}var D={},M=null;function F(e,t){void 0===t&&(t=0),z(),t=D[t];for(var n=Array(Math.floor(e.length/3)),s=t[64]||"",r=0,i=0;r>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=u+a+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function B(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<6&192|o))}}(e,(function(e){s[r++]=e})),s.subarray(0,r)}function z(){if(!M){M={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));D[n]=s;for(var r=0;rr&&128<=t;r++)n|=(127&(t=e.h[e.g++]))<<7*r;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,s|=(127&t)>>4),128<=t)for(r=0;5>r&&128<=t;r++)s|=(127&(t=e.h[e.g++]))<<7*r+3;if(128>t)return e=n>>>0,(s=2147483648&(t=s>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),s?-e:e;e.m=!0}G.prototype.reset=function(){this.g=this.l},G.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},G.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],s=this.h[this.g+3];return this.g+=4,e=2*((n=(e|t<<8|n<<16|s<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var j=[];function H(){this.g=new Uint8Array(64),this.h=0}function $(e,t){for(;127>>=7;e.push(t)}function K(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,j.length?(n=j.pop(),t&&(n.v=t.v),e&&U(n,e),e=n):e=new G(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function X(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function Z(e){switch(e.h){case 0:if(0!=e.h)Z(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Z(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Z(e);else{var t=e.g.i();(e=e.g).g+=t}break;case 5:5!=e.h?Z(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!X(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Z(e)}break;default:e.j=!0}}function Y(e,t,n){var s=e.g.j,r=e.g.i(),i=e.g.g+r;if(e.g.j=i,n(t,e),0!==(n=i-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.j=s,t}function Q(e){return e.g.o()}function J(e){var t,n=e.g.i(),s=(e=e.g).g;if(e.g+=n,e=e.h,N)(t=I)||(t=I=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(s,s+n));else{n=s+n;for(var r,i,a,o=[],l=null;s(r=e[s++])?o.push(r):224>r?s>=n?o.push(65533):(i=e[s++],194>r||128!=(192&i)?(s--,o.push(65533)):o.push((31&r)<<6|63&i)):240>r?s>=n-1?o.push(65533):128!=(192&(i=e[s++]))||224===r&&160>i||237===r&&160<=i||128!=(192&(t=e[s++]))?(s--,o.push(65533)):o.push((15&r)<<12|(63&i)<<6|63&t):244>=r?s>=n-2?o.push(65533):128!=(192&(i=e[s++]))||i-144+(r<<28)>>30||128!=(192&(t=e[s++]))||128!=(192&(a=e[s++]))?(s--,o.push(65533)):(r=(7&r)<<18|(63&i)<<12|(63&t)<<6|63&a,r-=65536,o.push(55296+(r>>10&1023),56320+(1023&r))):o.push(65533),8192<=o.length&&(l=E(l,o),o.length=0);t=E(l,o)}return t}function ee(e,t,n){var s=e.g.i();for(s=e.g.g+s;e.g.gs?1:0)?-s:s)?0<1/s?W=0:(0,W=2147483648):isNaN(s)?(0,W=2147483647):34028234663852886e22>>0):11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),0,W=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,0,W=(n<<31|t+127<<23|8388607&s)>>>0),n=W,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}H.prototype.push=function(e){if(!(this.h+1=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ye(e,t){var n=void 0!==n&&n,s=ge(e,t,n);return null==s&&(s=fe),s===fe&&Ae(e,t,s=de([]),n),s}function be(e){var t=ye(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n=e.l?(me(e),e.i[t]=n):e.h[t+e.j]=n}function xe(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var s=ge(e,n,!1);s&&(e.g[n]=new t(s))}return e.g[n]}function Ce(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var s=ye(e,1);n=[];for(var r=0;rE;var I=(E=Math.abs(E))>>>0;for(E=Math.floor((E-I)/4294967296),E>>>=0,S&&(E=~E>>>0,4294967295<(I=1+(~I>>>0))&&(I=0,4294967295<++E&&(E=0))),S=W=I,I=E;0>>7|I<<25)>>>0,I>>>=7;_.push(S)}if(Ee(C,k),x=re(x),v.call(w,A,x),y.O)for(w=0;wE;E++)S.push(127&I|128),I>>=7;S.push(1)}ie(_,2,ge(k,2)),null!=(S=ge(k,3))&&(S=R(S),$(_.g,26),$(_.g,S.length),se(_,_.g.end()),se(_,S)),null!=(S=ge(k,4))&&(S=R(S),$(_.g,34),$(_.g,S.length),se(_,_.g.end()),se(_,S)),Ee(k,_),C=re(C),A.call(v,x,C)}}f=f.data;break e;default:f={}}}switch(c=f,h=u.stream,u.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:h,timestamp:s}));break;case"detections":(d=c).stream=h,d.timestamp=s,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return p.i.send(r),b(n,p.C,4);case 4:r.delete(),n.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},_("Solution",nt),_("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var lt={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(ot)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return Ce(Ve(e),ze).map(Xe)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ut=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],ct=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],ht=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],dt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],pt=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ft=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],mt=[].concat(l(ut),l(ct),l(ht),l(dt),l(pt),l(ft));function gt(e){e=e||{},e=Object.assign(Object.assign({},lt),e),this.g=new nt(e)}(e=gt.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Re(this,(function e(){var t=this;return C(e,(function(e){return b(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Re(this,(function t(){var n=this;return C(t,(function(t){return b(t,n.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},_("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),_("FaceMesh",gt),_("FACEMESH_LIPS",ut),_("FACEMESH_LEFT_EYE",ct),_("FACEMESH_LEFT_EYEBROW",ht),_("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),_("FACEMESH_RIGHT_EYE",dt),_("FACEMESH_RIGHT_EYEBROW",pt),_("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),_("FACEMESH_FACE_OVAL",ft),_("FACEMESH_CONTOURS",mt),_("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),_("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),s=e.getPackedDataList(),r=[],i=0;i{e.exports=function e(t,n,s){function r(a,o){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){var n=t[a][1][e];return r(n||e)}),u,u.exports,e,t,n,s)}return n[a].exports}for(var i=void 0,a=0;a=43)}})).catch((function(){return!1}))}function x(e){return"boolean"==typeof m?u.resolve(m):A(e).then((function(e){return m=e}))}function C(e){var t=g[e.name],n={};n.promise=new u((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function k(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new u((function(n,s){if(g[e.name]=g[e.name]||B(),e.db){if(!t)return n(e.db);C(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var i=a.open.apply(a,r);t&&(i.onupgradeneeded=function(t){var n=i.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(e){if("ConstraintError"!==e.name)throw e}}),i.onerror=function(e){e.preventDefault(),s(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},n(t),k(e)}}))}function E(e){return _(e,!1)}function I(e){return _(e,!0)}function T(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),s=e.versione.db.version;if(s&&(e.version,e.version=e.db.version),r||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function N(e){return new u((function(t,n){var s=new FileReader;s.onerror=n,s.onloadend=function(n){var s=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:s,type:e.type})},s.readAsBinaryString(e)}))}function O(e){return l([v(atob(e.data))],{type:e.type})}function R(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return h(n,e,e),n}function M(e){C(e);for(var t=g[e.name],n=t.forages,s=0;s0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),I(e)})).then((function(){return M(e).then((function(){F(e,t,n,s-1)}))})).catch(n);n(r)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function z(e){var t=this,n={db:null};if(e)for(var s in e)n[s]=e[s];var r=g[n.name];r||(r=B(),g[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var i=[];function a(){return u.resolve()}for(var o=0;o>4,c[l++]=(15&s)<<4|r>>2,c[l++]=(3&r)<<6|63&i;return u}function fe(e){var t,n=new Uint8Array(e),s="";for(t=0;t>2],s+=X[(3&n[t])<<4|n[t+1]>>4],s+=X[(15&n[t+1])<<2|n[t+2]>>6],s+=X[63&n[t+2]];return n.length%3==2?s=s.substring(0,s.length-1)+"=":n.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}function me(e,t){var n="";if(e&&(n=de.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===de.call(e.buffer))){var s,r=Q;e instanceof ArrayBuffer?(s=e,r+=ee):(s=e.buffer,"[object Int8Array]"===n?r+=ne:"[object Uint8Array]"===n?r+=se:"[object Uint8ClampedArray]"===n?r+=re:"[object Int16Array]"===n?r+=ie:"[object Uint16Array]"===n?r+=oe:"[object Int32Array]"===n?r+=ae:"[object Uint32Array]"===n?r+=le:"[object Float32Array]"===n?r+=ue:"[object Float64Array]"===n?r+=ce:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(s))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n=Z+e.type+"~"+fe(this.result);t(Q+te+n)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(e){t(null,e)}}function ge(e){if(e.substring(0,J)!==Q)return JSON.parse(e);var t,n=e.substring(he),s=e.substring(J,he);if(s===te&&Y.test(n)){var r=n.match(Y);t=r[1],n=n.substring(r[0].length)}var i=pe(n);switch(s){case ee:return i;case te:return l([i],{type:t});case ne:return new Int8Array(i);case se:return new Uint8Array(i);case re:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case oe:return new Uint16Array(i);case ae:return new Int32Array(i);case le:return new Uint32Array(i);case ue:return new Float32Array(i);case ce:return new Float64Array(i);default:throw new Error("Unkown type: "+s)}}var ye={serialize:me,deserialize:ge,stringToBuffer:pe,bufferToString:fe};function be(e,t,n,s){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,s)}function we(e){var t=this,n={db:null};if(e)for(var s in e)n[s]="string"!=typeof e[s]?e[s].toString():e[s];var r=new u((function(e,s){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return s(e)}n.db.transaction((function(r){be(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){s(t)}))}),s)}));return n.serializer=ye,r}function ve(e,t,n,s,r,i){e.executeSql(n,s,r,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?i(e,a):be(e,t,(function(){e.executeSql(n,s,r,i)}),i)}),i):i(e,a)}),i)}function Ae(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var s=n.rows.length?n.rows.item(0).value:null;s&&(s=r.serializer.deserialize(s)),t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function xe(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName,[],(function(n,s){for(var i=s.rows,a=i.length,o=0;o0)return void i(Ce.apply(r,[e,o,n,s-1]));a(t)}}))}))})).catch(a)}));return c(i,n),i}function ke(e,t,n){return Ce.apply(this,[e,t,n,1])}function Se(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function _e(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"DELETE FROM "+s.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Ee(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT COUNT(key) as c FROM "+s.storeName,[],(function(t,n){var s=n.rows.item(0).c;e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Ie(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var s=n.rows.length?n.rows.item(0).key:null;t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Te(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT key FROM "+s.storeName,[],(function(t,n){for(var s=[],r=0;r '__WebKitDatabaseInfoTable__'",[],(function(n,s){for(var r=[],i=0;i0}function ze(e){var t=this,n={};if(e)for(var s in e)n[s]=e[s];return n.keyPrefix=Me(e,t._defaultConfig),Be()?(t._dbInfo=n,n.serializer=ye,u.resolve()):u.reject()}function Le(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var s=localStorage.key(n);0===s.indexOf(e)&&localStorage.removeItem(s)}}));return c(n,e),n}function Pe(e,t){var n=this;e=d(e);var s=n.ready().then((function(){var t=n._dbInfo,s=localStorage.getItem(t.keyPrefix+e);return s&&(s=t.serializer.deserialize(s)),s}));return c(s,t),s}function Ve(e,t){var n=this,s=n.ready().then((function(){for(var t=n._dbInfo,s=t.keyPrefix,r=s.length,i=localStorage.length,a=1,o=0;o=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):u.reject("Invalid arguments"),c(s,t),s}var $e={_driver:"localStorageWrapper",_initStorage:ze,_support:De(),iterate:Ve,getItem:Pe,setItem:je,removeItem:qe,clear:Le,length:Ue,key:We,keys:Ge,dropInstance:He},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Xe=function(e,t){for(var n=e.length,s=0;s{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function s(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=s;var r={},i={};function a(e,t){var n,s,a;return t?(a=0<=(e>>>=0)&&e<256)&&(s=i[e])?s:(n=l(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=l(e,e<0?-1:0,!1),a&&(r[e]=n),n)}function o(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=p)return x}else{if(e<=-f)return C;if(e+1>=f)return A}return e<0?o(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,s){return new n(e,t,s)}n.fromInt=a,n.fromNumber=o,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return c(e.substring(1),t,n).neg();for(var r=o(u(n,8)),i=g,a=0;a>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},k.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=l).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<=0},k.isOdd=function(){return!(1&~this.low)},k.isEven=function(){return!(1&this.low)},k.equals=function(e){return s(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},k.eq=k.equals,k.notEquals=function(e){return!this.eq(e)},k.neq=k.notEquals,k.ne=k.notEquals,k.lessThan=function(e){return this.comp(e)<0},k.lt=k.lessThan,k.lessThanOrEqual=function(e){return this.comp(e)<=0},k.lte=k.lessThanOrEqual,k.le=k.lessThanOrEqual,k.greaterThan=function(e){return this.comp(e)>0},k.gt=k.greaterThan,k.greaterThanOrEqual=function(e){return this.comp(e)>=0},k.gte=k.greaterThanOrEqual,k.ge=k.greaterThanOrEqual,k.compare=function(e){if(s(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},k.comp=k.compare,k.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(b)},k.neg=k.negate,k.add=function(e){s(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,u=e.low>>>16,c=0,d=0,p=0,f=0;return p+=(f+=i+(65535&e.low))>>>16,d+=(p+=r+u)>>>16,c+=(d+=n+o)>>>16,c+=t+a,l((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},k.subtract=function(e){return s(e)||(e=h(e)),this.add(e.neg())},k.sub=k.subtract,k.multiply=function(e){if(this.isZero())return g;if(s(e)||(e=h(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(C))return e.isOdd()?C:g;if(e.eq(C))return this.isOdd()?C:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,p=65535&e.low,f=0,y=0,b=0,w=0;return b+=(w+=a*p)>>>16,y+=(b+=i*p)>>>16,b&=65535,y+=(b+=a*d)>>>16,f+=(y+=r*p)>>>16,y&=65535,f+=(y+=i*d)>>>16,y&=65535,f+=(y+=a*c)>>>16,f+=n*p+r*d+i*c+a*u,l((b&=65535)<<16|(w&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},k.mul=k.multiply,k.divide=function(e){if(s(e)||(e=h(e)),e.isZero())throw Error("division by zero");var n,r,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return w;i=y}else{if(this.eq(C))return e.eq(b)||e.eq(v)?C:e.eq(C)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:v:(r=this.sub(e.mul(n)),i=n.add(r.div(e)));if(e.eq(C))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),d=o(n),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=o(n-=c,this.unsigned)).mul(e);d.isZero()&&(d=b),i=i.add(d),r=r.sub(p)}return i},k.div=k.divide,k.modulo=function(e){return s(e)||(e=h(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},k.mod=k.modulo,k.rem=k.modulo,k.not=function(){return l(~this.low,~this.high,this.unsigned)},k.and=function(e){return s(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},k.or=function(e){return s(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},k.xor=function(e){return s(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},k.shiftLeft=function(e){return s(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<>>32-e,this.unsigned):l(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},k.shr=k.shiftRight,k.shiftRightUnsigned=function(e){if(s(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},k.shru=k.shiftRightUnsigned,k.shr_u=k.shiftRightUnsigned,k.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},k.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},k.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},k.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},k.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,s){return s?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},9464:function(e,t){var n,s,r;s=[e],n=function(e){"use strict";function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=Object.assign||function(e){for(var t=1;tMath.abs(n[i][a])&&(a=o);for(var l=i;l=i;h--)n[h][c]-=n[h][i]*n[i][c]/n[i][i]}for(var d=s-1;d>=0;d--){for(var p=0,f=d+1;f=0;A--)v+=A>1?y[A]+"x^"+A+" + ":1===A?y[A]+"x + ":y[A];return{string:v,points:w,predict:b,equation:[].concat(s(y)).reverse(),r2:o(i(e,w),t.precision)}}};function u(){var e=function(e,s){return n({_round:o},e,t({},s,(function(e,t){return l[s](e,n({},r,t))})))};return Object.keys(l).reduce(e,{})}e.exports=u()},void 0===(r="function"==typeof n?n.apply(t,s):n)||(e.exports=r)},2183:(e,t,n)=>{var s=n(1812),r=n(6357),i=n(1119),a=n(147),o=n(6297),l=n(9181),u=n(7529);u.alea=s,u.xor128=r,u.xorwow=i,u.xorshift7=a,u.xor4096=o,u.tychei=l,e.exports=u},1812:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n>>0,e=(s*=e)>>>0,e+=4294967296*(s-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function o(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var n=new a(e),s=t&&t.state,r=n.next;return r.int32=function(){return 4294967296*n.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.alea=l}(0,e=n.nmd(e),n.amdD)},9181:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,s=t.d,r=t.a;return e=e<<25^e>>>7^n,n=n-s|0,s=s<<24^s>>>8^r,r=r-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-s|0,t.d=s<<16^n>>>16^r,t.a=r-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.tychei=l}(0,e=n.nmd(e),n.amdD)},6357:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor128=l}(0,e=n.nmd(e),n.amdD)},6297:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this;t.next=function(){var e,n,s=t.w,r=t.X,i=t.i;return t.w=s=s+1640531527|0,n=r[i+34&127],e=r[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[i]=n^e,t.i=i,n+(s^s>>>16)|0},function(e,t){var n,s,r,i,a,o=[],l=128;for(t===(0|t)?(s=t,t=null):(t+="\0",s=0,l=Math.max(l,t.length)),r=0,i=-32;i>>15,s^=s<<4,s^=s>>>13,i>=0&&(a=a+1640531527|0,r=0==(n=o[127&i]^=s+a)?r+1:0);for(r>=128&&(o[127&(t&&t.length||0)]=-1),r=127,i=512;i>0;--i)s=o[r+34&127],n=o[r=r+1&127],s^=s<<13,n^=n<<17,s^=s>>>15,n^=n>>>12,o[r]=s^n;e.w=a,e.X=o,e.i=r}(t,e)}function o(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.X&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor4096=l}(0,e=n.nmd(e),n.amdD)},147:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this;t.next=function(){var e,n,s=t.x,r=t.i;return e=s[r],n=(e^=e>>>7)^e<<24,n^=(e=s[r+1&7])^e>>>10,n^=(e=s[r+3&7])^e>>>3,n^=(e=s[r+4&7])^e<<7,e=s[r+7&7],n^=(e^=e<<13)^e<<9,s[r]=n,t.i=r+1&7,n},function(e,t){var n,s=[];if(t===(0|t))s[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function o(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.x&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorshift7=l}(0,e=n.nmd(e),n.amdD)},1119:function(e,t,n){var s;!function(e,r,i){function a(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var s=0;s>>4),t.next()}function o(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorwow=l}(0,e=n.nmd(e),n.amdD)},7529:function(e,t,n){var s;!function(r,i,a){var o,l=256,u=a.pow(l,6),c=a.pow(2,52),h=2*c,d=l-1;function p(e,t,n){var s=[],d=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(i)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(r.crypto||r.msCrypto).getRandomValues(e)),b(e)}catch(e){var t=r.navigator,n=t&&t.plugins;return[+new Date,r,n,r.screen,b(i)]}}():e,3),s),p=new f(s),w=function(){for(var e=p.g(6),t=u,n=0;e=h;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|p.g(4)},w.quick=function(){return p.g(4)/4294967296},w.double=w,y(b(p.S),i),(t.pass||n||function(e,t,n,s){return s&&(s.S&&m(s,p),e.state=function(){return m(p,{})}),n?(a.random=e,t):e})(w,d,"global"in t?t.global:this==a,t.state)}function f(e){var t,n=e.length,s=this,r=0,i=s.i=s.j=0,a=s.S=[];for(n||(e=[n++]);r{},9830:()=>{},3818:()=>{},6308:()=>{},7695:()=>{},170:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>pZ});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CompositeArrayBuffer:()=>rh,browserFiles:()=>Qd,browserHTTPRequest:()=>op,concatenateArrayBuffers:()=>Ch,copyModel:()=>ld,decodeWeights:()=>fh,decodeWeightsStream:()=>wh,encodeWeights:()=>ph,fromMemory:()=>hp,fromMemorySync:()=>dp,getLoadHandlers:()=>Mh,getModelArtifactsForJSON:()=>Eh,getModelArtifactsForJSONSync:()=>_h,getModelArtifactsInfoForJSON:()=>Ih,getSaveHandlers:()=>Dh,getWeightSpecs:()=>Th,http:()=>ap,isHTTPScheme:()=>rp,listModels:()=>ad,loadWeights:()=>tp,moveModel:()=>ud,registerLoadRouter:()=>Rh,registerSaveRouter:()=>Oh,removeModel:()=>od,weightsLoaderFactory:()=>np,withSaveHandler:()=>pp,withSaveHandlerSync:()=>fp});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{assertParamsValid:()=>kp,computeFlatOffset:()=>zp,computeOutShape:()=>_p,getNormalizedAxes:()=>Np,isSliceContinous:()=>Bp,maskToAxes:()=>Sp,parseSliceParams:()=>Lp,sliceInfo:()=>Pp,startForAxis:()=>Mp,startIndicesWithElidedDims:()=>Op,stopForAxis:()=>Fp,stopIndicesWithElidedDims:()=>Rp,stridesForAxis:()=>Dp,stridesWithElidedDims:()=>Ep});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{conv2d:()=>Jy,depthwiseConv2d:()=>nb,matMul:()=>sb});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{collectGatherOpShapeInfo:()=>fv,computeOutShape:()=>pv,segOpComputeOptimalWindowSize:()=>dv});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{ERF_A1:()=>Nw,ERF_A2:()=>Ow,ERF_A3:()=>Rw,ERF_A4:()=>Dw,ERF_A5:()=>Mw,ERF_P:()=>Tw,PARALLELIZE_THRESHOLD:()=>bw,RowPartitionType:()=>pw,SELU_SCALE:()=>Iw,SELU_SCALEALPHA:()=>Ew,applyActivation:()=>Yy,assertAndGetBroadcastShape:()=>Gd,assertAxesAreInnerMostDims:()=>pm,assertParamsConsistent:()=>hw,assignToTypedArray:()=>Vw,axesAreInnerMostDims:()=>um,calculateShapes:()=>Ey,checkEinsumDimSizes:()=>Xw,checkPadOnDimRoundingMode:()=>ff,combineLocations:()=>cm,combineRaggedTensorToTensorShapes:()=>fw,complexWithEvenIndex:()=>zw,complexWithOddIndex:()=>Lw,computeConv2DInfo:()=>nf,computeConv3DInfo:()=>sf,computeDefaultPad:()=>rf,computeDilation2DInfo:()=>Jp,computeOptimalWindowSize:()=>ww,computeOutAndReduceShapes:()=>hm,computeOutShape:()=>dw,computePool2DInfo:()=>ef,computePool3DInfo:()=>tf,convertConv2DDataFormat:()=>pf,decodeEinsumEquation:()=>$w,eitherStridesOrDilationsAreOne:()=>hf,expandShapeToKeepDim:()=>dm,exponent:()=>Gw,exponents:()=>Ww,fromStringArrayToUint8:()=>gv,fromUint8ToStringArray:()=>mv,getAxesPermutation:()=>fm,getBroadcastDims:()=>Vd,getComplexWithIndex:()=>Pw,getEinsumComputePath:()=>Zw,getEinsumPermutation:()=>Kw,getFusedBiasGradient:()=>Zy,getFusedDyActivation:()=>Xy,getImageCenter:()=>vw,getInnerMostAxes:()=>gm,getPermuted:()=>xw,getRaggedRank:()=>gw,getReductionAxes:()=>Wd,getReshaped:()=>Aw,getReshapedPermuted:()=>Cw,getRowPartitionTypesHelper:()=>mw,getSliceBeginCoords:()=>kw,getSliceSize:()=>Sw,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>ev,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>tv,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>nv,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>iv,getSparseReshapeInputOutputMismatchErrorMessage:()=>ov,getSparseReshapeInputOutputMultipleErrorMessage:()=>av,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>sv,getSparseReshapeNegativeOutputDimErrorMessage:()=>rv,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>hv,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>lv,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>uv,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>cv,getUndoAxesPermutation:()=>mm,isIdentityPermutation:()=>Yw,log:()=>Iu,mergeRealAndImagArrays:()=>Fw,prepareAndValidate:()=>_w,prepareSplitSize:()=>Jw,segment_util:()=>s,shouldFuse:()=>Qy,slice_util:()=>t,splitRealAndImagArrays:()=>Bw,stridesOrDilationsArePositive:()=>df,tupleValuesAreOne:()=>cf,upcastType:()=>Tc,validateDefaultValueShape:()=>yw,validateInput:()=>_y,validateUpdateShape:()=>Sy,warn:()=>Eu});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{json:()=>PE});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{json:()=>VE});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{json:()=>WE});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{json:()=>GE});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{json:()=>UE});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{json:()=>qE});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{json:()=>jE});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{json:()=>HE});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{json:()=>$E});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{json:()=>KE});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{json:()=>XE});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{json:()=>ZE});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{json:()=>YE});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{json:()=>QE});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{json:()=>JE});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{json:()=>eI});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{json:()=>tI});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{json:()=>nI});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{json:()=>sI});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{OP_SCOPE_SUFFIX:()=>Qc,abs:()=>Pd,acos:()=>Wp,acosh:()=>Gp,add:()=>bd,addN:()=>Up,all:()=>qp,any:()=>jp,argMax:()=>Hp,argMin:()=>$p,asin:()=>Kp,asinh:()=>Xp,atan:()=>Zp,atan2:()=>Yp,atanh:()=>Qp,avgPool:()=>gf,avgPool3d:()=>yf,basicLSTMCell:()=>Cf,batchNorm:()=>Sf,batchNorm2d:()=>_f,batchNorm3d:()=>Ef,batchNorm4d:()=>If,batchToSpaceND:()=>kf,bincount:()=>Tf,bitwiseAnd:()=>Nf,booleanMaskAsync:()=>Ly,broadcastArgs:()=>Of,broadcastTo:()=>Rf,buffer:()=>fd,cast:()=>md,ceil:()=>Df,clipByValue:()=>Mf,clone:()=>gd,complex:()=>eh,concat:()=>bf,concat1d:()=>Ff,concat2d:()=>Bf,concat3d:()=>zf,concat4d:()=>Lf,conv1d:()=>Vf,conv2d:()=>Pf,conv2dTranspose:()=>Gf,conv3d:()=>Uf,conv3dTranspose:()=>jf,cos:()=>Hf,cosh:()=>$f,cosineWindow:()=>Hy,cumprod:()=>Kf,cumsum:()=>Xf,denseBincount:()=>Zf,depthToSpace:()=>Yf,depthwiseConv2d:()=>Qf,diag:()=>Jf,dilation2d:()=>em,div:()=>vd,divNoNan:()=>sm,dot:()=>rm,dropout:()=>qy,einsum:()=>im,elu:()=>am,enclosingPowerOfTwo:()=>jy,ensureShape:()=>om,equal:()=>tm,erf:()=>lm,euclideanNorm:()=>xm,exp:()=>Cm,expandDims:()=>km,expm1:()=>Sm,eye:()=>Em,fft:()=>uy,fill:()=>Md,floor:()=>Im,floorDiv:()=>wd,fused:()=>n,gather:()=>Tm,gatherND:()=>Uy,greater:()=>Nm,greaterEqual:()=>Om,ifft:()=>cy,imag:()=>Rm,image:()=>sw,inTopKAsync:()=>$y,irfft:()=>hy,isFinite:()=>Dm,isInf:()=>Mm,isNaN:()=>Fm,leakyRelu:()=>Bm,less:()=>zm,lessEqual:()=>Lm,linalg:()=>rw,linspace:()=>Pm,localResponseNormalization:()=>Vm,log:()=>Wm,log1p:()=>Gm,logSigmoid:()=>jm,logSoftmax:()=>Hm,logSumExp:()=>$m,logicalAnd:()=>Km,logicalNot:()=>Xm,logicalOr:()=>Zm,logicalXor:()=>Ym,losses:()=>iw,lowerBound:()=>eg,matMul:()=>wf,max:()=>ym,maxPool:()=>tg,maxPool3d:()=>ng,maxPoolWithArgmax:()=>sg,maximum:()=>Ud,mean:()=>rg,meshgrid:()=>og,min:()=>bm,minimum:()=>lg,mirrorPad:()=>ug,mod:()=>cg,moments:()=>hg,movingAverage:()=>Vy,mul:()=>Ad,multiRNNCell:()=>dg,multinomial:()=>pg,neg:()=>Um,norm:()=>Am,notEqual:()=>fg,oneHot:()=>mg,ones:()=>ag,onesLike:()=>gg,op:()=>Jc,outerProduct:()=>yg,pad:()=>bg,pad1d:()=>wg,pad2d:()=>vg,pad3d:()=>Ag,pad4d:()=>xg,pool:()=>kg,pow:()=>Bd,prelu:()=>Sg,print:()=>yd,prod:()=>_g,raggedGather:()=>Eg,raggedRange:()=>Ig,raggedTensorToTensor:()=>Tg,rand:()=>Ng,randomGamma:()=>Fg,randomNormal:()=>Bg,randomStandardNormal:()=>zg,randomUniform:()=>Lg,randomUniformInt:()=>Pg,range:()=>Vg,real:()=>Wg,reciprocal:()=>Gg,relu:()=>Ug,relu6:()=>qg,reshape:()=>mf,reverse:()=>jg,reverse1d:()=>Hg,reverse2d:()=>$g,reverse3d:()=>Kg,reverse4d:()=>Xg,rfft:()=>py,round:()=>Zg,rsqrt:()=>Yg,scalar:()=>_d,scatterND:()=>Wy,searchSorted:()=>Jm,selu:()=>Qg,separableConv2d:()=>Jg,setdiff1dAsync:()=>ey,sigmoid:()=>vf,sign:()=>ty,signal:()=>nw,sin:()=>ny,sinh:()=>sy,slice:()=>Af,slice1d:()=>ry,slice2d:()=>iy,slice3d:()=>ay,slice4d:()=>oy,softmax:()=>ly,softplus:()=>qm,spaceToBatchND:()=>Cg,sparse:()=>aw,sparseToDense:()=>Gy,spectral:()=>tw,split:()=>dy,sqrt:()=>xd,square:()=>Cd,squaredDifference:()=>fy,squeeze:()=>my,stack:()=>gy,step:()=>yy,stridedSlice:()=>by,string:()=>ow,sub:()=>zd,sum:()=>wm,tan:()=>wy,tanh:()=>xf,tensor:()=>nh,tensor1d:()=>vy,tensor2d:()=>Ay,tensor3d:()=>mp,tensor4d:()=>xy,tensor5d:()=>Cy,tensor6d:()=>ky,tensorScatterUpdate:()=>Iy,tile:()=>_m,topk:()=>Ty,transpose:()=>Py,truncatedNormal:()=>Ny,unique:()=>Oy,unsortedSegmentSum:()=>Ry,unstack:()=>Dy,upperBound:()=>My,variable:()=>Fy,where:()=>nm,whereAsync:()=>zy,zeros:()=>ig,zerosLike:()=>kd});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{mx:()=>rN,XI:()=>ZN,Nk:()=>YN,f6:()=>JN,ct:()=>JT,YG:()=>sO,hH:()=>uO,z3:()=>$O,sG:()=>rR,uM:()=>uR,vS:()=>_R,qB:()=>MR,GG:()=>BR,lg:()=>WR,rq:()=>LR,cu:()=>eD,WR:()=>YR,GE:()=>sD,px:()=>iD,jC:()=>vD,He:()=>CD,hE:()=>DD,BF:()=>PO,Dk:()=>UD,cl:()=>YD,_B:()=>cM,ub:()=>mM,_f:()=>bM,Ku:()=>kM,qy:()=>_M,Zy:()=>LM,bu:()=>WM,zv:()=>qT,dH:()=>pN,HS:()=>HN,yH:()=>oF,l3:()=>uF,z9:()=>hF,x6:()=>gF,_m:()=>CF,eW:()=>IF,GK:()=>OF,SP:()=>MF,yr:()=>BF,dl:()=>mR,Dw:()=>GF,xT:()=>HF,_X:()=>vN,wz:()=>JF});var _=__webpack_require__(7786),E=__webpack_require__(9043);_.A.prototype._CONST=Object.freeze({N:{VIDEO_W:{DESKTOP:208,MOBILE:144},VIDEO_MARGIN:"10px",GAZE_CALIBRATION:{R:40,MARGIN:32,BORDER:8,CENTER_EXTRA_CHECK_OFFSET:2,MID_EXTRA_CHECK_OFFSET:6},PPI_DONT_USE:127.7,PD_DONT_USE:6.4,VIEW_DIST_DONT_USE:40},S:{AUTO:"AUTO",CLICK_TYPE:{MOUSE:"mouse",TOUCH:"touch"}},COLOR:{LIGHT_GREY:"#cccccc",ORANGE:"#ff9a00",DARK_RED:"#ac0d0d",RED:"#ee0000"},LTR:"LTR",RTL:"RTL",VIEW_METHOD:{B:"BlindSpot",F:"FaceMesh"},IN_TO_CM:2.54,UNITS:{CM:"cm",IN_D:"inDecimal",IN_F:"inFractional"}}),_.A.prototype._debuggerDefault=Object.freeze({date:new Date("July 20, 69 20:17:40 GMT+00:00"),timestamp:performance.now(),screenSize:{value:{screenWidthCm:28.6,screenHeightCm:17.9,screenPhysicalPpi:250,screenPpi:125,screenDiagonalCm:33.8,screenDiagonalIn:13.3}},measureDistance:{value:40,method:"BlindSpot"},trackDistance:{value:{viewingDistanceCm:40,PDCm:6.4,nearPointCm:{x:0,y:0},latencyMs:50},method:"FaceMesh"},trackGaze:{value:{x:screen.width/2,y:screen.height/2,latencyMs:50}},performance:{value:{computeArrayFillMHz:(0,E.Nh)(.5,3),computeRandomMHz:(0,E.Nh)(5,3),idealFps:60,stressFps:60}}});var I=__webpack_require__(115),T=__webpack_require__.n(I),N=__webpack_require__(3389),O=__webpack_require__.n(N),R=__webpack_require__(402),D=__webpack_require__.n(R),M=__webpack_require__(880),F=__webpack_require__.n(M),B=__webpack_require__(3282),z=__webpack_require__.n(B);const L=(e,t)=>{e.style.top=`${Math.round(t.querySelector(".calibration-instruction").getBoundingClientRect().bottom)+25}px`},P=e=>{const t=e.value/e.max;e.style.background=`linear-gradient(90deg, #ffc772, #ffc772 ${100*t}%, #fff ${100*t}%)`};var V=__webpack_require__(9853),W=__webpack_require__(359),G=__webpack_require__(9199);_.A.prototype._displaySize=function(){if(!this.checkInitialized())return;const e={value:{displayWidthPx:screen.width,displayHeightPx:screen.height,windowWidthPx:window.innerWidth,windowHeightPx:window.innerHeight},timestamp:performance.now()};this.displayData.length&&T()(e.value,this.displayData[this.displayData.length-1].value)||(this.newDisplayData=e)};const U={card:O(),arrow:D(),usba:F(),usbc:z()},q={card:3.375,usba:.787402,usbc:.787402};_.A.prototype.screenSize=function(e={},t=void 0){if(!this.checkInitialized())return;(0,E.$k)();const n=Object.assign({fullscreen:!1,repeatTesting:1,decimalPlace:1,defaultObject:"card",headline:`🖥️ ${G.H.RC_screenSizeTitle[this.L]}`,description:G.H.RC_screenSizeIntro[this.L],check:!1,checkCallback:null},e);this.getFullscreen(n.fullscreen),["usba","usbc","card"].includes(n.defaultObject)||(n.defaultObject="card"),n.description+=`

        ${G.H.RC_screenSizeHave[this.L].replace("xxx",``)}`,this._addBackground(),this._addBackgroundText(n.headline,n.description),this._addCreditOnBackground(G.H.RC_screenSizeCredit[this.L]),function(e,t,n,s){const r=((e,t,n)=>{const s=document.createElement("input");return s.id="rc-size-slider",s.className="rc-slider",s.type="range",s.min=t,s.max=n,s.value=Math.max(Math.min(Math.round(100*Math.random()),80),20),s.step=.1,L(s,e),P(s),e.appendChild(s),s})(t,0,100),i=(t,n)=>{if("rc-slider"===t.target.className&&"rc-size-slider"===t.target.id&&(n===e._CONST.S.CLICK_TYPE.MOUSE&&1===t.which||n===e._CONST.S.CLICK_TYPE.TOUCH)){t.target.style.cursor="grabbing",c.setAttribute("fill",e._CONST.COLOR.ORANGE);const s=()=>{r.style.cursor="grab",c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY),document.removeEventListener("mouseup",s,!1)};n===e._CONST.S.CLICK_TYPE.MOUSE?document.addEventListener("mouseup",s,!1):n===e._CONST.S.CLICK_TYPE.TOUCH&&document.addEventListener("touchend",s,!1)}},a=e=>{i(e,"mouse")},o=e=>{i(e,"touch")};document.addEventListener("mousedown",a,!1),document.addEventListener("touchstart",o,!1);const l=$(["card","arrow","usba","usbc"],t);let u=n.defaultObject;document.getElementById("matching-obj").addEventListener("change",(e=>{K(e.target.value,l,d),u=e.target.value})),K("card",l);const c=document.getElementById("size-arrow-fill");c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY);const h={width:l.arrow.getBoundingClientRect().width,height:l.arrow.getBoundingClientRect().height},d=()=>{j(e,r,l.card,l.arrow,h),H(r,l.usba),H(r,l.usbc)};d();const p=()=>{P(r),d()},f=new ResizeObserver((()=>{d(),L(r,t),Z(l,r)}));f.observe(t);const m=()=>{document.removeEventListener("mousedown",a,!1),document.removeEventListener("touchstart",o,!1),document.removeEventListener("input",p,!1),f.unobserve(t),e._removeBackground(),(0,V.l)(y)},g=()=>{const t=(l[u].getBoundingClientRect().width||Number.parseInt(l[u].style.width))/q[u],r=n.decimalPlace,i=X(t,r);e.newScreenData=i,m(),n.check?e._checkScreenSize(s,i,n.checkCallback):(0,E.nB)(s,i)};r.addEventListener("input",p,!1);const y=(0,V.m)({Escape:m,Enter:g," ":g});(0,W.F)(e.L,e.background,{go:g,cancel:m},e.params.showCancelButton),K(u,l,d)}(this,this.background,n,t)};const j=(e,t,n,s,r)=>{const i=(t.offsetWidth-30)*(t.value/100)*(window.innerWidth<480?2:1)+15;n.style.width=`${i}px`;const a=n.getBoundingClientRect();0!==a.width&&(s.style.left=`${a.left+i}px`,s.style.top=`${a.top+e.background.scrollTop+(.63*i-r.height)/2}px`)},H=(e,t)=>{t.style.width=`${(0,E.Ew)(e.value**1.5,0,1e3,50,400)}px`},$=(e,t)=>{const n=document.getElementsByClassName("size-obj");for(;n.length;)n[0].parentNode.removeChild(n[0]);const s={};for(const n of e){let e=document.createElement("div");t.appendChild(e),e.outerHTML=U[n],e=document.getElementById(`size-${n}`),e.setAttribute("preserveAspectRatio","none"),e.style.visibility="hidden",s[n]=e}return Z(s,document.querySelector("#rc-size-slider")),s},K=(e,t,n)=>{for(const n in t)t[n].style.visibility=n===e?"visible":"hidden";t.arrow.style.visibility="hidden",(0,E.nB)(n)},X=(e,t)=>{const n={value:{screenWidthCm:(0,E.Nh)(2.54*window.screen.width/e,t),screenHeightCm:(0,E.Nh)(2.54*window.screen.height/e,t),screenPhysicalPpi:(0,E.Nh)(e*window.devicePixelRatio,t),screenPpi:(0,E.Nh)(e,t)},timestamp:performance.now()};return n.value.screenDiagonalCm=(0,E.Nh)(Math.hypot(n.value.screenWidthCm,n.value.screenHeightCm),t),n.value.screenDiagonalIn=(0,E.Nh)(n.value.screenDiagonalCm/2.54,t),n},Z=(e,t)=>{for(const n in e)e[n].style.top=`${t.getBoundingClientRect().top+50}px`};function Y(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function Q(e,t){return e.get(Y(e,t))}function J(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}const ee={},te=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;ee.restoreFocusTimeout=setTimeout((()=>{ee.previousActiveElement instanceof HTMLElement?(ee.previousActiveElement.focus(),ee.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),window.scrollTo(n,s)})),ne="swal2-",se=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=ne+t,e)),{}),re=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=ne+t,e)),{}),ie=e=>e.charAt(0).toUpperCase()+e.slice(1),ae=e=>{},oe=[],le=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n;n=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,oe.includes(n)||(oe.push(n),ae(n))},ue=e=>"function"==typeof e?e():e,ce=e=>e&&"function"==typeof e.toPromise,he=e=>ce(e)?e.toPromise():Promise.resolve(e),de=e=>e&&Promise.resolve(e)===e,pe=()=>document.body.querySelector(`.${se.container}`),fe=e=>{const t=pe();return t?t.querySelector(e):null},me=e=>fe(`.${e}`),ge=()=>me(se.popup),ye=()=>me(se.icon),be=()=>me(se.title),we=()=>me(se["html-container"]),ve=()=>me(se.image),Ae=()=>me(se["progress-steps"]),xe=()=>me(se["validation-message"]),Ce=()=>fe(`.${se.actions} .${se.confirm}`),ke=()=>fe(`.${se.actions} .${se.cancel}`),Se=()=>fe(`.${se.actions} .${se.deny}`),_e=()=>fe(`.${se.loader}`),Ee=()=>me(se.actions),Ie=()=>me(se.footer),Te=()=>me(se["timer-progress-bar"]),Ne=()=>me(se.close),Oe=()=>{const e=ge();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>Xe(e)))},Re=()=>Fe(document.body,se.shown)&&!Fe(document.body,se["toast-shown"])&&!Fe(document.body,se["no-backdrop"]),De=()=>{const e=ge();return!!e&&Fe(e,se.toast)},Me=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},Fe=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(se).includes(n)||Object.values(re).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))})(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?Ve(e,s):ae(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},ze=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${se.popup} > .${se[t]}`);case"checkbox":return e.querySelector(`.${se.popup} > .${se.checkbox} input`);case"radio":return e.querySelector(`.${se.popup} > .${se.radio} input:checked`)||e.querySelector(`.${se.popup} > .${se.radio} input:first-child`);case"range":return e.querySelector(`.${se.popup} > .${se.range} input`);default:return e.querySelector(`.${se.popup} > .${se.input}`)}},Le=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},Pe=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Ve=(e,t)=>{Pe(e,t,!0)},We=(e,t)=>{Pe(e,t,!1)},Ge=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},qe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},je=e=>{e&&(e.style.display="none")},He=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{Ke(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},$e=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},Ke=function(e,t){t?qe(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):je(e)},Xe=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),Ze=e=>!!(e.scrollHeight>e.clientHeight),Ye=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},Qe=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Te();n&&Xe(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},Je=()=>"undefined"==typeof window||"undefined"==typeof document,et=`\n
        \n \n
          \n
          \n \n

          \n
          \n \n \n
          \n \n \n
          \n \n
          \n \n \n
          \n
          \n
          \n \n \n \n
          \n
          \n
          \n
          \n
          \n
          \n`.replace(/(^|\n)\s*/g,""),tt=()=>{ee.currentInstance.resetValidationMessage()},nt=e=>{const t=(()=>{const e=pe();return!!e&&(e.remove(),We([document.documentElement,document.body],[se["no-backdrop"],se["toast-shown"],se["has-column"]]),!0)})();if(Je())return;const n=document.createElement("div");n.className=se.container,t&&Ve(n,se["no-transition"]),Me(n,et);const s="string"==typeof(r=e.target)?document.querySelector(r):r;var r;s.appendChild(n),(e=>{const t=ge();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&Ve(pe(),se.rtl)})(s),(()=>{const e=ge(),t=Ge(e,se.input),n=Ge(e,se.file),s=e.querySelector(`.${se.range} input`),r=e.querySelector(`.${se.range} output`),i=Ge(e,se.select),a=e.querySelector(`.${se.checkbox} input`),o=Ge(e,se.textarea);t.oninput=tt,n.onchange=tt,i.onchange=tt,a.onchange=tt,o.oninput=tt,s.oninput=()=>{tt(),r.value=s.value},s.onchange=()=>{tt(),r.value=s.value}})()},st=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?rt(e,t):e&&Me(t,e)},rt=(e,t)=>{e.jquery?it(t,e):Me(t,e.toString())},it=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},at=(()=>{if(Je())return!1;const e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"})(),ot=(e,t)=>{const n=Ee(),s=_e();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?qe(n):je(n),Be(n,t,"actions"),function(e,t,n){const s=Ce(),r=Se(),i=ke();if(!s||!r||!i)return;lt(s,"confirm",n),lt(r,"deny",n),lt(i,"cancel",n),function(e,t,n,s){if(!s.buttonsStyling)return void We([e,t,n],se.styled);Ve([e,t,n],se.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ve(e,se["default-outline"]));s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ve(t,se["default-outline"]));s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,Ve(n,se["default-outline"]))}(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t)))}(n,s,t),Me(s,t.loaderHtml||""),Be(s,t,"loader"))};function lt(e,t,n){const s=ie(t);Ke(e,n[`show${s}Button`],"inline-block"),Me(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=se[t],Be(e,n,`${t}Button`)}const ut=(e,t)=>{const n=pe();n&&(!function(e,t){"string"==typeof t?e.style.background=t:t||Ve([document.documentElement,document.body],se["no-backdrop"])}(n,t.backdrop),function(e,t){if(!t)return;t in se?Ve(e,se[t]):(ae('The "position" parameter is not valid, defaulting to "center"'),Ve(e,se.center))}(n,t.position),function(e,t){if(!t)return;Ve(e,se[`grow-${t}`])}(n,t.grow),Be(n,t,"container"))};var ct={innerParams:new WeakMap,domCache:new WeakMap};const ht=["input","file","range","select","radio","checkbox","textarea"],dt=e=>{if(!e.input)return;if(!wt[e.input])return Object.keys(wt).join(" | "),void e.input;const t=yt(e.input);if(!t)return;const n=wt[e.input](t,e);qe(t),e.inputAutoFocus&&setTimeout((()=>{Le(n)}))},pt=(e,t)=>{const n=ge();if(!n)return;const s=ze(n,e);if(s){(e=>{for(let t=0;t{if(!e.input)return;const t=yt(e.input);t&&Be(t,e,"input")},mt=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},gt=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=se["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&Ve(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},yt=e=>{const t=ge();if(t)return Ge(t,se[e]||se.input)},bt=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:de(t)||ae(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},wt={};wt.text=wt.email=wt.password=wt.number=wt.tel=wt.url=wt.search=wt.date=wt["datetime-local"]=wt.time=wt.week=wt.month=(e,t)=>(bt(e,t.inputValue),gt(e,e,t),mt(e,t),e.type=t.input,e),wt.file=(e,t)=>(gt(e,e,t),mt(e,t),e),wt.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return bt(n,t.inputValue),n.type=t.input,bt(s,t.inputValue),gt(n,e,t),e},wt.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");Me(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return gt(e,e,t),e},wt.radio=e=>(e.textContent="",e),wt.checkbox=(e,t)=>{const n=ze(ge(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return Me(s,t.inputPlaceholder||t.inputLabel),n},wt.textarea=(e,t)=>{bt(e,t.inputValue),mt(e,t),gt(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(ge()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const s=e.offsetWidth+(r=e,parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight));var r;s>n?ge().style.width=`${s}px`:Ue(ge(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const vt=(e,t)=>{const n=we();n&&(He(n),Be(n,t,"htmlContainer"),t.html?(st(t.html,n),qe(n,"block")):t.text?(n.textContent=t.text,qe(n,"block")):je(n),((e,t)=>{const n=ge();if(!n)return;const s=ct.innerParams.get(e),r=!s||t.input!==s.input;ht.forEach((e=>{const s=Ge(n,se[e]);s&&(pt(e,t.inputAttributes),s.className=se[e],r&&je(s))})),t.input&&(r&&dt(t),ft(t))})(e,t))},At=(e,t)=>{for(const[n,s]of Object.entries(re))t.icon!==n&&We(e,s);Ve(e,t.icon&&re[t.icon]),kt(e,t),xt(),Be(e,t,"icon")},xt=()=>{const e=ge();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";if(t.iconHtml)s=St(t.iconHtml);else if("success"===t.icon)s='\n
          \n \n
          \n
          \n',n=n.replace(/ style=".*?"/g,"");else if("error"===t.icon)s='\n \n \n \n \n';else if(t.icon){s=St({question:"?",warning:"!",info:"i"}[t.icon])}n.trim()!==s.trim()&&Me(e,s)},kt=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])$e(e,n,"background-color",t.iconColor);$e(e,".swal2-success-ring","border-color",t.iconColor)}},St=e=>`
          ${e}
          `,_t=(e,t)=>{const n=t.showClass||{};e.className=`${se.popup} ${Xe(e)?n.popup:""}`,t.toast?(Ve([document.documentElement,document.body],se["toast-shown"]),Ve(e,se.toast)):Ve(e,se.modal),Be(e,t,"popup"),"string"==typeof t.customClass&&Ve(e,t.customClass),t.icon&&Ve(e,se[`icon-${t.icon}`])},Et=e=>{const t=document.createElement("li");return Ve(t,se["progress-step"]),Me(t,e),t},It=e=>{const t=document.createElement("li");return Ve(t,se["progress-step-line"]),e.progressStepsDistance&&Ue(t,"width",e.progressStepsDistance),t},Tt=(e,t)=>{((e,t)=>{const n=pe(),s=ge();if(n&&s){if(t.toast){Ue(n,"width",t.width),s.style.width="100%";const e=_e();e&&s.insertBefore(e,ye())}else Ue(s,"width",t.width);Ue(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),je(xe()),_t(s,t)}})(0,t),ut(0,t),((e,t)=>{const n=Ae();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(qe(n),n.textContent="",r>=s.length&&ae("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach(((e,i)=>{const a=Et(e);if(n.appendChild(a),i===r&&Ve(a,se["active-progress-step"]),i!==s.length-1){const e=It(t);n.appendChild(e)}}))):je(n)})(0,t),((e,t)=>{const n=ct.innerParams.get(e),s=ye();if(s){if(n&&t.icon===n.icon)return Ct(s,t),void At(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(re).indexOf(t.icon))return t.icon,void je(s);qe(s),Ct(s,t),At(s,t),Ve(s,t.showClass&&t.showClass.icon)}else je(s)}})(e,t),((e,t)=>{const n=ve();n&&(t.imageUrl?(qe(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),Ue(n,"width",t.imageWidth),Ue(n,"height",t.imageHeight),n.className=se.image,Be(n,t,"image")):je(n))})(0,t),((e,t)=>{const n=be();n&&(He(n),Ke(n,t.title||t.titleText,"block"),t.title&&st(t.title,n),t.titleText&&(n.innerText=t.titleText),Be(n,t,"title"))})(0,t),((e,t)=>{const n=Ne();n&&(Me(n,t.closeButtonHtml||""),Be(n,t,"closeButton"),Ke(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),vt(e,t),ot(0,t),((e,t)=>{const n=Ie();n&&(He(n),Ke(n,t.footer,"block"),t.footer&&st(t.footer,n),Be(n,t,"footer"))})(0,t);const n=ge();"function"==typeof t.didRender&&n&&t.didRender(n),ee.eventEmitter.emit("didRender",n)},Nt=()=>{var e;return null===(e=Ce())||void 0===e?void 0:e.click()},Ot=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Rt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Dt=(e,t)=>{var n;const s=Oe();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=ge())||void 0===n||n.focus()},Mt=["ArrowRight","ArrowDown"],Ft=["ArrowLeft","ArrowUp"],Bt=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?zt(t,e):"Tab"===t.key?Lt(t):[...Mt,...Ft].includes(t.key)?Pt(t.key):"Escape"===t.key&&Vt(t,e,n)))},zt=(e,t)=>{if(!ue(t.allowEnterKey))return;const n=ze(ge(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Nt(),e.preventDefault()}},Lt=e=>{const t=e.target,n=Oe();let s=-1;for(let e=0;e{const t=Ee(),n=Ce(),s=Se(),r=ke();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=Mt.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{ue(t.allowEscapeKey)&&(e.preventDefault(),n(Ot.esc))};var Wt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Gt=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Ut="undefined"!=typeof window&&!!window.GestureEvent,qt=()=>{const e=pe();if(!e)return;let t;e.ontouchstart=e=>{t=jt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},jt=e=>{const t=e.target,n=pe(),s=we();return!(!n||!s)&&(!Ht(e)&&!$t(e)&&(t===n||!Ze(n)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!Ze(s)||!s.contains(t))))},Ht=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,$t=e=>e.touches&&e.touches.length>1;let Kt=null;const Xt=e=>{null===Kt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Kt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Kt+(()=>{const e=document.createElement("div");e.className=se["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function Zt(e,t,n,s){De()?rn(e,s):(te(n).then((()=>rn(e,s))),Rt(ee)),Ut?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),Re()&&(null!==Kt&&(document.body.style.paddingRight=`${Kt}px`,Kt=null),(()=>{if(Fe(document.body,se.iosfix)){const e=parseInt(document.body.style.top,10);We(document.body,se.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Gt()),We([document.documentElement,document.body],[se.shown,se["height-auto"],se["no-backdrop"],se["toast-shown"]])}function Yt(e){e=tn(e);const t=Wt.swalPromiseResolve.get(this),n=Qt(this);this.isAwaitingPromise?e.isDismissed||(en(this),t(e)):n&&t(e)}const Qt=e=>{const t=ge();if(!t)return!1;const n=ct.innerParams.get(e);if(!n||Fe(t,n.hideClass.popup))return!1;We(t,n.showClass.popup),Ve(t,n.hideClass.popup);const s=pe();return We(s,n.showClass.backdrop),Ve(s,n.hideClass.backdrop),nn(e,t,n),!0};function Jt(e){const t=Wt.swalPromiseReject.get(this);en(this),t&&t(e)}const en=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,ct.innerParams.get(e)||e._destroy())},tn=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),nn=(e,t,n)=>{const s=pe(),r=at&&Ye(t);"function"==typeof n.willClose&&n.willClose(t),ee.eventEmitter.emit("willClose",t),r?sn(e,t,s,n.returnFocus,n.didClose):Zt(e,s,n.returnFocus,n.didClose)},sn=(e,t,n,s,r)=>{at&&(ee.swalCloseEventFinishedCallback=Zt.bind(null,e,n,s,r),t.addEventListener(at,(function(e){e.target===t&&(ee.swalCloseEventFinishedCallback(),delete ee.swalCloseEventFinishedCallback)})))},rn=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),ee.eventEmitter.emit("didClose"),e._destroy&&e._destroy()}))},an=e=>{let t=ge();if(t||new zs,t=ge(),!t)return;const n=_e();De()?je(ye()):on(t,e),qe(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},on=(e,t)=>{const n=Ee(),s=_e();n&&s&&(!t&&Xe(Ce())&&(t=Ce()),qe(n),t&&(je(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),Ve([e,n],se.loading))},ln=e=>e.checked?1:0,un=e=>e.checked?e.value:null,cn=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,hn=(e,t)=>{const n=ge();if(!n)return;const s=e=>{"select"===t.input?function(e,t,n){const s=Ge(e,se.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,Me(r,t),r.selected=fn(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}(n,pn(e),t):"radio"===t.input&&function(e,t,n){const s=Ge(e,se.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=se.radio,i.value=t,fn(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");Me(o,r),o.className=se.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}(n,pn(e),t)};ce(t.inputOptions)||de(t.inputOptions)?(an(Ce()),he(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):t.inputOptions},dn=(e,t)=>{const n=e.getInput();n&&(je(n),he(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,qe(n),n.focus(),e.hideLoading()})).catch((t=>{n.value="",qe(n),n.focus(),e.hideLoading()})))};const pn=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=pn(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=pn(s)),t.push([n,s])})),t},fn=(e,t)=>!!t&&t.toString()===e.toString(),mn=(e,t)=>{const n=ct.innerParams.get(e);if(!n.input)return void ie(t);const s=e.getInput(),r=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return ln(n);case"radio":return un(n);case"file":return cn(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,n);n.inputValidator?gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?yn(e,r):vn(e,r)},gn=(e,t,n)=>{const s=ct.innerParams.get(e);e.disableInput();Promise.resolve().then((()=>he(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?yn(e,t):vn(e,t)}))},yn=(e,t)=>{const n=ct.innerParams.get(e||void 0);if(n.showLoaderOnDeny&&an(Se()),n.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then((()=>he(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),en(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>wn(e||void 0,t)))}else e.close({isDenied:!0,value:t})},bn=(e,t)=>{e.close({isConfirmed:!0,value:t})},wn=(e,t)=>{e.rejectPromise(t)},vn=(e,t)=>{const n=ct.innerParams.get(e||void 0);if(n.showLoaderOnConfirm&&an(),n.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then((()=>he(n.preConfirm(t,n.validationMessage)))).then((n=>{Xe(xe())||!1===n?(e.hideLoading(),en(e)):bn(e,void 0===n?t:n)})).catch((t=>wn(e||void 0,t)))}else bn(e,t)};function An(){const e=ct.innerParams.get(this);if(!e)return;const t=ct.domCache.get(this);je(t.loader),De()?e.icon&&qe(ye()):xn(t),We([t.popup,t.actions],se.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const xn=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?qe(t[0],"inline-block"):Xe(Ce())||Xe(Se())||Xe(ke())||je(e.actions)};function Cn(){const e=ct.innerParams.get(this),t=ct.domCache.get(this);return t?ze(t.popup,e.input):null}function kn(e,t,n){const s=ct.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function Sn(e,t){const n=ge();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${se.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(Rn,e),zn=e=>-1!==Dn.indexOf(e),Ln=e=>Mn[e],Pn=e=>{Bn(e)||ae(`Unknown parameter "${e}"`)},Vn=e=>{Fn.includes(e)&&ae(`The parameter "${e}" is incompatible with toasts`)},Wn=e=>{const t=Ln(e);t&&le(e,t)};function Gn(e){const t=ge(),n=ct.innerParams.get(this);if(!t||Fe(t,n.hideClass.popup))return void ae("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=Un(e),r=Object.assign({},n,s);Tt(this,r),ct.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Un=e=>{const t={};return Object.keys(e).forEach((n=>{zn(n)?t[n]=e[n]:ae(`Invalid parameter to update: ${n}`)})),t};function qn(){const e=ct.domCache.get(this),t=ct.innerParams.get(this);t?(e.popup&&ee.swalCloseEventFinishedCallback&&(ee.swalCloseEventFinishedCallback(),delete ee.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),ee.eventEmitter.emit("didDestroy"),jn(this)):Hn(this)}const jn=e=>{Hn(e),delete e.params,delete ee.keydownHandler,delete ee.keydownTarget,delete ee.currentInstance},Hn=e=>{e.isAwaitingPromise?($n(ct,e),e.isAwaitingPromise=!0):($n(Wt,e),$n(ct,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},$n=(e,t)=>{for(const n in e)e[n].delete(t)};var Kn=Object.freeze({__proto__:null,_destroy:qn,close:Yt,closeModal:Yt,closePopup:Yt,closeToast:Yt,disableButtons:En,disableInput:Tn,disableLoading:An,enableButtons:_n,enableInput:In,getInput:Cn,handleAwaitingPromise:en,hideLoading:An,rejectPromise:Jt,resetValidationMessage:On,showValidationMessage:Nn,update:Gn});const Xn=(e,t,n)=>{t.popup.onclick=()=>{e&&(Zn(e)||e.timer||e.input)||n(Ot.close)}},Zn=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Yn=!1;const Qn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Yn=!0)}}},Jn=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Yn=!0)}}},es=(e,t,n)=>{t.container.onclick=s=>{Yn?Yn=!1:s.target===t.container&&ue(e.allowOutsideClick)&&n(Ot.backdrop)}},ts=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const ns=()=>{if(ee.timeout)return(()=>{const e=Te();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),ee.timeout.stop()},ss=()=>{if(ee.timeout){const e=ee.timeout.start();return Qe(e),e}};let rs=!1;const is={};const as=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in is){const n=t.getAttribute(e);if(n)return void is[e].fire({template:n})}};ee.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var os=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||ts(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];("string"==typeof r||ts(r))&&(t[n]=r)})):Object.assign(t,e[0]),t},bindClickHandler:function(){is[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,rs||(document.body.addEventListener("click",as),rs=!0)},clickCancel:()=>{var e;return null===(e=ke())||void 0===e?void 0:e.click()},clickConfirm:Nt,clickDeny:()=>{var e;return null===(e=Se())||void 0===e?void 0:e.click()},enableLoading:an,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;nme(se["icon-content"]),getImage:ve,getInputLabel:()=>me(se["input-label"]),getLoader:_e,getPopup:ge,getProgressSteps:Ae,getTimerLeft:()=>ee.timeout&&ee.timeout.getTimerLeft(),getTimerProgressBar:Te,getTitle:be,getValidationMessage:xe,increaseTimer:e=>{if(ee.timeout){const t=ee.timeout.increase(e);return Qe(t,!0),t}},isDeprecatedParameter:Ln,isLoading:()=>{const e=ge();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!ee.timeout||!ee.timeout.isRunning()),isUpdatableParameter:zn,isValidParameter:Bn,isVisible:()=>Xe(ge()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},off:(e,t)=>{e?t?ee.eventEmitter.removeListener(e,t):ee.eventEmitter.removeAllListeners(e):ee.eventEmitter.reset()},on:(e,t)=>{ee.eventEmitter.on(e,t)},once:(e,t)=>{ee.eventEmitter.once(e,t)},resumeTimer:ss,showLoading:an,stopTimer:ns,toggleTimer:()=>{const e=ee.timeout;return e&&(e.running?ns():ss())}});class ls{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const us=["swal-title","swal-html","swal-footer"],cs=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{bs(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]="boolean"==typeof Rn[n]?"false"!==s:"object"==typeof Rn[n]?JSON.parse(s):s)})),t},hs=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},ds=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{bs(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${ie(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},ps=e=>{const t={},n=e.querySelector("swal-image");return n&&(bs(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},fs=e=>{const t={},n=e.querySelector("swal-icon");return n&&(bs(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},ms=e=>{const t={},n=e.querySelector("swal-input");n&&(bs(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{bs(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},gs=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(bs(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},ys=e=>{const t=us.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||ae(`Unrecognized element <${n}>`)}))},bs=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&ae([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))},ws=e=>{const t=pe(),n=ge();"function"==typeof e.willOpen&&e.willOpen(n),ee.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;Cs(t,n,e),setTimeout((()=>{As(t,n)}),10),Re()&&(xs(t,e.scrollbarPadding,s),(()=>{const e=pe();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))})()),De()||ee.previousActiveElement||(ee.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),ee.eventEmitter.emit("didOpen",n),We(t,se["no-transition"])},vs=e=>{const t=ge();if(e.target!==t||!at)return;const n=pe();t.removeEventListener(at,vs),n.style.overflowY="auto"},As=(e,t)=>{at&&Ye(t)?(e.style.overflowY="hidden",t.addEventListener(at,vs)):e.style.overflowY="auto"},xs=(e,t,n)=>{(()=>{if(Ut&&!Fe(document.body,se.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",Ve(document.body,se.iosfix),qt()}})(),t&&"hidden"!==n&&Xt(n),setTimeout((()=>{e.scrollTop=0}))},Cs=(e,t,n)=>{Ve(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),qe(t,"grid"),setTimeout((()=>{Ve(t,n.showClass.popup),t.style.removeProperty("opacity")}),10)):qe(t,"grid"),Ve([document.documentElement,document.body],se.shown),n.heightAuto&&n.backdrop&&!n.toast&&Ve([document.documentElement,document.body],se["height-auto"])};var ks={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function Ss(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=ks.email),"url"===e.input&&(e.inputValidator=ks.url))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&ae("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(ae('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
          ")),nt(e)}let _s;var Es=new WeakMap;class Is{constructor(){if(J(this,Es,void 0),"undefined"==typeof window)return;_s=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if((e=>{!1===e.backdrop&&e.allowOutsideClick&&ae('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Pn(t),e.toast&&Vn(t),Wn(t)})(Object.assign({},t,e)),ee.currentInstance){const e=Wt.swalPromiseResolve.get(ee.currentInstance),{isAwaitingPromise:t}=ee.currentInstance;ee.currentInstance._destroy(),t||e({isDismissed:!0}),Re()&&Gt()}ee.currentInstance=_s;const n=Ns(e,t);Ss(n),Object.freeze(n),ee.timeout&&(ee.timeout.stop(),delete ee.timeout),clearTimeout(ee.restoreFocusTimeout);const s=Os(_s);return Tt(_s,n),ct.innerParams.set(_s,n),Ts(_s,s,n)}then(e){return Q(Es,this).then(e)}finally(e){return Q(Es,this).finally(e)}}const Ts=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};Wt.swalPromiseResolve.set(e,s),Wt.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{(e=>{const t=ct.innerParams.get(e);e.disableButtons(),t.input?mn(e,"confirm"):vn(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=ct.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?mn(e,"deny"):yn(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Ot.cancel)})(e,i)},t.closeButton.onclick=()=>{i(Ot.close)},((e,t,n)=>{e.toast?Xn(e,t,n):(Qn(t),Jn(t),es(e,t,n))})(n,t,i),((e,t,n)=>{Rt(e),t.toast||(e.keydownHandler=e=>Bt(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:ge(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(ee,n,i),((e,t)=>{"select"===t.input||"radio"===t.input?hn(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(ce(t.inputValue)||de(t.inputValue))&&(an(Ce()),dn(e,t))})(e,n),ws(n),Rs(ee,n,i),Ds(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Ns=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return ys(n),Object.assign(cs(n),hs(n),ds(n),ps(n),fs(n),ms(n),gs(n,us))})(e),s=Object.assign({},Rn,t,n,e);return s.showClass=Object.assign({},Rn.showClass,s.showClass),s.hideClass=Object.assign({},Rn.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Os=e=>{const t={popup:ge(),container:pe(),actions:Ee(),confirmButton:Ce(),denyButton:Se(),cancelButton:ke(),loader:_e(),closeButton:Ne(),validationMessage:xe(),progressSteps:Ae()};return ct.domCache.set(e,t),t},Rs=(e,t,n)=>{const s=Te();je(s),t.timer&&(e.timeout=new ls((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(qe(s),Be(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&Qe(t.timer)}))))},Ds=(e,t)=>{if(!t.toast)return ue(t.allowEnterKey)?void(Ms(e)||Fs(e,t)||Dt(-1,1)):(le("allowEnterKey"),void Bs())},Ms=e=>{const t=e.popup.querySelectorAll("[autofocus]");for(const e of t)if(e instanceof HTMLElement&&Xe(e))return e.focus(),!0;return!1},Fs=(e,t)=>t.focusDeny&&Xe(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&Xe(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!Xe(e.confirmButton))&&(e.confirmButton.focus(),!0),Bs=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Is.prototype.disableButtons=En,Is.prototype.enableButtons=_n,Is.prototype.getInput=Cn,Is.prototype.disableInput=Tn,Is.prototype.enableInput=In,Is.prototype.hideLoading=An,Is.prototype.disableLoading=An,Is.prototype.showValidationMessage=Nn,Is.prototype.resetValidationMessage=On,Is.prototype.close=Yt,Is.prototype.closePopup=Yt,Is.prototype.closeModal=Yt,Is.prototype.closeToast=Yt,Is.prototype.rejectPromise=Jt,Is.prototype.update=Gn,Is.prototype._destroy=qn,Object.assign(Is,os),Object.keys(Kn).forEach((e=>{Is[e]=function(){return _s&&_s[e]?_s[e](...arguments):null}})),Is.DismissReason=Ot,Is.version="11.14.0";const zs=Is;zs.default=zs,"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}');const Ls=32,Ps=3,Vs=(e,t)=>"left"===e?.1*t:.9*t;function Ws(e,t,n){e.fillStyle="#000",e.fillRect(t-(Ls>>1),n-(Ps>>1),Ls,Ps),e.fillRect(t-(Ps>>1),n-(Ls>>1),Ps,Ls)}const Gs=30;function Us(e,t,n){return"left"===e?[t+(Ls+Gs)/2,n-(Gs>>1)]:[Gs>>1,t-(Ls+Gs)/2]}const qs=(e,{showIcon:t})=>({icon:t?"info":void 0,allowEscapeKey:!1,allowEnterKey:!1,allowOutsideClick:!1,showConfirmButton:!0,confirmButtonText:G.H.RC_ok[e.L],showClass:{popup:"fadeInUp",icon:""},hideClass:{popup:"fadeOutDown"},iconColor:e._CONST.COLOR.ORANGE,confirmButtonColor:"#aaa",customClass:{popup:"my__swal2__container",icon:"my__swal2__icon",title:"my__swal2__title",htmlContainer:`my__swal2__html rc-lang-${e.LD.toLowerCase()}`,confirmButton:"rc-button rc-go-button"}});let js;"mocha"!==_._&&(js=__webpack_require__(477).l);function Hs(e,t,n=!1,s=void 0){const r=t.control;let i=e._CONST.N.PPI_DONT_USE;e.screenPpi&&(i=e.screenPpi.value);let a=!0,o=[],l=0;const u=document.createElement("div");u.innerHTML='',e.background.appendChild(u),e._constructFloatInstructionElement("blind-spot-instruction",G.H.RC_distanceTrackingCloseL[e.L]),e._addCreditOnBackground(G.H.RC_viewingBlindSpotCredit[e.L]);const c=document.querySelector("#blind-spot-canvas"),h=c.getContext("2d"),d=document.getElementById("blind-spot-instruction");let p="left";e._setFloatInstructionElementPos(p,16);let f,m=Vs(p,c.width);const g=()=>{c.width=window.innerWidth,c.height=window.innerHeight,c.style.width=`${c.width}px`,c.style.height=`${c.height}px`,m=Vs(p,c.width),f=Us(p,m,c.width)},y=new ResizeObserver((()=>{g()}));y.observe(e.background),g();let b=f["left"===p?0:1],w=b,v=e._CONST.COLOR.DARK_RED,A="left"===p?1:-1;const x=(t=!0)=>{a=!1,r&&function(e,t){document.getElementById(e).removeEventListener("mousedown",t),document.getElementById(e).removeEventListener("touchstart",t)}("blind-spot-canvas",B),y.unobserve(e.background),e._removeBackground(),!e._trackingSetupFinishedStatus.distance&&t&&(e._trackingSetupFinishedStatus.distance=!0,e.gazeTracker.checkInitialized("distance",!1)&&e.endDistance()),(0,V.l)(D),(0,V.l)(M,"keyup")},C=async()=>{if("mocha"!==_._&&js(),l+=1,o.push({dist:(0,E.Nh)($s(b,m,i),t.decimalPlace),v:A,closedEyeSide:p,crossX:m,circleX:b,ppi:i,timestamp:performance.now()}),2===Math.floor(l/t.repeatTesting))if(function(e){const t=[],n=[];for(const s of e)"left"===s.closedEyeSide?t.push(s.dist):n.push(s.dist);const s=(0,E.G8)(t),r=(0,E.G8)(n);return Math.abs(s-r)<.2*Math.min(s,r)}(o)){const r={value:(0,E.Nh)((0,E.JZ)(Ks(o)),t.decimalPlace),timestamp:performance.now(),method:e._CONST.VIEW_METHOD.B,raw:{...o}};let i;e.newViewingDistanceData=r,i=n?"trackDistance":"measureDistance",x(!1),t.check?await e._checkDistance(s,r,i,t.checkCallback):(0,E.nB)(s,r)}else{l=0;const t=o[0];R(t.v,t.closedEyeSide,t.crossX),o=[],zs.fire({...qs(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingBlindSpotRejected[e.L],allowEnterKey:!0})}else l%t.repeatTesting==0?("left"===p?(p="right",d.innerHTML=G.H.RC_distanceTrackingCloseR[e.L]):(p="left",d.innerHTML=G.H.RC_distanceTrackingCloseL[e.L]),e._setFloatInstructionElementPos(p,16),R(1,p,Vs(p,c.width),!1,!0)):(A=-A,O(p,f))};let k=!1,S=null;const I=t=>{k||(T(),k=!0,v=e._CONST.COLOR.RED,S=setInterval((()=>{"ArrowLeft"===t.key?(b-=10,N()):"ArrowRight"===t.key&&(b+=10,N())}),30))},T=()=>{k=!1,v=e._CONST.COLOR.DARK_RED,S&&(clearInterval(S),S=null)},N=()=>{w=(0,E.AU)(b,...f),b=w},O=(e,t)=>{const n=t["left"===e?0:1],s=Math.abs(t[1]-t[0])/4;let r=(0,E.Av)(n-s,n+s);(r-t[0])*(r-t[1])>0&&(r=2*n-r),b=r},R=(t,n,s,r=!0,i=!0)=>{A=t,p=n,m=s,f=Us(p,m,c.width),r&&(d.innerHTML="left"===p?G.H.RC_distanceTrackingCloseL[e.L]:G.H.RC_distanceTrackingCloseR[e.L],e._setFloatInstructionElementPos(p,16)),i&&(b=f["left"===p?0:1],O(n,f))},D=(0,V.m)({Escape:t.showCancelButton?x:void 0,Enter:C," ":C,ArrowLeft:r?I:E.Md,ArrowRight:r?I:E.Md}),M=(0,V.m)({ArrowLeft:r?T:E.Md,ArrowRight:r?T:E.Md},"keyup");(0,W.F)(e.L,e.background,{go:C,cancel:t.showCancelButton?x:void 0,custom:{callback:()=>{zs.fire({...qs(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingDistanceIntroLiMethod[e.L],allowEnterKey:!0})},content:G.H.RC_viewingDistanceIntroTitle[e.L]}},e.params.showCancelButton);const F={x:null,circleX:null},B=t=>{const n=!!t.touches?.[0];let s,r;if(n||t.preventDefault(),n?(s=t.touches[0].clientX,r=t.touches[0].clientY):(s=t.clientX,r=t.clientY),i=b,a=c.height/2,o=s,l=r,(0,E.ll)(i,a,o,l)>1){F.x=s,F.circleX=b;const r=document.getElementById("blind-spot-canvas");v=e._CONST.COLOR.RED,r.classList.replace("cursor-grab","cursor-grabbing");const i=e=>{let s;t.preventDefault(),e.preventDefault(),s=n?e.touches[0].clientX:e.clientX,b=F.circleX+s-F.x,b=(0,E.AU)(b,...Us(p,m,c.width))};n?document.addEventListener("touchmove",i):document.addEventListener("mousemove",i);const a=()=>{n?(document.removeEventListener("touchend",a),document.removeEventListener("touchmove",i)):(document.removeEventListener("mouseup",a),document.removeEventListener("mousemove",i)),F.x=null,F.circleX=null,v=e._CONST.COLOR.DARK_RED,r.classList.replace("cursor-grabbing","cursor-grab")};n?document.addEventListener("touchend",a):document.addEventListener("mouseup",a)}var i,a,o,l};r&&function(e,t){document.getElementById(e).addEventListener("mousedown",t),document.getElementById(e).addEventListener("touchstart",t)}("blind-spot-canvas",B);const z=performance.now();let L=z;const P=()=>{h.clearRect(0,0,c.width,c.height),Ws(h,m,c.height/2),L=performance.now(),function(e,t,n,s,r,i,a=!0){t.beginPath(),t.arc(n,s,Gs>>1,0,2*Math.PI),t.closePath(),t.fillStyle=a?r%125<63?i:"#fff":i,t.fill()}(0,h,b,c.height/2,Math.round(L-z),v,t.sparkle),r||(b+=5*A,N()),a?requestAnimationFrame(P):h.clearRect(0,0,c.width,c.height)};requestAnimationFrame(P)}function $s(e,t,n){return Math.abs(t-e)/n/(s=15,Math.tan(s*Math.PI/180))/.3937;var s}function Ks(e){const t=[];for(const n of e)t.push(n.dist);return t}function Xs(e,t={framerate:60,break:!1}){let n=0,s=0,r=0;const i=1e3/t.framerate,a=()=>{t.break||requestAnimationFrame(a),n=performance.now(),r=n-s,r>i&&(s=n-r%i,e())};requestAnimationFrame(a)}_.A.prototype.measureDistance=function(e={},t=void 0){if(!this.checkInitialized())return;let n;(0,E.$k)(),n=(e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const s=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,decimalPlace:1,control:!0,headline:`📏 ${G.H.RC_viewingDistanceTitle[this.L]}`,description:n,check:!1,checkCallback:!1,showCancelButton:!0},e);this.getFullscreen(s.fullscreen),this._addBackground(),this._replaceBackground((0,E.$O)(s.headline,null,!0,"")),Hs(this,s,!1,t)};var Zs=__webpack_require__(2646);const Ys=async e=>{if(navigator.permissions?.query)return navigator.permissions.query({name:"camera"}).then((async t=>{if("prompt"===t.state)return await zs.fire({...qs(e,{showIcon:!1}),icon:void 0,imageUr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R/UblVHy+kP+obD5MlD+0bcNEYe1xFKYlTh+3z3cU3t/rvhz+nPgXMOuvBGXNGuesHD496x+VC7m11P+W+KNri54j0XXyzxcft1qXUDrZOYryGF1vu43ywfq/ndb6Xzs/0b2J7qkoL4TsJv4z+hgOOCHGmwAAAAAASUVORK5CYII=",imageWidth:480,imageAlt:"Please allow camera access",html:`${G.H.RC_requestCamera[e.L]}
          ${G.H.RC_privacyCamera[e.L]}`})})).catch((e=>{}))},Qs={video:!1};_.A.prototype.trackDistance=async function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return;let s;(0,E.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel(),s=(void 0!==e.control&&e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const r=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showVideo:!0,showFaceOverlay:!1,decimalPlace:1,framerate:3,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0,nearPoint:!0,showNearPoint:!1,control:!0,headline:`📏 ${G.H.RC_distanceTrackingTitle[this.L]}`,description:G.H.RC_distanceTrackingIntroStart[this.L]+(0,Zs.G)(this.L)+s+(0,Zs.G)(this.L)+G.H.RC_distanceTrackingIntroEnd[this.L],check:!1,checkCallback:null,showCancelButton:!0},e);if(this.getFullscreen(r.fullscreen),this.gazeTracker.checkInitialized("distance"))return this.gazeTracker._toFixedN=r.decimalPlace,this.showNearPoint(r.showNearPoint),this.showVideo(r.showVideo),void this.showFaceOverlay(r.showFaceOverlay);this._addBackground(),this._constructFloatInstructionElement("gaze-system-instruction",G.H.RC_starting[this.L]),await Ys(this);const i=e=>{this.showVideo(Qs.video),Qs.video=!1,this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(a),(0,E.nB)(t,e),nr.current=e},a=this.gazeTracker.webgazer.params.showGazeDot,o=async()=>{this._addBackground(),this._replaceBackground((0,E.$O)(r.headline,null,!0,"")),this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(!1),Hs(this,r,!0,i)};tr.pipWidthPx=r.pipWidthPx,tr.decimalPlace=r.decimalPlace,tr.framerate=r.framerate,tr.nearPoint=r.nearPoint,tr.showNearPoint=r.showNearPoint,tr.desiredDistanceCm=r.desiredDistanceCm,tr.desiredDistanceTolerance=r.desiredDistanceTolerance,tr.desiredDistanceMonitor=r.desiredDistanceMonitor,tr.desiredDistanceMonitorCancelable=r.desiredDistanceMonitorCancelable,tr.desiredDistanceMonitorAllowRecalibrate=r.desiredDistanceMonitorAllowRecalibrate,Qs.video=r.showVideo,this.gazeTracker._init({toFixedN:1,showVideo:!0,showFaceOverlay:r.showFaceOverlay},"distance"),this._trackingSetupFinishedStatus.distance=!1;const l={options:r,callbackStatic:t,callbackTrack:n};r.nearPoint?Js(this,(()=>this._measurePD({},o)),n,l):Js(this,o,n,l)};const Js=async(e,t,n,s)=>{await e.gazeTracker.webgazer.getTracker().loadModel(),e.gazeTracker.beginVideo({pipWidthPx:tr.pipWidthPx},(()=>{e._removeFloatInstructionElement(),(0,E.nB)(t),hr(e,tr,n,s)}))},er=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y,e.z-t.z),tr={pipWidthPx:0,decimalPlace:2,framerate:3,nearPoint:!0,showNearPoint:!1,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0},nr={current:null};let sr=null,rr=null,ir=null;const ar={framerate:20,break:!0};let or=null,lr=!1,ur=0,cr=1;const hr=async(e,t,n,s)=>{(0,E.yy)(1e3).then((async()=>{let r;ur=0,cr=1;const i=await e.gazeTracker.webgazer.getTracker().model,a=e.screenPpi?e.screenPpi.value:e._CONST.N.PPI_DONT_USE;!e.screenPpi&&t.nearPoint,t.nearPoint&&t.showNearPoint&&(or=document.createElement("div"),or.id="rc-near-point-dot",document.body.appendChild(or),Object.assign(or.style,{display:"block",zIndex:999999,width:"10px",height:"10px",background:"green",position:"fixed",top:"-15px",left:"-15px"})),lr=!1;const{desiredDistanceCm:o,desiredDistanceTolerance:l,desiredDistanceMonitor:u,desiredDistanceMonitorCancelable:c,desiredDistanceMonitorAllowRecalibrate:h}=t;e._distanceTrackNudging.distanceCorrectEnabled=!0,e._distanceTrackNudging.distanceDesired=o,e._distanceTrackNudging.distanceAllowedRatio=l,ir=async()=>{rr||(rr=document.getElementById("webgazerVideoCanvas"));const l=performance.now();if(r=await i.estimateFaces(rr),r.length){e._trackingVideoFrameTimestamps.distance+=l;const i=r[0].keypoints;if(5===cr){if(ur+=er(i[133],i[362]),ur/=5,e._trackingVideoFrameTimestamps.distance/=5,null!==nr.current){if(!sr){const t=pr(a),n=Math.sqrt(nr.current.value**2-t**2);nr.current.value=n,sr=ur*nr.current.value,!0!==s.options.check&&e._removeBackground(),e._trackingSetupFinishedStatus.distance=!0,lr=!0}const r=performance.now(),l=Math.round(r-e._trackingVideoFrameTimestamps.distance),d={value:(0,E.Nh)(sr/ur,t.decimalPlace),timestamp:r,method:e._CONST.VIEW_METHOD.F,latencyMs:l};let p;e.newViewingDistanceData=d,(lr||u)&&(o&&e.nudgeDistance(c,h,s),lr=!1),t.nearPoint&&(p=dr(e,t,rr,i,ur,r,a,l)),n&&"function"==typeof n&&(e.gazeTracker.defaultDistanceTrackCallback=n,n({value:{viewingDistanceCm:d.value,nearPointCm:p?p.value:[null,null],latencyMs:l},timestamp:r,method:e._CONST.VIEW_METHOD.F}))}ur=0,cr=1,e._trackingVideoFrameTimestamps.distance=0}else ur+=er(i[133],i[362]),++cr}},ar.break=!1,ar.framerate=5*t.framerate,Xs(ir,ar)}))},dr=(e,t,n,s,r,i,a,o)=>{const l=((e,t,n)=>[(-t.x-n.x+e.videoWidth)/2,(-t.y-n.y+e.videoHeight)/2])(n,s[133],s[362]);l.forEach(((t,n)=>{l[n]=(e.PDCm?e.PDCm.value:e._CONST.N.PD_DONT_USE)*t/r}));const u={value:{x:(0,E.Nh)(l[0],t.decimalPlace),y:(0,E.Nh)(l[1]+screen.height/2*2.54/a,t.decimalPlace),latencyMs:o},timestamp:i};e.newNearPointData=u;if(t.showNearPoint){const e=u.value.x*a/2.54,t=u.value.y*a/2.54;Object.assign(or.style,{left:screen.width/2-window.screenLeft+e-5+"px",top:screen.height/2-window.screenTop-(window.outerHeight-window.innerHeight)-t-5+"px"})}return u};_.A.prototype.pauseDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&!this._trackingPaused.distance?(ar.break=!0,or&&(or.style.display="none"),this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!0,this.pauseNudger(),this):null},_.A.prototype.resumeDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&this._trackingPaused.distance?(ar.break=!1,or&&(or.style.display="block"),ur=0,cr=1,this._trackingVideoFrameTimestamps.distance=0,Xs(ir,ar),this._trackingPaused.distance=!1,this.resumeNudger(),this):null},_.A.prototype.endDistance=function(e=!1,t=!0){return this.gazeTracker.checkInitialized("distance",!0)?(ar.break=!0,ar.framerate=20,tr.pipWidthPx=0,tr.decimalPlace=2,tr.framerate=3,tr.nearPoint=!0,tr.showNearPoint=!1,tr.desiredDistanceCm=void 0,tr.desiredDistanceTolerance=1.2,tr.desiredDistanceMonitor=!1,tr.desiredDistanceMonitorCancelable=!1,tr.desiredDistanceMonitorAllowRecalibrate=!0,nr.current=null,sr=null,rr=null,ir=null,lr=!1,this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!1,or&&(document.body.removeChild(or),or=null),this.endNudger(),t&&this.gazeTracker.end("distance",e),this):null},_.A.prototype.getDistanceNow=async function(e=null){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("distance",!0)||!ar.break)return;const t=e||this.gazeTracker.defaultDistanceTrackCallback,n=document.querySelector("#webgazerVideoFeed"),s=await this.gazeTracker.webgazer.getTracker().model,r=performance.now(),i=await s.estimateFaces(n);if(i.length){const e=i[0].scaledMesh,s=er(e[133],e[362]),a=performance.now(),o=a-r;this.newViewingDistanceData={value:(0,E.Nh)(sr/s,tr.decimalPlace),timestamp:a,method:this._CONST.VIEW_METHOD.F,latencyMs:o};const l=this.newViewingDistanceData;let u;return tr.nearPoint&&(u=dr(this,tr,n,e,s,a,this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,o)),(0,E.nB)(t,{value:{viewingDistanceCm:l.value,nearPointCm:u?u.value:null,latencyMs:o},timestamp:a,method:this._CONST.VIEW_METHOD.F}),l}return null},_.A.prototype.showNearPoint=function(e=!0){if(this.gazeTracker.checkInitialized("distance",!1)){const t=document.querySelector("#rc-near-point-dot");t&&(t.display=e?"block":"none")}};const pr=e=>2.54*(window.screen.height/2/e);_.A.prototype.nudgeDistance=function(e,t,n){if(this.checkInitialized()&&this._distanceTrackNudging.distanceDesired){if(this.viewingDistanceCm&&this.viewingDistanceCm.method===this._CONST.VIEW_METHOD.F){if(!fr(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)){const s=()=>{this._removeNudger(),clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,(0,V.l)(i)},r=async()=>{this.endDistance(),this._addBackground(),await(0,E.yy)(2e3),this.trackDistance(n.options,n.callbackStatic,n.callbackTrack)},i=(0,V.m)(e?{Escape:this.endNudger}:{});if(null===this._distanceTrackNudging.distanceCorrecting&&this._distanceTrackNudging.distanceCorrectEnabled){const[n,a,o,l]=mr(this);let u=e?{cancel:()=>{this.endNudger()}}:{};t&&(u={...u,custom:{callback:r,content:G.H.RC_distanceTrackingRedo[this.L]}}),(e||t)&&(0,W.F)(this.L,this.nudger,u,this.params.showCancelButton);const c=()=>{n.innerHTML=gr(this,this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired),a.innerHTML=this.viewingDistanceCm.value>100?Math.round(this.viewingDistanceCm.value):this.viewingDistanceCm.value.toFixed(1),o.innerHTML=Math.round(this._distanceTrackNudging.distanceDesired),this._distanceTrackNudging.needEasyEyesKeypadBeyondCm&&this._distanceTrackNudging.distanceDesired>this._distanceTrackNudging.needEasyEyesKeypadBeyondCm?l.innerHTML=` ${G.H.RC_canUsePhoneKeypad[this.L]}`:l.innerHTML=""};c(),this._distanceTrackNudging.distanceCorrecting=setInterval((()=>{c(),fr(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)&&(s(),(0,V.l)(i))}),200)}else this._distanceTrackNudging.distanceCorrecting&&!this._distanceTrackNudging.distanceCorrectEnabled&&s();return!1}return!0}return!1}};const fr=(e,t,n)=>{if(!yr(n))return!1;const s=t*n,r=t/n;return e<=Math.max(s,r)&&e>=Math.min(s,r)},mr=e=>(e._addNudger(`
          \n

          \n

          ${G.H.RC_distanceTrackingGuide[e.L].replace("xx1",'').replace("xx2",'')}

          \n
          \n `),[document.querySelector("#rc-distance-correct-instruction"),document.querySelector("#rc-distance-now"),document.querySelector("#rc-distance-desired"),document.querySelector("#rc-can-use-keypad")]),gr=(e,t,n)=>t>=n?G.H.RC_distanceTrackingMoveCloser[e.L]:G.H.RC_distanceTrackingMoveFurther[e.L],yr=e=>!Number.isNaN(e)&&(e>0&&1!==e);_.A.prototype.setDistanceDesired=function(e,t=null,n=null){return this._distanceTrackNudging.distanceDesired=e,n&&(this._distanceTrackNudging.needEasyEyesKeypadBeyondCm=n),t&&yr(t)&&(this._distanceTrackNudging.distanceAllowedRatio=t),e},_.A.prototype._addNudger=function(e){if(null!==this.nudger)return;let t=document.getElementById("calibration-nudger");return t||(t=document.createElement("div"),t.id="calibration-nudger",t.className=`calibration-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._nudger.element=t,this.nudger},_.A.prototype._removeNudger=function(){const e=document.getElementById("calibration-nudger");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._nudger={element:null},!0)},_.A.prototype.pauseNudger=function(){document.body.classList.add("hide-nudger")},_.A.prototype.resumeNudger=function(){document.body.classList.remove("hide-nudger")},_.A.prototype.endNudger=function(){return!!this._distanceTrackNudging.distanceCorrectEnabled&&(this._removeNudger(),this._distanceTrackNudging.distanceCorrectEnabled=!1,this._distanceTrackNudging.distanceCorrecting&&clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,this._distanceTrackNudging.distanceDesired=null,this._distanceAllowedRatio=null,!0)};function br(e,t,n,s,r){const i=setInterval((()=>{const a=document.getElementById("webgazerVideoContainer");a&&(clearInterval(i),a.style.height=t/Number.parseInt(a.style.width)*Number.parseInt(a.style.height)+"px",a.style.width=`${t}px`,a.style.opacity=n,s.setVideoViewerSize(Number.parseInt(a.style.width),Number.parseInt(a.style.height)),wr(e,a),setTimeout((()=>{e.videoOpacity(),e.isMobile.value?a.style.transition="right 0.5s, top 0.5s, width 0.5s, height 0.5s, border-radius 0.5s":a.style.transition="left 0.5s, bottom 0.5s, width 0.5s, height 0.5s, border-radius 0.5s",(0,E.nB)(r)}),700))}),100)}function wr(e,t){e.isMobile.value?(t.style.left="unset",t.style.right=e._CONST.N.VIDEO_MARGIN,t.style.top=e._CONST.N.VIDEO_MARGIN,t.style.bottom="unset"):(t.style.left=e._CONST.N.VIDEO_MARGIN,t.style.right="unset",t.style.top="unset",t.style.bottom=e._CONST.N.VIDEO_MARGIN)}const vr={video:!1,videoWidth:0,videoHeight:0,opacity:1,gaze:!1,faceOverlay:!1},Ar=.9;_.A.prototype._measurePD=async function(e={},t=void 0){if(!this.checkInitialized())return;(0,E.$k)();const n=Object.assign({fullscreen:!1,headline:`👁️ ${G.H.RC_nearPointTitle[this.L]}`,description:G.H.RC_nearPointIntro[this.L],shortDescription:G.H.RC_nearPointIntro[this.L]},e);this.getFullscreen(n.fullscreen),await(0,E.yy)(1e3),this._replaceBackground(),this._replaceBackground((0,E.$O)(n.headline,n.shortDescription,!0));const s=this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,[r,i]=xr(this),[a,o]=Sr(this,s,r,i),l=(e=!0)=>{a.removeEventListener("mousedown",o),this._removeBackground(),this.showVideo(vr.video),this.showGazer(vr.gaze),this.showFaceOverlay(vr.faceOverlay),this.gazeTracker.webgazer.showFaceFeedbackBox(!0),Object.assign(document.querySelector("#webgazerVideoContainer").style,{height:vr.videoHeight,width:vr.videoWidth,opacity:vr.opacity,borderRadius:"5px"}),wr(this,document.querySelector("#webgazerVideoContainer")),Object.assign(document.querySelector("#webgazerVideoFeed").style,{height:vr.videoHeight,width:vr.videoWidth,top:"unset",transform:"scale(-1, 1)",transformOrigin:"unset"}),vr.video=!1,vr.videoWidth=0,vr.videoHeight=0,vr.opacity=1,vr.gaze=!1,vr.faceOverlay=!1,!this._trackingSetupFinishedStatus.distance&&e&&(this._trackingSetupFinishedStatus.distance=!0,this.endDistance()),(0,V.l)(c)},u=()=>{if(-100!==kr){const e={value:2.54*kr/s,timestamp:performance.now()};return this.newPDData=e,l(!1),(0,E.nB)(t,e)}},c=(0,V.m)({Escape:l,Enter:u," ":u});(0,W.F)(this.L,this.background,{go:u,cancel:l},this.params.showCancelButton),setTimeout((()=>{zs.fire({...qs(this,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAADwCAIAAABXFyDtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGx2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMD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556H/eeB/k1ICgcHoTF1O97nujmNHD0ya2CRYHaoij2F5YzBDAZ05e8aBnbsA4AHRAB7fsW/K85ZkMmUQMhDhohhsszbxX5f/ry65QcELMh5jKIfHcHszwaITQlR1+ZLFew4f+8oDD//8q/8uyYqsKJnR80v90TAM7h0Idwf6J9ZVxZOi+YTJvxlT6yY3tgohwAyja7qmKJhhYOGgvmm4NTvCkk9jgJRQjBmEMNATDbV+ynAMoolkIp4SWY6TRVEWxfHNyYWYkdJpqf/kgmuv+9SPfmRx2KVUKhYKndl/aNuzL3YdPcm73QzDmBdkBAHjKn3ih/cDCt7z7/ep4bOKokCEx/87gJASYuE4JRqVAt0E4LyZI1GhpeK3Dz+68vrrSr2+VDo1RJ4HoDy27N+3R5WTXp/fZrONOXA+moosW35NIq0FO47xVv5SnIkZz0Lz2g9zqdXGpoWCf6k4/v+rms9Dblwk2o4Znc3rRzKRmDt18oZ9x3/yf483VPlzLbdLDtAep/3I6VZRkWoqytThDJ2pKdQsvw+lECNN03RNQRgNw4sU0UaZOxJKGJbFGIF0qrSkQrC7IQWyLIXjcYuFlyUplUgihhn3owAgJt17qrSxacVttyVjUcFmc5eVEkL3v7rpxNYdkMHIxB7w3vKdzz/d3xe8/avf1iLnNO3Syr+yzuQFT8F7yra88qyK+A/ecWcwHhjSF9Fldx4/c6KjvaWystzmdF3Mvk9V1BJnia/E8+prW5Cz/FIQwtCUeUJBodc4AJRC8q8plX9RHCMD1svJg0EIJUmcO2PqXzZue+rl16vKSoxn/39nE9KqgqMETAAAAABJRU5ErkJggg==",imageWidth:480,imageAlt:"Measurement Instruction",html:n.description})}),700)};const xr=e=>{const t=document.querySelector("#webgazerVideoFeed");if(t)return Cr(e,t,document.querySelector("#webgazerVideoCanvas"),document.querySelector("#webgazerVideoContainer"))},Cr=(e,t,n,s,r=null)=>{const i=.3*window.innerWidth/Number.parseInt(t.style.width)*Number.parseInt(t.style.height);vr.videoWidth=s.style.width,vr.videoHeight=s.style.height,vr.opacity=s.style.opacity;const a={height:`${Math.round(i)}px`,width:`${Math.round(window.innerWidth*Ar)}px`,opacity:1,borderRadius:"15px"};Object.assign(s.style,a),e.isMobile.value?Object.assign(s.style,{right:`${Math.round(.5*window.innerWidth*(1-Ar))}px`,top:`${Math.round(.5*(window.innerHeight-i))}px`}):Object.assign(s.style,{left:`${Math.round(.5*window.innerWidth*(1-Ar))}px`,bottom:`${Math.round(.5*(window.innerHeight-i))}px`});const o={height:`${Math.round(i*Ar/.3)}px`,width:`${Math.round(window.innerWidth*Ar)}px`,top:`${Math.round(.6000000000000001*-i)}px`,transform:"scale(-2, 2)",transformOrigin:"center"};return Object.assign(t.style,o),vr.video=e.gazeTracker.webgazer.params.showVideo,vr.gaze=e.gazeTracker.webgazer.params.showGazeDot,vr.faceOverlay=e.gazeTracker.webgazer.params.showFaceOverlay,vr.video||e.showVideo(!0),vr.gaze&&e.showGazer(!1),vr.faceOverlay&&e.showFaceOverlay(!1),e.gazeTracker.webgazer.showFaceFeedbackBox(!1),[window.innerWidth*Ar,i]};let kr=-100;const Sr=(e,t,n,s)=>{const r=document.createElement("div");r.id="rc-ruler",Object.assign(r.style,{height:.9*(window.innerHeight-s)/2+"px",width:2*window.innerWidth+"px",left:.25*(window.innerWidth-n)+"px",bottom:0,backgroundColor:"#FFD523dd",borderRadius:"7px 0 0 0",boxSizing:"border-box",borderBottom:"5px solid #bb6600"}),e.background.appendChild(r);const i=document.createElement("div");i.id="rc-ruler-scales",r.appendChild(i);const a=2.54*(r.clientWidth-60)/t;for(let n=0;n<=10*(0,E.Nh)(a,1);n++){const s=document.createElement("div"),r=.1*n*t/2.54+"px";if(s.className="rc-ruler-scale "+(n%10==0?"rc-ruler-major":n%5==0?"rc-ruler-secondary":"rc-ruler-minor"),s.style.left=r,i.appendChild(s),n%10==0){const t=document.createElement("p");t.className="rc-ruler-scale-text",t.style.left=r,t.innerHTML=n/10,i.appendChild(t),0===n&&(t.style.color=e._CONST.COLOR.DARK_RED)}}let o=document.createElement("div");i.appendChild(o),o.outerHTML=D(),o=document.querySelector("#size-arrow"),o.setAttribute("preserveAspectRatio","none"),o.style.left="-100px",o.style.top="40px",document.getElementById("size-arrow-fill").setAttribute("fill",e._CONST.COLOR.DARK_RED);const l=e=>{kr=e.offsetX-30,o.style.left=`${kr}px`;const t=e=>{kr=e.offsetX-30,o.style.left=`${kr}px`};r.addEventListener("mousemove",t),r.addEventListener("mouseup",(function e(){r.removeEventListener("mousemove",t),r.removeEventListener("mouseup",e)}))};return r.addEventListener("mousedown",l),[r,l]};function _r(e){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(e)}var Er=/^\s+/,Ir=/\s+$/;function Tr(e,t){if(t=t||{},(e=e||"")instanceof Tr)return e;if(!(this instanceof Tr))return new Tr(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,s=null,r=null,i=null,a=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(Er,"").replace(Ir,"").toLowerCase();var t,n=!1;if(Hr[e])e=Hr[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=ii.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=ii.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=ii.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=ii.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=ii.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=ii.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=ii.hex8.exec(e))return{r:Yr(t[1]),g:Yr(t[2]),b:Yr(t[3]),a:ti(t[4]),format:n?"name":"hex8"};if(t=ii.hex6.exec(e))return{r:Yr(t[1]),g:Yr(t[2]),b:Yr(t[3]),format:n?"name":"hex"};if(t=ii.hex4.exec(e))return{r:Yr(t[1]+""+t[1]),g:Yr(t[2]+""+t[2]),b:Yr(t[3]+""+t[3]),a:ti(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=ii.hex3.exec(e))return{r:Yr(t[1]+""+t[1]),g:Yr(t[2]+""+t[2]),b:Yr(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==_r(e)&&(ai(e.r)&&ai(e.g)&&ai(e.b)?(t=function(e,t,n){return{r:255*Xr(e,255),g:255*Xr(t,255),b:255*Xr(n,255)}}(e.r,e.g,e.b),a=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):ai(e.h)&&ai(e.s)&&ai(e.v)?(s=Jr(e.s),r=Jr(e.v),t=function(e,t,n){e=6*Xr(e,360),t=Xr(t,100),n=Xr(n,100);var s=Math.floor(e),r=e-s,i=n*(1-t),a=n*(1-r*t),o=n*(1-(1-r)*t),l=s%6,u=[n,a,i,i,o,n][l],c=[o,n,n,a,i,i][l],h=[i,i,o,n,n,a][l];return{r:255*u,g:255*c,b:255*h}}(e.h,s,r),a=!0,o="hsv"):ai(e.h)&&ai(e.s)&&ai(e.l)&&(s=Jr(e.s),i=Jr(e.l),t=function(e,t,n){var s,r,i;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=Xr(e,360),t=Xr(t,100),n=Xr(n,100),0===t)s=r=i=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=a(l,o,e+1/3),r=a(l,o,e),i=a(l,o,e-1/3)}return{r:255*s,g:255*r,b:255*i}}(e.h,s,i),a=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=Kr(n),{ok:a,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Nr(e,t,n){e=Xr(e,255),t=Xr(t,255),n=Xr(n,255);var s,r,i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(i==a)s=r=0;else{var l=i-a;switch(r=o>.5?l/(2-i-a):l/(i+a),i){case e:s=(t-n)/l+(t>1)+720)%360;--t;)s.h=(s.h+r)%360,i.push(Tr(s));return i}function jr(e,t){t=t||6;for(var n=Tr(e).toHsv(),s=n.h,r=n.s,i=n.v,a=[],o=1/t;t--;)a.push(Tr({h:s,s:r,v:i})),i=(i+o)%1;return a}Tr.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Kr(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Or(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Or(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=Nr(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Nr(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return Rr(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,r){var i=[Qr(Math.round(e).toString(16)),Qr(Math.round(t).toString(16)),Qr(Math.round(n).toString(16)),Qr(ei(s))];if(r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Xr(this._r,255))+"%",g:Math.round(100*Xr(this._g,255))+"%",b:Math.round(100*Xr(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Xr(this._r,255))+"%, "+Math.round(100*Xr(this._g,255))+"%, "+Math.round(100*Xr(this._b,255))+"%)":"rgba("+Math.round(100*Xr(this._r,255))+"%, "+Math.round(100*Xr(this._g,255))+"%, "+Math.round(100*Xr(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&($r[Rr(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Dr(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var r=Tr(e);n="#"+Dr(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Tr(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(zr,arguments)},brighten:function(){return this._applyModification(Lr,arguments)},darken:function(){return this._applyModification(Pr,arguments)},desaturate:function(){return this._applyModification(Mr,arguments)},saturate:function(){return this._applyModification(Fr,arguments)},greyscale:function(){return this._applyModification(Br,arguments)},spin:function(){return this._applyModification(Vr,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(qr,arguments)},complement:function(){return this._applyCombination(Wr,arguments)},monochromatic:function(){return this._applyCombination(jr,arguments)},splitcomplement:function(){return this._applyCombination(Ur,arguments)},triad:function(){return this._applyCombination(Gr,[3])},tetrad:function(){return this._applyCombination(Gr,[4])}},Tr.fromRatio=function(e,t){if("object"==_r(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:Jr(e[s]));e=n}return Tr(e,t)},Tr.equals=function(e,t){return!(!e||!t)&&Tr(e).toRgbString()==Tr(t).toRgbString()},Tr.random=function(){return Tr.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Tr.mix=function(e,t,n){n=0===n?0:n||50;var s=Tr(e).toRgb(),r=Tr(t).toRgb(),i=n/100;return Tr({r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a})},Tr.readability=function(e,t){var n=Tr(e),s=Tr(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},Tr.isReadable=function(e,t,n){var s,r,i=Tr.readability(e,t);switch(r=!1,(s=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+s.size){case"AAsmall":case"AAAlarge":r=i>=4.5;break;case"AAlarge":r=i>=3;break;case"AAAsmall":r=i>=7}return r},Tr.mostReadable=function(e,t,n){var s,r,i,a,o=null,l=0;r=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var u=0;ul&&(l=s,o=Tr(t[u]));return Tr.isReadable(e,o,{level:i,size:a})||!r?o:(n.includeFallbackColors=!1,Tr.mostReadable(e,["#fff","#000"],n))};var Hr=Tr.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},$r=Tr.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(Hr);function Kr(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Xr(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Zr(e){return Math.min(1,Math.max(0,e))}function Yr(e){return parseInt(e,16)}function Qr(e){return 1==e.length?"0"+e:""+e}function Jr(e){return e<=1&&(e=100*e+"%"),e}function ei(e){return Math.round(255*parseFloat(e)).toString(16)}function ti(e){return Yr(e)/255}var ni,si,ri,ii=(si="[\\s|\\(]+("+(ni="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+ni+")[,|\\s]+("+ni+")\\s*\\)?",ri="[\\s|\\(]+("+ni+")[,|\\s]+("+ni+")[,|\\s]+("+ni+")[,|\\s]+("+ni+")\\s*\\)?",{CSS_UNIT:new RegExp(ni),rgb:new RegExp("rgb"+si),rgba:new RegExp("rgba"+ri),hsl:new RegExp("hsl"+si),hsla:new RegExp("hsla"+ri),hsv:new RegExp("hsv"+si),hsva:new RegExp("hsva"+ri),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function ai(e){return!!ii.CSS_UNIT.exec(e)}var oi=__webpack_require__(782);const li=e=>e/2.54,ui={video:!1,gazer:!1};function ci(e,t){e.background?e._replaceBackground((0,E.$O)(t.headline,t.description)):e._addBackground((0,E.$O)(t.headline,t.description)),e._constructFloatInstructionElement("gaze-system-instruction",G.H.RC_starting[e.L])}_.A.prototype.calibrateGaze=function(e={},t=void 0){if(!this.gazeTracker.checkInitialized("gaze",!0))return;(0,E.$k)();const n=Object.assign({greedyLearner:!1,calibrationCount:1,headline:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);n.nudge=!1,ui.video=this.gazeTracker.webgazer.params.showVideo,ui.gazer=this.gazeTracker.webgazer.params.showGazeDot,ui.video||this.showVideo(!0),ui.gazer||this.showGazer(!0),this.gazeTracker.webgazer.params.greedyLearner=n.greedyLearner,ci(this,n);const s=hi(this,n,(()=>{this._removeBackground(),(0,V.l)(r),(0,E.nB)(t,{timestamp:performance.now()})})),r=(0,V.m)({Escape:()=>{s.deleteSelf(!1),this._removeBackground(),this.showVideo(ui.video),this.showGazer(ui.gazer),ui.video=!1,ui.gazer=!1,this._trackingSetupFinishedStatus.gaze||(this._trackingSetupFinishedStatus.gaze=!0,this.endGaze()),(0,V.l)(r)}})};const hi=(e,t,n)=>(e._removeFloatInstructionElement(),new di(e,document.body,t,ui,n));class di{constructor(e,t,n,s,r){this._sequentialOrder(n.nudge),this.nudge=n.nudge,this.RC=e,this.clickThresholdBase=oi.Y?1:n.calibrationCount,this.clicks=0,this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.r=this.RC._CONST.N.GAZE_CALIBRATION.R,this.div=document.createElement("div");const i=document.createElement("div"),a=document.createElement("div");this.div.className="rc-crosshair",this.div.id="rc-crosshair",i.className="rc-crosshair-component rc-crosshair-vertical",a.className="rc-crosshair-component rc-crosshair-horizontal",a.style.height=i.style.width=`${Ps}px`,a.style.width=i.style.height=`${Ls}px`,this.div.style.background=e.params.backgroundColor;const o=Tr(e.params.backgroundColor).toRgb();this.div.style.background=`rgba(${o.r}, ${o.g}, ${o.b}, 0.75)`,this.div.appendChild(i),this.div.appendChild(a),this.parent=t,this.parent.appendChild(this.div),this.placeDot(),this.handleClick=this.takeClick.bind(this),this.div.addEventListener("click",this.handleClick,!1),this.originalStyles=s,this.endCalibrationCallback=r}placeDot(){Object.assign(this.div.style,[{left:`${this.RC._CONST.N.GAZE_CALIBRATION.MARGIN}px`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,right:"unset"},{left:window.innerWidth-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"}][this.position[0]],[{top:`${this.RC._CONST.N.GAZE_CALIBRATION.MARGIN}px`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,bottom:"unset"},{top:window.innerHeight-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"}][this.position[1]])}takeClick(e){if(this.clickAtCenter(e)){this.clicks++,this.clicks>=this.clickThreshold&&(this.order.length?(this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.placeDot(),this.clicks=0):this.deleteSelf(!0));const e=document.querySelectorAll(".leader-line");e&&e.map((e=>{e.style.opacity=0}))}}deleteSelf(e=!0){this.div.removeEventListener("click",this.handleClick,!1),this.parent.removeChild(this.div),e&&(this.nudge||this.RC.showVideo(this.originalStyles.video),this.nudge||(this.originalStyles.video=!1),this.RC.showGazer(this.originalStyles.gazer),this.originalStyles.gazer=!1,(0,E.nB)(this.endCalibrationCallback),this.nudge||(this.RC._trackingSetupFinishedStatus.gaze=!0))}clickAtCenter(e){const{x:t,y:n}=(0,E.KY)(e),{left:s,top:r,right:i,bottom:a}=this.div.getBoundingClientRect(),o=(s+i)/2,l=(r+a)/2;return t>=o-5&&t<=o+5&&n>=l-5&&n<=l+5}_randomOrder(){this.order=[];for(const e of[0,1,2])for(const t of[0,1,2])this.order.push([e,t]);(0,E.k4)(this.order)}_sequentialOrder(e=!1){this.order=e?[[1,1],[1,3],[4,1],[1,4],[3,1],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1]]:oi.Y?[[0,0],[2,0],[2,2],[0,2],[1,1]]:[[1,1],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1],[0,0],[1,1],[1,2],[2,2],[2,1],[2,0],[1,0],[0,0],[0,1],[0,2],[1,1],[1,5],[6,5],[6,1],[6,6],[1,6],[5,6],[5,1],[5,5],[1,1],[1,6],[6,6],[6,1],[6,5],[1,5],[5,5],[5,1],[5,6],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1],[1,3],[4,1],[1,4],[3,1],[1,1]]}getOffsetPx(e,t=null){const n=(s=e,r=this.RC.screenPpi?this.RC.screenPpi.value:this.RC._CONST.N.PPI_DONT_USE,i=this.RC.viewingDistanceCm?this.RC.viewingDistanceCm.value:this.RC._CONST.N.VIEW_DIST_DONT_USE,li(r)*i*Math.tan(s*(Math.PI/180)));var s,r,i;return t?Math.min(n,t):n}}_.A.prototype.trackGaze=async function(e={},t=null,n=null){if(!this.checkInitialized())return;(0,E.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel();const s=Object.assign({fullscreen:!1,greedyLearner:!1,framerate:60,showGazer:!0,showVideo:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showFaceOverlay:!1,calibrationCount:1,thresholdDeg:10,decimalPlace:0,headline:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);if(this.getFullscreen(s.fullscreen),this.gazeTracker.checkInitialized("gaze"))return this.gazeTracker._toFixedN=s.decimalPlace,this.showGazer(s.showGazer),this.showVideo(s.showVideo),this.showFaceOverlay(s.showFaceOverlay),this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n);this._addBackground(),await Ys(this),this.gazeTracker._init({greedyLearner:s.greedyLearner,framerate:s.framerate,toFixedN:s.decimalPlace,showVideo:s.showVideo,showFaceOverlay:s.showFaceOverlay,showGazer:s.showGazer},"gaze"),ci(this,s);const r={pipWidthPx:s.pipWidthPx},i={greedyLearner:s.greedyLearner,calibrationCount:s.calibrationCount,headline:s.headline,description:s.description};this.gazeTracker.begin(r,(()=>{this._trackingSetupFinishedStatus.gaze=!1,this.calibrateGaze(i,a)}));const a=e=>{(0,E.nB)(t,e),this.gazeTracker.webgazer.params.greedyLearner||this.gazeTracker.stopLearning({click:!0,move:!0});return s.thresholdDeg,this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n)}},_.A.prototype.getGazeNow=async function(e={},t=null){if(!(this.checkInitialized()&&this.gazeTracker.checkInitialized("gaze",!0)&&this.gazeTracker.webgazer.params.paused&&this._trackingPaused.gaze))return;const n=Object.assign({wait:0,frames:5},e),s=t||this.gazeTracker.defaultGazeCallback;return await this.gazeTracker.getGazeNow(n,s)},_.A.prototype.pauseGaze=function(){!this.gazeTracker.checkInitialized("gaze",!0)&&this._trackingPaused.gaze||(this._trackingPaused.gaze=!0,this.gazeTracker.pause())},_.A.prototype.resumeGaze=function(){(this.gazeTracker.checkInitialized("gaze",!0)||this._trackingPaused.gaze)&&(this._trackingPaused.gaze=!1,this.gazeTracker.resume())},_.A.prototype.endGaze=function(e=!1){this.gazeTracker.checkInitialized("gaze",!0)&&(this._trackingPaused.gaze=!1,this.gazeTracker.end("gaze",e))},_.A.prototype.gazeLearning=function(e,t){const n=Object.assign({click:!0,move:!0},t);e?this.gazeTracker.startLearning(n):this.gazeTracker.stopLearning(n)},_.A.prototype.showGazer=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showGazer(e)},_.A.prototype.showVideo=function(e=!0){this.gazeTracker.checkInitialized("",!1)&&this.gazeTracker.showVideo(e)},_.A.prototype.showFaceOverlay=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showFaceOverlay(e)};var pi=__webpack_require__(7158),fi=__webpack_require__.n(pi);const mi={gazer:!1,gazeLearning:!1,gazePaused:!1},gi={current:null};_.A.prototype.nudgeGaze=function(e={},t=void 0){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("gaze",!0))return;const n=Object.assign({showOffset:!0},e);if(this._gazeTrackNudging.isCorrectingGaze)return;this._gazeTrackNudging.isCorrectingGaze=!0;let s=document.getElementById("gaze-nudger");s||(s=document.createElement("div"),s.id="gaze-nudger",s.className=`gaze-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(s),s.style.background=this.params.backgroundColor);const r=`

          ${G.H.RC_gazeTrackingNudge[this.L]}

          `;s.innerHTML+=r;const i=yi(this,s,t);if(this._nudger.gazeElement=s,n.showOffset){const e=document.createElement("div");e.id="fake-gaze-dot",e.style.position="absolute",e.style.left=this.gazePositionPx.value.x-5+"px",e.style.top=this.gazePositionPx.value.y-5+"px",e.style.width="10px",e.style.height="10px",e.style.borderRadius="50%",e.style.background="transparent",e.style.zIndex="9999999999",document.body.appendChild(e),gi.current=new(fi())(fi().pointAnchor(e,{x:"50%",y:"50%"}),fi().pointAnchor(i,{x:"50%",y:"50%"}),{path:"straight",color:this._CONST.COLOR.DARK_RED,startPlug:"disc"});const t=document.querySelector(".leader-line");t.style.zIndex=9999999999,t.style.opacity=.7,t.style.transitionDuration="0.2s"}mi.gazePaused=this._trackingPaused.gaze,mi.gazer=this.gazeTracker.webgazer.params.showGazeDot,mi.gazeLearning=this.gazeTracker._learning,mi.gazePaused&&this.resumeGaze(),mi.gazer||this.showGazer(!0),mi.gazeLearning||this.gazeLearning(!0,{click:!0,move:!1})};const yi=(e,t,n)=>new di(e,t,{greedyLearner:!1,calibrationCount:1,nudge:!0},mi,(()=>{t.remove(),t=null,e._nudgerElement=null,document.body.classList.remove("lock-view"),mi.gazePaused&&e.pauseGaze(),mi.gazePaused=!1,gi.current&&(gi.current.remove(),gi.current=null),e._gazeTrackNudging.isCorrectingGaze=!1,(0,E.nB)(n)}));var bi=__webpack_require__(4948),wi=__webpack_require__.n(bi);let vi=!1;_.A.prototype.getGazeAccuracy=function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return!1;(0,E.$k)();const s=this.screenPpi,r=this.viewingDistanceCm;if(!s||!r)return!1;const i=Object.assign({backgroundColor:"#eee",thresholdDeg:10,decimalPlace:3},e);this._addBackground();const a=document.createElement("div");a.innerHTML='',this.background.appendChild(a);const o=document.querySelector("#gaze-accuracy-canvas"),l=o.getContext("2d"),u=()=>{o.width=window.innerWidth,o.height=window.innerHeight,o.style.width=`${o.width}px`,o.style.height=`${o.height}px`},c=new ResizeObserver((()=>{u()}));return c.observe(this.background),u(),wi().fire({...qs(this,{showIcon:!0}),html:"We will measure your gaze accuracy. Please do not move the mouse and look at the fixation at the middle of the screen for the next 5 seconds."}).then((()=>{vi=!0,Ai(o,l,i),this.gazeTracker.startStoringPoints(),(0,E.yy)(5e3).then((()=>{vi=!1,this.gazeTracker.stopStoringPoints();const e=this.gazeTracker.webgazer.getStoredPoints(),a=xi({x:o.width/2,y:o.height/2},e,s.value,r.value);this.newGazeAccuracyData={value:(0,E.Nh)(a,i.decimalPlace),timestamp:performance.now()},a{const s=()=>{t.fillStyle=n.backgroundColor,t.fillRect(0,0,e.width,e.height),Ws(t,e.width/2,e.height/2),vi&&requestAnimationFrame(s)};requestAnimationFrame(s)},xi=(e,t,n,s)=>{let r=0;for(let i=0;i0;)n=Math.random()*t|0,t--,Ti(e,t,n)}function Ei(e,t,n){return Math.max(e,Math.min(t,n))}function Ii(e){return e%2==0?e:e+1}function Ti(e,t,n){const s=e[t];e[t]=e[n],e[n]=s}function Ni(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function Oi(e,t,n=""){Ni(Mi(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function Ri(e){Ni(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function Di(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n0),n,s){return new Promise(((r,i)=>{let a=0;const o=()=>{if(e())return void r();a++;const l=t(a);null!=n&&a>=n?i():null!=s?s(o,l):setTimeout(o,l)};o()}))}function Pi(e,t){let n=1,s=-1;for(let t=0;t=0)n*=e[t];else if(-1===e[t]){if(-1!==s)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${s} and dim ${t}`);s=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===s){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);const r=e.slice();return r[s]=t/n,r}function Vi(e,t){const n=t.length;return Ni((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-n&&e`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),Ni(e.every((e=>Fi(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function Wi(e,t){const n=[],s=[],r=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||r?null:Vi(t,e).sort();let a=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),s.push(t)),i[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),s.push(t))}return{newShape:n,keptDims:s}}function Gi(e,t){return Ui(e,t)}function Ui(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function qi(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function ji(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function Hi(e){return"string"==typeof e||e instanceof String}function $i(e){return"number"==typeof e}function Ki(e){return Array.isArray(e)?Ki(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":$i(e)?"float32":Hi(e)?"string":"boolean"==typeof e?"bool":"float32"}function Xi(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Zi(e,t){for(let n=t;n=0;--s)n[s]=n[s+1]*e[s+1];return n}function Qi(e,t,n,s=!1){const r=new Array;if(1===t.length){const i=t[0]*(s?2:1);for(let t=0;te*t))*(s?2:1);for(let t=0;te*t))*(n?2:1);if(0===s)return[];if(s!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return Qi(0,e,t,n)}function ea(e,t){const n=ta(e,t);for(let e=0;ee*t),1);if(null==t||"float32"===t)return Ji(e,new Float32Array(n));if("int32"===t)return Ji(e,new Int32Array(n));if("bool"===t)return Ji(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function sa(e){e.forEach((t=>{Ni(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function ra(e,t,n){if(0===t)return 0;if(1===t)return e[0];let s=e[e.length-1];for(let t=0;t{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){const n=t.toLowerCase();return"true"===n||"false"===n?"true"===n:""+ +n===n?+n:t}(0,n)}))}}}function ua(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")))),t}function ca(){return da}let ha,da=null;function pa(){if(null==ha){let e;if("undefined"!=typeof window)e=window;else if(void 0!==__webpack_require__.g)e=__webpack_require__.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}ha=e}return ha}function fa(e,t){const n=function(){const e=pa();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const s=t();return n.set(e,s),n.get(e)}}const ma="Abs",ga="Acos",ya="Acosh",ba="Add",wa="AddN",va="All",Aa="Any",xa="ArgMax",Ca="ArgMin",ka="Asin",Sa="Asinh",_a="Atan",Ea="Atanh",Ia="Atan2",Ta="AvgPool",Na="AvgPoolGrad",Oa="AvgPool3D",Ra="AvgPool3DGrad",Da="BatchMatMul",Ma="BatchToSpaceND",Fa="Bincount",Ba="BitwiseAnd",za="BroadcastArgs",La="Cast",Pa="Ceil",Va="ClipByValue",Wa="Complex",Ga="ComplexAbs",Ua="Concat",qa="Conv2D",ja="Conv2DBackpropFilter",Ha="Conv2DBackpropInput",$a="Conv3D",Ka="Conv3DBackpropFilterV2",Xa="Conv3DBackpropInputV2",Za="Cos",Ya="Cosh",Qa="Cumprod",Ja="Cumsum",eo="CropAndResize",to="DenseBincount",no="DepthToSpace",so="DepthwiseConv2dNative",ro="DepthwiseConv2dNativeBackpropFilter",io="DepthwiseConv2dNativeBackpropInput",ao="Diag",oo="Dilation2D",lo="Dilation2DBackpropInput",uo="Dilation2DBackpropFilter",co="Draw",ho="RealDiv",po="Einsum",fo="Elu",mo="EluGrad",go="Erf",yo="Equal",bo="Exp",wo="ExpandDims",vo="Expm1",Ao="FFT",xo="Fill",Co="FlipLeftRight",ko="Floor",So="FloorDiv",_o="FusedBatchNorm",Eo="GatherV2",Io="GatherNd",To="Greater",No="GreaterEqual",Oo="Identity",Ro="IFFT",Do="Imag",Mo="IsFinite",Fo="IsInf",Bo="IsNan",zo="LeakyRelu",Lo="Less",Po="LessEqual",Vo="LinSpace",Wo="Log",Go="Log1p",Uo="LogicalAnd",qo="LogicalNot",jo="LogicalOr",Ho="LRN",$o="LRNGrad",Ko="Max",Xo="Maximum",Zo="MaxPool",Yo="MaxPoolGrad",Qo="MaxPool3D",Jo="MaxPool3DGrad",el="MaxPoolWithArgmax",tl="Mean",nl="Min",sl="Minimum",rl="MirrorPad",il="Mod",al="Multinomial",ol="Multiply",ll="Neg",ul="NotEqual",cl="NonMaxSuppressionV3",hl="NonMaxSuppressionV4",dl="NonMaxSuppressionV5",pl="OnesLike",fl="OneHot",ml="Pack",gl="PadV2",yl="Pow",bl="Prelu",wl="Prod",vl="RaggedGather",Al="RaggedRange",xl="RaggedTensorToTensor",Cl="Range",kl="Real",Sl="Reciprocal",_l="Relu",El="Reshape",Il="ResizeNearestNeighbor",Tl="ResizeNearestNeighborGrad",Nl="ResizeBilinear",Ol="ResizeBilinearGrad",Rl="Relu6",Dl="Reverse",Ml="Round",Fl="Rsqrt",Bl="ScatterNd",zl="TensorScatterUpdate",Ll="SearchSorted",Pl="Select",Vl="Selu",Wl="Slice",Gl="Sin",Ul="Sinh",ql="Sign",jl="Sigmoid",Hl="Softplus",$l="Sqrt",Kl="Sum",Xl="SpaceToBatchND",Zl="SplitV",Yl="Softmax",Ql="SparseFillEmptyRows",Jl="SparseReshape",eu="SparseSegmentMean",tu="SparseSegmentSum",nu="SparseToDense",su="SquaredDifference",ru="Square",iu="StaticRegexReplace",au="StridedSlice",ou="StringNGrams",lu="StringSplit",uu="StringToHashBucketFast",cu="Sub",hu="Tan",du="Tanh",pu="Tile",fu="TopK",mu="Transform",gu="Transpose",yu="Unique",bu="Unpack",wu="UnsortedSegmentSum",vu="ZerosLike",Au="Step",xu="FromPixels",Cu="RotateWithOffset",ku="_FusedMatMul",Su="FusedConv2D",_u="FusedDepthwiseConv2D";function Eu(...e){!ca().getBool("IS_TEST")&&ca().getBool("PROD")}function Iu(...e){!ca().getBool("IS_TEST")&&ca().getBool("PROD")}const Tu=fa("kernelRegistry",(()=>new Map)),Nu=fa("gradRegistry",(()=>new Map));function Ou(e,t){const n=Bu(e,t);return Tu.get(n)}function Ru(e){return Nu.get(e)}function Du(e){const t=Tu.entries(),n=[];for(;;){const{done:s,value:r}=t.next();if(s)break;const[i,a]=r,[o]=i.split("_");o===e&&n.push(a)}return n}function Mu(e){const{kernelName:t,backendName:n}=e,s=Bu(t,n);Tu.has(s)&&Eu(),Tu.set(s,e)}function Fu(e){const{kernelName:t}=e;Nu.has(t)&&ca().getBool("DEBUG")&&Eu(),Nu.set(t,e)}function Bu(e,t){return`${t}_${e}`}function zu(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var Lu=__webpack_require__(3122);const Pu=__webpack_require__.n(Lu)()||Lu;function Vu(e){return Pu.fromString(e,!0,16)}const Wu=Vu("c3a5c85c97cb3127"),Gu=Vu("b492b66fbe98f273"),Uu=Vu("9ae16a3b2f90404f");function qu(e){return e.xor(e.shru(47))}function ju(e,t,n){const s=e.slice(t,t+n);return Pu.fromBytes(Array.from(s),!0,!0)}function Hu(e,t){return ju(e,t,8)}function $u(e,t){return ju(e,t,4)}function Ku(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function Xu(e,t,n=Vu("9ddfea08eb382d69")){let s=e.xor(t).mul(n);s=s.xor(s.shru(47));let r=t.xor(s).mul(n);return r=r.xor(r.shru(47)),r=r.mul(n),r}function Zu(e,t,n,s){return function(e,t,n,s,r,i){r=r.add(e),i=Ku(i.add(r).add(s),21);const a=r;return r=(r=r.add(t)).add(n),i=i.add(Ku(r,44)),[r.add(s),i.add(a)]}(Hu(e,t),Hu(e,t+8),Hu(e,t+16),Hu(e,t+24),n,s)}function Yu(e,t=e.length){const n=Pu.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=Uu.add(2*t),s=Hu(e,0).add(Uu),r=Hu(e,t-8);return Xu(Ku(r,37).mul(n).add(s),Ku(s,25).add(r).mul(n),n)}if(t>=4){const n=Uu.add(2*t);return Xu($u(e,0).shl(3).add(t),$u(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),s=t+(e[t-1]<<2);return qu(Uu.mul(n).xor(Wu.mul(s))).mul(Uu)}return Uu}(e,t):function(e,t=e.length){const n=Uu.add(2*t),s=Hu(e,0).mul(Gu),r=Hu(e,8),i=Hu(e,t-8).mul(n),a=Hu(e,t-16).mul(Uu);return Xu(Ku(s.add(r),43).add(Ku(i,30)).add(a),s.add(Ku(r.add(Uu),18)).add(i),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=Uu.add(2*t),s=Hu(e,0).mul(Uu),r=Hu(e,8),i=Hu(e,t-8).mul(n),a=Hu(e,t-16).mul(Uu),o=Ku(s.add(r),43).add(Ku(i,30)).add(a),l=Xu(o,s.add(Ku(r.add(Uu),18)).add(i),n),u=Hu(e,16).mul(n),c=Hu(e,24),h=o.add(Hu(e,t-32)).mul(n),d=l.add(Hu(e,t-24)).mul(n);return Xu(Ku(u.add(c),43).add(Ku(h,30)).add(d),u.add(Ku(c.add(s),18)).add(h),n)}(e,t);let s=n,r=n.mul(Gu).add(113),i=qu(r.mul(Uu).add(113)).mul(Uu),a=[Pu.UZERO,Pu.UZERO],o=[Pu.UZERO,Pu.UZERO];s=s.mul(Uu).add(Hu(e,0));let l=0;const u=64*(t-1>>6),c=u+(t-1&63)-63;do{s=Ku(s.add(r).add(a[0]).add(Hu(e,l+8)),37).mul(Gu),r=Ku(r.add(a[1]).add(Hu(e,l+48)),42).mul(Gu),s=s.xor(o[1]),r=r.add(a[0]).add(Hu(e,l+40)),i=Ku(i.add(o[0]),33).mul(Gu),a=Zu(e,l,a[1].mul(Gu),s.add(o[0])),o=Zu(e,l+32,i.add(o[1]),r.add(Hu(e,l+16))),[i,s]=[s,i],l+=64}while(l!==u);const h=Gu.add(i.and(255).shl(1));return l=c,o[0]=o[0].add(t-1&63),a[0]=a[0].add(o[0]),o[0]=o[0].add(a[0]),s=Ku(s.add(r).add(a[0]).add(Hu(e,l+8)),37).mul(h),r=Ku(r.add(a[1]).add(Hu(e,l+48)),42).mul(h),s=s.xor(o[1].mul(9)),r=r.add(a[0].mul(9).add(Hu(e,l+40))),i=Ku(i.add(o[0]),33).mul(h),a=Zu(e,l,a[1].mul(h),s.add(o[0])),o=Zu(e,l+32,i.add(o[1]),r.add(Hu(e,l+16))),[i,s]=[s,i],Xu(Xu(a[0],o[0],h).add(qu(r).mul(Wu)).add(i),Xu(a[1],o[1],h).add(s),h)}function Qu(e,t){return"string"===t?tc(e):Ju([e],t)}function Ju(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=rc(e)),ca().getBool("DEBUG")&&function(e,t){for(let n=0;n{s=n()};let i;const a=ec();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(r);else{r();for(const e of s)e.dataSync();i=Promise.resolve({kernelMs:ec()-a})}if(ca().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{ac(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:i.then((e=>e.kernelMs)),extraInfo:i.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:s,inputs:r,extraInfo:i}=e;n.forEach((e=>{Promise.all([e.data(),s,i]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],r,n[2])}))}))}}function ac(e,t,n){if("float32"!==t)return!1;for(let t=0;t0?s:""} `}}}}const lc=20,uc=3,cc=7;function hc(e,t,n,s){const r=Yi(t),i=function(e,t,n,s){const r=Di(t),i=s[s.length-1],a=new Array(i).fill(0),o=t.length,l="complex64"===n?mc(e):e;if(o>1)for(let e=0;e" "+e)).join("\n")),l.join("\n")}function dc(e,t,n){let s;return s=Array.isArray(e)?`${parseFloat(e[0].toFixed(cc))} + ${parseFloat(e[1].toFixed(cc))}j`:Hi(e)?`'${e}'`:"bool"===n?pc(e):parseFloat(e.toFixed(cc)).toString(),zi(s,t)}function pc(e){return 0===e?"false":"true"}function fc(e,t,n,s,r,i=!0){const a="complex64"===n?2:1,o=t[0],l=t.length;if(0===l){if("complex64"===n){return[dc(mc(e)[0],0,n)]}return"bool"===n?[pc(e[0])]:[e[0].toString()]}if(1===l){if(o>lc){const t=uc*a;let s=Array.from(e.slice(0,t)),i=Array.from(e.slice((o-uc)*a,o*a));return"complex64"===n&&(s=mc(s),i=mc(i)),["["+s.map(((e,t)=>dc(e,r[t],n))).join(", ")+", ..., "+i.map(((e,t)=>dc(e,r[o-uc+t],n))).join(", ")+"]"]}return["["+("complex64"===n?mc(e):Array.from(e)).map(((e,t)=>dc(e,r[t],n))).join(", ")+"]"]}const u=t.slice(1),c=s.slice(1),h=s[0]*a,d=[];if(o>lc){for(let t=0;t0?d[0]+p:"");for(let e=1;e`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||Ui(t,this.size),this.strides=Yi(e)}set(e,...t){0===t.length&&(t=[0]),Ni(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;tnc(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),yc().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=yc().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>nc(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await yc().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),yc().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return bc.print(this,e)}clone(){return this.throwIfDisposed(),bc.clone(this)}toString(e=!1){return hc(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),bc.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),yc().makeVariable(this,e,t,n)}}function Ac(){return fa("Tensor",(()=>vc))}Object.defineProperty(vc,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Ac();class xc extends vc{constructor(e,t,n,s){super(e.shape,e.dtype,e.dataId,s),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!Mi(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);yc().disposeTensor(this),this.dataId=e.dataId,yc().incRef(this,null)}dispose(){yc().disposeVariable(this),this.isDisposedInternal=!0}}var Cc,kc,Sc,_c,Ec;Object.defineProperty(xc,Symbol.hasInstance,{value:e=>e instanceof vc&&null!=e.assign&&e.assign instanceof Function}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(Cc||(Cc={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(kc||(kc={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(Sc||(Sc={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(_c||(_c={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(Ec||(Ec={}));const Ic={float32:_c,int32:kc,bool:Sc,complex64:Ec};function Tc(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return Ic[e][t]}function Nc(e){return Tc(e,"int32")}function Oc(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function Rc(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}function Dc(e,t){if(e.dtype===t.dtype)return[e,t];const n=Tc(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Mc(e,t){return t.some((t=>t.id===e.id))}function Fc(e){const t=[];return Bc(e,t,new Set),t}function Bc(e,t,n){if(null==e)return;if(e instanceof vc)return void t.push(e);if(s=e,!Array.isArray(s)&&"object"!=typeof s)return;var s;const r=e;for(const e in r){const s=r[e];n.has(s)||(n.add(s),Bc(s,t,n))}}function zc(e){return null!=e.kernelName}class Lc{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class Pc{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Lc}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){Du(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof ki||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,s=n.then((n=>!(t(tthis.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;tthis.startScope(s)),(()=>this.endScope(n)),(()=>(n=t(),n)))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return Pc.nextTensorId++}nextVariableId(){return Pc.nextVariableId++}clone(e){const t=Wc.runKernel(Oo,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return Wc.runKernel(La,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=Ou(e,this.backendName)))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){const s=this.backend.numDataIds();let r=0;n.forEach((e=>{r+="complex64"===e.dtype?3:1}));const i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=s-t-r-i;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const s=this.isTapeOn(),r=this.state.numBytes,i=this.state.numTensors;let a,o;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=zc(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(zc(e)){const{kernelName:t,inputs:r,attrs:i}=e;null==this.backendName&&this.backend;const l=Ou(t,this.backendName);Ni(null!=l,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),a=()=>{const e=this.backend.numDataIds();o=l.kernelFunc({inputs:r,attrs:i,backend:this.backend});const a=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,a);const u=a.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(s){const e=this.getTensorsForGradient(t,r,u);n=this.saveTensorsForBackwardMode(e)}return u}}else{const{forwardFunc:t}=e,r=e=>{s&&(n=e.map((e=>this.keep(this.clone(e)))))};a=()=>{const e=this.backend.numDataIds();o=this.tidy((()=>t(this.backend,r)));const n=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,e,n),n}}const{inputs:u,attrs:c}=e,h=zc(e)?null:e.backwardsFunc;let d;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,u,(()=>a())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=a()})),s&&this.addTapeNode(l,u,t,h,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map((e=>null!=u[e]?u[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map((e=>this.keep(this.clone(e))));return t}getTensorsForGradient(e,t,n){const s=Ru(e);if(null!=s){const e=s.inputsToSave||[],r=s.outputsToSave||[];let i;s.saveAllInputs?(Ni(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),i=Object.keys(t).map((e=>t[e]))):i=e.map((e=>t[e]));const a=n.filter(((e,t)=>r[t]));return i.concat(a)}return[]}makeTensor(e,t,n,s){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",s=s||this.backend;let r=e;"string"===n&&Hi(e[0])&&(r=e.map((e=>tc(e))));const i=s.write(r,t,n),a=new vc(t,n,i,this.nextTensorId());if(this.trackTensor(a,s),"string"===n){const e=this.state.tensorInfo.get(i),t=function(e){if(null==e)return 0;let t=0;return e.forEach((e=>t+=e.length)),t}(r);this.state.numBytes+=t-e.bytes,e.bytes=t}return a}makeTensorFromDataId(e,t,n,s){const r={dataId:e,shape:t,dtype:n=n||"float32"};return this.makeTensorFromTensorInfo(r,s)}makeTensorFromTensorInfo(e,t){const{dataId:n,shape:s,dtype:r}=e,i=new vc(s,r,n,this.nextTensorId());return this.trackTensor(i,t),i}makeVariable(e,t=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==e.dtype&&(e=e.cast(s));const r=new xc(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[r.name])throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*ji(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof xc||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*ji(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,s,r,i){const a={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=Ru(e);null!=o&&(s=o.gradFunc),null!=s&&(a.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],s=ta(e.size,e.dtype);return this.makeTensor(s,e.shape,e.dtype)}return e})),s(e.length>1?e:e[0],r,i))),this.state.activeTape.push(a)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=Fc(e),n=new Set(t.map((e=>e.id)));for(let e=0;e{e.kept||e.scopeId!==s.id||this.track(e)}))}gradients(e,t,n,s=!1){if(Ni(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const r=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));Ni(r instanceof vc,(()=>"The result y returned by f() must be a tensor."));const i=function(e,t,n){const s={},r={};for(let e=0;es[e.id]=!0)),o=!0,r[i.id]=!0;break}if(o)break}}const i={};i[n.id]=!0;const a={};for(let t=e.length-1;t>=0;t--){const n=e[t],s=n.inputs;for(let e=0;e0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[r.id]=null==n?function(e){const t=ea(Di(e),"float32");return Wc.makeTensor(t,e,"float32")}(r.shape):n,function(e,t,n,s){for(let r=t.length-1;r>=0;r--){const i=t[r],a=[];if(i.outputs.forEach((t=>{const n=e[t.id];null!=n?a.push(n):a.push(null)})),null==i.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${i.kernelName}.`);const o=i.gradient(a);for(const t in i.inputs){if(!(t in o))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(o)}.`);const r=n((()=>o[t]()));if("float32"!==r.dtype)throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${r.dtype}'`);const a=i.inputs[t];if(!Mi(r.shape,a.shape))throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input '${t}' has shape '${r.shape}', which does not match the shape of the input '${a.shape}'`);if(null==e[a.id])e[a.id]=r;else{const t=e[a.id];e[a.id]=s(t,r),t.dispose()}}}}(e,i,(e=>this.tidy(e)),Gc);const s=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:r,grads:s}}))}customGrad(e){return Ni(Xi(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;Ni(t.every((e=>e instanceof vc)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const s={};t.forEach(((e,t)=>{s[t]=e}));return this.runKernelFunc({forwardFunc:(s,r)=>(n=e(...t,r),Ni(n.value instanceof vc,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),Ni(Xi(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(e,s)=>{const r=n.gradFunc(e,s),i=Array.isArray(r)?r:[r];Ni(i.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),Ni(i.every((e=>e instanceof vc)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const a={};return i.forEach(((e,t)=>{a[t]=()=>e})),a},inputs:s})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=ec(),n=await this.backend.time(e);return n.wallMs=ec()-t,n}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Lc;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function Vc(){const e=pa();if(null==e._tfengine){const t=new la(e);e._tfengine=new Pc(t)}var t;return t=e._tfengine.ENV,da=t,yc=()=>e._tfengine,e._tfengine}Pc.nextTensorId=0,Pc.nextVariableId=0;const Wc=Vc();function Gc(e,t){const n={a:e,b:t};return Wc.runKernel(ba,n)}let Uc;function qc(e){if(void 0!==Uc)return Uc;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function jc(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const Hc=ca();function $c(e,t){let n=e;if(sc(e))return"string"===t?[]:[e.length];if(Oc(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Rc(e))return[e.buffer.size/(null==t?4:ji(t))];if(!Array.isArray(e))return[];const s=[];for(;Array.isArray(n)||sc(n)&&"string"!==t;)s.push(n.length),n=n[0];return Array.isArray(e)&&ca().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Kc(e,s,[]),s}function Kc(e,t,n){if(n=n||[],!Array.isArray(e)&&!sc(e))return void Ni(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));Ni(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),Ni(e.length===t[0],(()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const s=t.slice(1);for(let t=0;t=0&&(r=s),Xc(s,r,t,n),null==e||!sc(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const s=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const i=$c(e,r);sc(e)||Array.isArray(e)||(e=[e]);const a="string"!==r?Ju(e,r):rc(e,[],!0);return Wc.makeTensor(a,i,r)}function Yc(e,t,n,s="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,r)=>Zc(e,`${t}[${r}]`,n,s)))}Hc.registerFlag("DEBUG",(()=>!1),(e=>{})),Hc.registerFlag("IS_BROWSER",(()=>jc())),Hc.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),Hc.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),Hc.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),Hc.registerFlag("PROD",(()=>!1)),Hc.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>Hc.getBool("DEBUG"))),Hc.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),Hc.registerFlag("IS_TEST",(()=>!1)),Hc.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>Hc.getBool("DEBUG"))),Hc.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),Hc.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),Hc.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1));const Qc="__op";function Jc(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const s=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=Qc;const r=(...e)=>{Wc.startScope(n);try{const t=s(...e);return aa(t),Wc.endScope(t),t}catch(e){throw Wc.endScope(null),e}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}const eh=Jc({complex_:function(e,t){const n=Zc(e,"real","complex"),s=Zc(t,"imag","complex");Oi(n.shape,s.shape,`real and imag shapes, ${n.shape} and ${s.shape}, must match in call to tf.complex().`);const r={real:n,imag:s};return Wc.runKernel(Wa,r)}});function th(e,t,n,s){if(null==s)s=Ki(e);else if("complex64"===s)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(Rc(e)||Oc(e)){if("float32"!==s&&"int32"!==s)throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${s}.`);return Wc.backend.createTensorFromGPUData(e,t||n,s)}if(!sc(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){sa(t);const e=Di(t),s=Di(n);Ni(e===s,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${s}`));for(let e=0;e`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `))}}return sc(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==s?Ju(e,s):rc(e,[],!0),Wc.makeTensor(e,t,s)}function nh(e,t,n){return th(e,t,$c(e,n),n)}const sh={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};class rh{static join(e){return new rh(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>sc(e)?e.buffer:e))).length)return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let n=0;n=this.byteLength)return-1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;const n=function(e,t){let n=0,s=e.length;for(;n<=s;){const r=Math.floor((s-n)/2)+n,i=t(e[r]);if(0===i)return r;i<0?s=r:n=r+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}function ih(){return Wc}function ah(){return Wc.memory()}function oh(e,t){return Wc.tidy(e,t)}function lh(e){Fc(e).forEach((e=>e.dispose()))}function uh(e){return Wc.keep(e)}function ch(e,t,n=1){return Wc.registerBackend(e,t,n)}function hh(){return Wc.backend}wc=function(e){ca().getBool("DEPRECATION_WARNINGS_ENABLED")};const dh=4;async function ph(e,t){const n=[],s=[],r=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let i=0;i{const t=await o.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+dh*t.length,s=new Uint8Array(n);let r=0;for(let e=0;en.slice(r+e,r+t)));s[e.name]=yh(e,n.slice(r,r+t)),r+=t}return s}function mh(e,t){const n=Di(e.shape);let s;if("quantization"in e){const t=e.quantization;s=sh[t.dtype]}else{if("string"===e.dtype){let e=0;for(let s=0;s{let t=e<<13,n=0;for(;!(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return s=>{const r=new ArrayBuffer(4*s.length),i=new Uint32Array(r);for(let r=0;r>10]+(1023&a)]+t[a>>10];i[r]=o}return new Float32Array(r)}}();a=e(u)}}else{if("int32"!==s)throw new Error(`Unsupported dtype in weight '${n}': ${s}`);if("uint8"!==r.dtype&&"uint16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type int32.`);a=new Int32Array(u.length);for(let e=0;e(r=await bh(s,r,t),r.slice(e,t))));r=await bh(s,r,t);const i=r.slice(0,t);r=r.slice(t);const a=yh(e,i);if(n[e.name]=a,"webgpu"===Wc.backendName){const e=hh();"uploadToGPU"in e&&Di(a.shape)>=ca().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(a.dataId)}}return n}function vh(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const n=[];e.forEach((e=>{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const s=new Uint8Array(t);let r=0;return n.forEach((e=>{s.set(new Uint8Array(e.buffer),r),r+=e.byteLength})),s.buffer}const Ah="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function xh(e){return Ah?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function Ch(e){return rh.join(e)}function kh(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function Sh(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(n.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function _h(e,t,n){const s={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(s.trainingConfig=e.trainingConfig),null!=e.weightsManifest){if(!t)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");s.weightSpecs=t,s.weightData=n}return null!=e.signature&&(s.signature=e.signature),null!=e.userDefinedMetadata&&(s.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(s.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(s.initializerSignature=e.initializerSignature),s}async function Eh(e,t){let n,s;return null!=e.weightsManifest&&([n,s]=await t(e.weightsManifest)),_h(e,n,s)}function Ih(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:xh(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:xh(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new rh(e.weightData).byteLength}}function Th(e){const t=[];for(const n of e)t.push(...n.weights);return t}class Nh{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==Nh.instance&&(Nh.instance=new Nh),Nh.instance}static registerSaveRouter(e){Nh.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Nh.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Nh.getHandlers(e,"save")}static getLoadHandlers(e,t){return Nh.getHandlers(e,"load",t)}static getHandlers(e,t,n){const s=[];return("load"===t?Nh.getInstance().loadRouters:Nh.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&s.push(r)})),s}}const Oh=e=>Nh.registerSaveRouter(e),Rh=e=>Nh.registerLoadRouter(e),Dh=e=>Nh.getSaveHandlers(e),Mh=(e,t)=>Nh.getLoadHandlers(e,t),Fh="tensorflowjs",Bh="models_store",zh="model_info_store";function Lh(){if(!ca().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Ph(e){const t=e.result;t.createObjectStore(Bh,{keyPath:"modelPath"}),t.createObjectStore(zh,{keyPath:"modelPath"})}class Vh{constructor(e){if(this.indexedDB=Lh(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,n)=>{const s=this.indexedDB.open(Fh,1);s.onupgradeneeded=()=>Ph(s),s.onsuccess=()=>{const r=s.result;if(null==t){const t=r.transaction(Bh,"readonly"),s=t.objectStore(Bh).get(this.modelPath);s.onsuccess=()=>{if(null==s.result)return r.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(s.result.modelArtifacts)},s.onerror=e=>(r.close(),n(s.error)),t.oncomplete=()=>r.close()}else{t.weightData=rh.join(t.weightData);const s=Ih(t),i=r.transaction(zh,"readwrite");let a,o,l=i.objectStore(zh);try{a=l.put({modelPath:this.modelPath,modelArtifactsInfo:s})}catch(e){return n(e)}a.onsuccess=()=>{o=r.transaction(Bh,"readwrite");const a=o.objectStore(Bh);let u;try{u=a.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:s})}catch(e){return n(e)}u.onsuccess=()=>e({modelArtifactsInfo:s}),u.onerror=e=>{l=i.objectStore(zh);const t=l.delete(this.modelPath);t.onsuccess=()=>(r.close(),n(u.error)),t.onerror=e=>(r.close(),n(u.error))}},a.onerror=e=>(r.close(),n(a.error)),i.oncomplete=()=>{null==o?r.close():o.oncomplete=()=>r.close()}}},s.onerror=e=>n(s.error)}))}}Vh.URL_SCHEME="indexeddb://";const Wh=e=>{return ca().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Vh.URL_SCHEME)?(t=e.slice(Vh.URL_SCHEME.length),new Vh(t)):null;var t};Nh.registerSaveRouter(Wh),Nh.registerLoadRouter(Wh);class Gh{constructor(){this.indexedDB=Lh()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(Fh,1);n.onupgradeneeded=()=>Ph(n),n.onsuccess=()=>{const s=n.result,r=s.transaction(zh,"readonly"),i=r.objectStore(zh).getAll();i.onsuccess=()=>{const t={};for(const e of i.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},i.onerror=e=>(s.close(),t(i.error)),r.oncomplete=()=>s.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(Vh.URL_SCHEME)?t.slice(Vh.URL_SCHEME.length):t,new Promise(((t,n)=>{const s=this.indexedDB.open(Fh,1);s.onupgradeneeded=()=>Ph(s),s.onsuccess=()=>{const r=s.result,i=r.transaction(zh,"readwrite"),a=i.objectStore(zh),o=a.get(e);let l;o.onsuccess=()=>{if(null==o.result)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const s=a.delete(e),i=()=>{l=r.transaction(Bh,"readwrite");const s=l.objectStore(Bh).delete(e);s.onsuccess=()=>t(o.result.modelArtifactsInfo),s.onerror=e=>n(o.error)};s.onsuccess=i,s.onerror=e=>(i(),r.close(),n(o.error))}},o.onerror=e=>(r.close(),n(o.error)),i.oncomplete=()=>{null==l?r.close():l.oncomplete=()=>r.close()}},s.onerror=e=>n(s.error)}))}}const Uh="/",qh="tensorflowjs_models",jh="info",Hh="model_topology",$h="weight_specs",Kh="weight_data",Xh="model_metadata";function Zh(e){return{info:[qh,e,jh].join(Uh),topology:[qh,e,Hh].join(Uh),weightSpecs:[qh,e,$h].join(Uh),weightData:[qh,e,Kh].join(Uh),modelMetadata:[qh,e,Xh].join(Uh)}}function Yh(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function Qh(e){const t=e.split(Uh);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(Uh)}class Jh{constructor(e){if(!ca().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=Zh(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),s=Ih(e),r=rh.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(s)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(Ah)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,s=t.length;e{return ca().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Jh.URL_SCHEME)?(t=e.slice(Jh.URL_SCHEME.length),new Jh(t)):null;var t};Nh.registerSaveRouter(ed),Nh.registerLoadRouter(ed);class td{constructor(){Ni(ca().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),Ni("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=qh+Uh,n=Uh+jh;for(let s=0;s"scheme must not be undefined or null.")),e.endsWith(nd)&&(e=e.slice(0,e.indexOf(nd))),Ni(e.length>0,(()=>"scheme must not be an empty string."));const n=sd.getInstance();Ni(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=sd.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(sd.getInstance().managers)}}function rd(e){if(-1===e.indexOf(nd))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${sd.getSchemes().join(",")}`);return{scheme:e.split(nd)[0],path:e.split(nd)[1]}}async function id(e,t,n=!1){Ni(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=Nh.getLoadHandlers(e);Ni(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),Ni(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const r=s[0],i=Nh.getSaveHandlers(t);Ni(i.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),Ni(i.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const a=i[0],o=rd(e).scheme,l=rd(e).path,u=o===rd(e).scheme,c=await r.load();n&&u&&await sd.getManager(o).removeModel(l);const h=await a.save(c);return n&&!u&&await sd.getManager(o).removeModel(l),h.modelArtifactsInfo}async function ad(){const e=sd.getSchemes(),t={};for(const n of e){const e=await sd.getManager(n).listModels();for(const s in e){t[n+nd+s]=e[s]}}return t}async function od(e){const t=rd(e);return sd.getManager(t.scheme).removeModel(t.path)}async function ld(e,t){return id(e,t,!1)}async function ud(e,t){return id(e,t,!0)}class cd{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){"undefined"!=typeof window&&ca().getBool("USE_SETTIMEOUTCUSTOM")?(this.functionRefs.push(e),setTimeout((()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")}),t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",(e=>{if(e.source===window&&e.data.name===this.messageName){e.stopPropagation();(0,this.functionRefs[e.data.index])(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}}),!0))):setTimeout(e,t)}isTypedArray(e){return zu(e)}}if(ca().get("IS_BROWSER")){ca().setPlatform("browser",new cd);try{sd.registerManager(Jh.URL_SCHEME,new td)}catch(e){}try{sd.registerManager(Vh.URL_SCHEME,new Gh)}catch(e){}}const hd=()=>__webpack_require__(8273);let dd;class pd{constructor(){this.util=__webpack_require__(9830),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=ca().global.fetch?ca().global.fetch(e,t):(null==dd&&(dd=hd()),dd(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}function fd(e,t="float32",n){return t=t||"float32",sa(e),new gc(e,t,n)}ca().get("IS_NODE")&&!ca().get("IS_BROWSER")&&ca().setPlatform("node",new pd);const md=Jc({cast_:function(e,t){const n=Zc(e,"x","cast");if(!function(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const s={x:n},r={dtype:t};return Wc.runKernel(La,s,r)}});const gd=Jc({clone_:function(e){const t={x:Zc(e,"x","clone","string_or_numeric")};return Wc.runKernel(Oo,t)}});function yd(e,t=!1){}Vc();bc={buffer:fd,cast:md,clone:gd,print:yd};const bd=Jc({add_:function(e,t){let n=Zc(e,"a","add"),s=Zc(t,"b","add");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(ba,r)}});const wd=Jc({floorDiv_:function(e,t){let n=Zc(e,"a","floorDiv"),s=Zc(t,"b","floorDiv");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(So,r)}});const vd=Jc({div_:function(e,t){let n=Zc(e,"a","div"),s=Zc(t,"b","div");if([n,s]=Dc(n,s),"int32"===n.dtype&&"int32"===s.dtype)return wd(n,s);const r={a:n,b:s};return Wc.runKernel(ho,r,{})}});const Ad=Jc({mul_:function(e,t){let n=Zc(e,"a","mul"),s=Zc(t,"b","mul");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(ol,r)}});const xd=Jc({sqrt_:function(e){const t={x:Zc(e,"x","sqrt","float32")};return Wc.runKernel($l,t)}});const Cd=Jc({square_:function(e){const t=Zc(e,"x","square");return Wc.runKernel("Square",{x:t},{})}});const kd=Jc({zerosLike_:function(e){const t={x:Zc(e,"x","zerosLike")};return Wc.runKernel(vu,t)}});function Sd(e){return Wc.customGrad(e)}function _d(e,t){if((sc(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&sc(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return th(e,[],[],t)}const Ed=new Map,Id=new Map;class Td{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Nd{constructor(){this.classNameMap={}}static getMap(){return null==Nd.instance&&(Nd.instance=new Nd),Nd.instance}static register(e){Nd.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Od(e,t,n){Ni(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),Ni("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),Ni(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),void 0===t&&(t="Custom"),void 0===n&&(n=e.className);const s=t+">"+n;return Nd.register(e),Ed.set(s,e),Id.set(e,s),e}class Rd extends Td{minimize(e,t=!1,n){const{value:s,grads:r}=this.computeGradients(e,n);if(null!=n){const e=n.map((e=>({name:e.name,tensor:r[e.name]})));this.applyGradients(e)}else this.applyGradients(r);return lh(r),t?s:(s.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return function(e,t){Ni(Xi(e),(()=>"The f passed in variableGrads(f) must be a function")),Ni(null==t||Array.isArray(t)&&t.every((e=>e instanceof xc)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in Wc.registeredVariables)t.push(Wc.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,r=t.length;t=t.filter((e=>e.trainable)),Ni(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`));const{value:i,grads:a}=Wc.gradients(e,t,null,!0);Ni(a.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),Ni(0===i.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`));const o={};return t.forEach(((e,t)=>{null!=a[t]&&(o[e.name]=a[t])})),null!=s&&s.forEach((e=>o[e.name]=null)),{value:i,grads:o}}(e,t)}dispose(){null!=this.iterations_&&lh(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:_d(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(Rd,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class Dd extends Rd{static get className(){return"Adadelta"}constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=Wc.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t],r=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:oh((()=>kd(s).variable(r)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:oh((()=>kd(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;oh((()=>{const e=bd(Ad(a,this.rho),Ad(Cd(i),1-this.rho)),t=Ad(vd(xd(bd(o,this.epsilon)),xd(bd(a,this.epsilon))),i),n=bd(Ad(o,this.rho),Ad(Cd(t),1-this.rho));a.assign(e),o.assign(n);const r=bd(Ad(t,-this.learningRate),s);s.assign(r)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(lh(this.accumulatedGrads.map((e=>e.variable))),lh(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}function Md(e,t,n){sa(e);const s={shape:e,value:t,dtype:n=n||Ki(t)};return Wc.runKernel(xo,{},s)}class Fd extends Rd{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:oh((()=>Md(s.shape,this.initialAccumulatorValue).variable(e)))}}const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const i=this.accumulatedGrads[n].variable;oh((()=>{const e=bd(i,Cd(r));i.assign(e);const t=bd(Ad(vd(r,xd(bd(e,Wc.backend.epsilon()))),-this.learningRate),s);s.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&lh(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}const Bd=Jc({pow_:function(e,t){let n=Zc(e,"base","pow"),s=Zc(t,"exp","pow");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(yl,r)}});const zd=Jc({sub_:function(e,t){let n=Zc(e,"a","sub"),s=Zc(t,"b","sub");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(cu,r)}});class Ld extends Rd{static get className(){return"Adam"}constructor(e,t,n,s=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=s,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],oh((()=>{this.accBeta1=_d(t).variable(),this.accBeta2=_d(n).variable()})),null==s&&(this.epsilon=Wc.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);oh((()=>{const n=zd(1,this.accBeta1),s=zd(1,this.accBeta2);t.forEach(((t,r)=>{const i=Wc.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:oh((()=>kd(i).variable(a)))}),null==this.accumulatedSecondMoment[r]&&(this.accumulatedSecondMoment[r]={originalName:`${t}/v`,variable:oh((()=>kd(i).variable(a)))});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedSecondMoment[r].variable,c=bd(Ad(l,this.beta1),Ad(o,1-this.beta1)),h=bd(Ad(u,this.beta2),Ad(Cd(o),1-this.beta2)),d=vd(c,n),p=vd(h,s);l.assign(c),u.assign(h);const f=bd(Ad(vd(d,bd(xd(p),this.epsilon)),-this.learningRate),i);i.assign(f)})),this.accBeta1.assign(Ad(this.accBeta1,this.beta1)),this.accBeta2.assign(Ad(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&lh(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&lh(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),oh((()=>{this.accBeta1.assign(Bd(this.beta1,this.iterations_+1)),this.accBeta2.assign(Bd(this.beta2,this.iterations_+1))}));const t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}const Pd=Jc({abs_:function(e){const t=Zc(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return Wc.runKernel(Ga,e)}{const e={x:t};return Wc.runKernel(ma,e)}}});function Vd(e,t){const n=e.length,s=[];for(let r=0;r1&&1===a&&s.unshift(i)}return s}function Wd(e,t){const n=[];for(let s=0;s1)&&n.unshift(i)}return n}function Gd(e,t){const n=Math.max(e.length,t.length),s=new Array(n);for(let r=0;r{this.iteration=_d(0).variable(),this.accBeta1=_d(t).variable()})),null==s&&(this.epsilon=Wc.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);oh((()=>{const n=zd(1,this.accBeta1),s=vd(-this.learningRate,bd(Ad(this.iteration,this.decay),1));t.forEach(((t,r)=>{const i=Wc.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:kd(i).variable(a)}),null==this.accumulatedWeightedInfNorm[r]&&(this.accumulatedWeightedInfNorm[r]={originalName:`${t}/v`,variable:kd(i).variable(a)});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedWeightedInfNorm[r].variable,c=bd(Ad(l,this.beta1),Ad(o,1-this.beta1)),h=Ad(u,this.beta2),d=Pd(o),p=Ud(h,d);l.assign(c),u.assign(p);const f=bd(Ad(vd(s,n),vd(c,bd(p,this.epsilon))),i);i.assign(f)})),this.iteration.assign(bd(this.iteration,1)),this.accBeta1.assign(Ad(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&lh(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&lh(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}class jd extends Rd{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const r=Wc.registeredVariables[t];oh((()=>{const e=bd(Ad(this.c,s),r);r.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=uh(_d(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}class Hd extends jd{static get className(){return"Momentum"}constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=_d(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:oh((()=>kd(s).variable(e)))}}const r=this.accumulations[n].variable,i=Array.isArray(e)?e[n].tensor:e[t];null!=i&&oh((()=>{let e;const t=bd(Ad(this.m,r),i);e=this.useNesterov?bd(Ad(this.c,bd(i,Ad(t,this.m))),s):bd(Ad(this.c,t),s),r.assign(t),s.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&lh(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}class $d extends Rd{static get className(){return"RMSProp"}constructor(e,t=.9,n=0,s=null,r=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=s,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,null==s&&(this.epsilon=Wc.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Wc.registeredVariables[t],r=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:oh((()=>kd(s).variable(r)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:oh((()=>kd(s).variable(r)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:oh((()=>kd(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;oh((()=>{const e=bd(Ad(a,this.decay),Ad(Cd(i),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,r=bd(Ad(t,this.decay),Ad(i,1-this.decay)),l=vd(Ad(i,this.learningRate),xd(zd(e,bd(Cd(r),this.epsilon)))),u=bd(Ad(o,this.momentum),l);a.assign(e),t.assign(r),o.assign(u);const c=zd(s,u);s.assign(c)}else{const e=bd(Ad(a,this.decay),Ad(Cd(i),1-this.decay)),t=bd(Ad(o,this.momentum),vd(Ad(i,this.learningRate),xd(bd(e,this.epsilon))));a.assign(e),o.assign(t);const n=zd(s,t);s.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&lh(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&lh(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&lh(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}const Kd=[Dd,Fd,Ld,qd,Hd,$d,jd];function Xd(e){return new Promise((e=>setTimeout(e))).then(e)}class Zd{constructor(e){if(!ca().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(Zd.URL_SCHEME)&&(e=e.slice(Zd.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=rh.join(e.weightData),n=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const t=Sh(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),s=window.URL.createObjectURL(new Blob([JSON.stringify(t)],{type:"application/json"})),r=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(r.download=this.modelJsonFileName,r.href=s,await Xd((()=>r.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=n,await Xd((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Ih(e)}}}}Zd.URL_SCHEME="downloads://";class Yd{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const s=JSON.parse(n.target.result),r=s.modelTopology;if(null==r)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==s.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:r});const i=Eh(s,(e=>this.loadWeights(e)));e(i)},n.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),n.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],n=[];for(const s of e)t.push(...s.weights),n.push(...s.paths);const s=this.checkManifestAndWeightFiles(e),r=n.map((e=>this.loadWeightsFile(e,s[e])));return Promise.all(r).then((e=>[t,e]))}loadWeightsFile(e,t){return new Promise(((n,s)=>{const r=new FileReader;r.onload=e=>{const t=e.target.result;n(t)},r.onerror=t=>s(`Failed to weights data from file of path '${e}'.`),r.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map((e=>kh(e.name))),s={};for(const r of e)r.paths.forEach((e=>{const r=kh(e);if(-1!==t.indexOf(r))throw new Error(`Duplicate file basename found in weights manifest: '${r}'`);if(t.push(r),-1===n.indexOf(r))throw new Error(`Weight file with basename '${r}' is not provided.`);s[e]=this.weightsFiles[n.indexOf(r)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return s}}function Qd(e){return new Yd(e)}function Jd(e,t,n,s){!function(e){Ni(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){Ni(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),Ni(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),Ni(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(n=null==n?0:n,s=null==s?1:s);let r=0;return Promise.all(e.map((i=>(i.then((i=>{const a=n+ ++r/e.length*(s-n);return t(a),i})),i))))}async function ep(e,t){null==t&&(t={});const n=null==t.fetchFunc?ca().platform.fetch:t.fetchFunc,s=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),r=(null==t.onProgress?await Promise.all(s):await Jd(s,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(r):await Jd(r,t.onProgress,.5,1)}async function tp(e,t="",n,s){return np((e=>ep(e,{requestInit:s})))(e,t,n)}function np(e){return async(t,n="",s)=>{const r=t.map((()=>!1)),i={},a=null!=s?s.map((()=>!1)):[],o=[];if(t.forEach(((e,t)=>{let n=0;e.weights.forEach((e=>{const l="quantization"in e?e.quantization.dtype:e.dtype,u=sh[l]*Di(e.shape),c=()=>{r[t]=!0,null==i[t]&&(i[t]=[]),i[t].push({manifestEntry:e,groupOffset:n,sizeBytes:u})};null!=s?s.forEach(((t,n)=>{t===e.name&&(c(),a[n]=!0)})):c(),o.push(e.name),n+=u}))})),!a.every((e=>e))){const e=s.filter(((e,t)=>!a[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${o.join(", ")}.`)}const l=r.reduce(((e,t,n)=>(t&&e.push(n),e)),[]),u=[];l.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;u.push(t)}))}));const c=await e(u),h={};let d=0;return l.forEach((e=>{const n=t[e].paths.length,s=new rh(c.slice(d,d+n));i[e].forEach((e=>{const t=fh(s.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)h[e]=t[e]})),d+=n})),h}}Nh.registerSaveRouter((e=>ca().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Zd.URL_SCHEME)?function(e="model"){return new Zd(e)}(e.slice(Zd.URL_SCHEME.length)):null));class sp{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(Ni("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=ca().platform.fetch,Ni(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&Ni(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{},this.loadOptions=t}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=Sh(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData){const n=rh.join(e.weightData);t.body.append("model.weights.bin",new Blob([n],{type:"application/octet-stream"}),"model.weights.bin")}const s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:Ih(e),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,s=t.weightsManifest;if(null==n&&null==s)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();return Eh(await this.loadModelJSON(),(e=>this.loadWeights(e)))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),n=Th(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:n,getWeightStream:()=>function(e,t){var n;const s=null==t.fetchFunc?ca().platform.fetch:t.fetchFunc;let r,i=0;return null===(n=t.onProgress)||void 0===n||n.call(t,0),new ReadableStream({pull:async n=>{for(var a;it?e.substring(n):"";return[s+"/",r]}(t),r=this.weightPathPrefix||n,i=[],a=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?a.push(this.weightUrlConverter(e)):i.push(r+e+s);return this.weightUrlConverter&&i.push(...await Promise.all(a)),i}async loadWeights(e){const t=await this.getWeightUrls(e);return[Th(e),await ep(t,this.loadOptions)]}}function rp(e){return null!=e.match(sp.URL_SCHEME_REGEX)}sp.URL_SCHEME_REGEX=/^https?:\/\//;const ip=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>rp(e))):rp(e),n)return ap(e,t)}return null};function ap(e,t){return new sp(e,t)}function op(e,t){return ap(e,t)}Nh.registerSaveRouter(ip),Nh.registerLoadRouter(ip);class lp{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class up{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class cp{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function hp(e,t,n,s){return new cp(dp(...arguments))}function dp(e,t,n,s){if(1===arguments.length){const t=null!=e.modelTopology||null!=e.weightSpecs;return new lp(t?e:{modelTopology:e})}return new lp({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:s})}function pp(e){return new up(e)}function fp(e){return new up(e)}function mp(e,t,n){if(Ri(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const s=$c(e,n);if(3!==s.length&&1!==s.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return th(e,t,s,n)}let gp,yp=!1;function bp(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,s=!1,r=!1,i=!1,a=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)s=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)r=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)i=!0;else if(null!=e.getContext)a=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);o=!0}if(null!=Ou(xu,Wc.backendName)){const n={pixels:e},s={numChannels:t};return Wc.runKernel(xu,n,s)}const[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height];let c,h;if(a)c=e.getContext("2d").getImageData(0,0,l,u).data;else if(s||n)c=e.data;else if(i||r||o){if(null==gp)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");gp=new OffscreenCanvas(1,1).getContext("2d")}else gp=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});gp.canvas.width=l,gp.canvas.height=u,gp.drawImage(e,0,0,l,u),c=gp.getImageData(0,0,l,u).data}if(4===t)h=new Int32Array(c);else{const e=l*u;h=new Int32Array(e*t);for(let n=0;n4||2===t)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if("float32"!==e.dtype&&"int32"!==e.dtype)throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}async function vp(e,t){let n=Zc(e,"img","toPixels");if(!(e instanceof vc)){const e=n;n=md(e,"int32"),e.dispose()}wp(n);const[s,r]=n.shape.slice(0,2),i=2===n.rank?1:n.shape[2],a=await n.data(),o="float32"===n.dtype?255:1,l=new Uint8ClampedArray(r*s*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${r}.`)}else if("int32"===n.dtype&&(r<0||r>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${r}.`);1===i?(t[0]=r*o,t[1]=r*o,t[2]=r*o):t[s]=r*o}const s=4*e;l[s+0]=Math.round(t[0]),l[s+1]=Math.round(t[1]),l[s+2]=Math.round(t[2]),l[s+3]=Math.round(t[3])}if(null!=t){if(!yp){null!=Ou(co,Wc.backendName)&&(yp=!0)}t.width=r,t.height=s;const e=t.getContext("2d"),n=new ImageData(l,r,s);e.putImageData(n,0,0)}return n!==e&&n.dispose(),l}const Ap=Jc({fromPixels_:bp}),xp=-2,Cp=-1;function kp(e,t,n){const s=e.shape.length;Ni(s===t.length,(()=>`Error in slice${s}D: Length of begin ${t} must match the rank of the array (${s}).`)),Ni(s===n.length,(()=>`Error in slice${s}D: Length of size ${n} must match the rank of the array (${s}).`));for(let r=0;r`Error in slice${s}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`))}function Sp(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function _p(e,t,n){const s=[];for(let r=0;r0){const l=t[0],u=n+1;c=Op(a,l,u,s,e),h=Rp(o,l,u,r,e),d=Ep(i,l,u,e)}else for(let t=0;t-1)i[r]=0;else{const a=Ip(t,n,r);let o=s[a];e&1<-1)i[r]=Number.MAX_SAFE_INTEGER;else{const a=Ip(t,n,r);let o=s[a];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=Ei(0,a,l-1),a}function Fp(e,t,n,s,r,i){let a=t[r];const o=n[r]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=o>0?Ei(0,a,l):Ei(-1,a,l-1),a}function Bp(e,t,n){let s=n.length;for(let e=0;e1){s=e;break}for(let r=s+1;r0||n[r]!==e[r])return!1;return!0}function zp(e,t){let n=e.length>0?e[e.length-1]:1;for(let s=0;s{Ni(-1!==e,(()=>"slice() does not support negative begin indexing."))})),i=null==n?new Array(r).fill(-1):"number"==typeof n?[n,...new Array(r-1).fill(-1)]:n.lengtht>=0?t:(Ni(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`)),e.shape[n]-s[n]))),[s,i]}function Pp(e,t,n,s,r,i,a,o,l){let u;if(null==s?(u=new Array(t.length),u.fill(1)):u=s,null!=a&&a&a-1)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const h={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:u.slice(),beginMask:r,endMask:i,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};for(let e=0;e0?0:-1,d.strides[t]>0?s:s-1];if(n&&d.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===d.strides[t];const a=!!(d.beginMask&1<=s)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=Vp(d.begin[t],0,d.strides[t],s,r,i),d.end[t]=Vp(d.end[t],1,d.strides[t],s,r,i);const e=1===d.strides[t]&&0===d.begin[t]&&d.end[t]===s;p=p&&e,f=f&&(0===t&&1===d.strides[t]||e)}else p=p&&1===d.strides[t]&&a,f=f&&(0===t&&1===d.strides[t]||a);let o,l=!1;if(d.beginValid&&d.endValid?(o=d.end[t]-d.begin[t],l=!0):n?(o=1,l=!0):a&&s>=0&&(o=d.strides[t]<0?-s:s,l=!0),l){let e;e=0===o||o<0!=d.strides[t]<0?0:Math.trunc(o/d.strides[t])+(o%d.strides[t]!=0?1:0),g.push(e)}else g.push(-1)}for(let e=0;e=0?y.push(g[t]):t===xp&&y.push(1)}return{finalShapeSparse:y.filter(((e,t)=>d.finalShapeGatherIndices[t]!==xp)),finalShape:y,isIdentity:p,sliceDim0:f,isSimpleSlice:m,begin:d.begin,end:d.end,strides:d.strides}}function Vp(e,t,n,s,r,i){if(r[t])return n>0?i[t]:i[t+1&1];{const t=e<0?s+e:e;return ti[1]?i[1]:t}}const Wp=Jc({acos_:function(e){const t={x:Zc(e,"x","acos")};return Wc.runKernel(ga,t)}});const Gp=Jc({acosh_:function(e){const t={x:Zc(e,"x","acosh")};return Wc.runKernel(ya,t)}});const Up=Jc({addN_:function(e){Ni(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),Ni(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>Zc(e,`tensors${t}`,"addN"))),n=t[0];t.forEach((e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!Mi(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const s=t;return Wc.runKernel(wa,s)}});const qp=Jc({all_:function(e,t=null,n=!1){const s={x:Zc(e,"x","all","bool")},r={axis:t,keepDims:n};return Wc.runKernel(va,s,r)}});const jp=Jc({any_:function(e,t=null,n=!1){const s={x:Zc(e,"x","any","bool")},r={axis:t,keepDims:n};return Wc.runKernel(Aa,s,r)}});const Hp=Jc({argMax_:function(e,t=0){const n={x:Zc(e,"x","argMax")},s={axis:t};return Wc.runKernel(xa,n,s)}});const $p=Jc({argMin_:function(e,t=0){const n={x:Zc(e,"x","argMin")},s={axis:t};return Wc.runKernel(Ca,n,s)}});const Kp=Jc({asin_:function(e){const t={x:Zc(e,"x","asin")};return Wc.runKernel(ka,t)}});const Xp=Jc({asinh_:function(e){const t={x:Zc(e,"x","asinh")};return Wc.runKernel(Sa,t)}});const Zp=Jc({atan_:function(e){const t={x:Zc(e,"x","atan")};return Wc.runKernel(_a,t)}});const Yp=Jc({atan2_:function(e,t){let n=Zc(e,"a","atan2"),s=Zc(t,"b","atan2");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(Ia,r)}});const Qp=Jc({atanh_:function(e){const t={x:Zc(e,"x","atanh")};return Wc.runKernel(Ea,t)}});function Jp(e,t,n,s,r="NHWC",i){return nf(e,[...t,e[3]],n,i,s,null,null,pf(r))}function ef(e,t,n,s,r,i,a="channelsLast"){const[o,l]=af(t);let u;if("channelsLast"===a)u=[o,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);u=[o,l,e[1],e[1]]}return nf(e,u,n,s,r,i,!1,a)}function tf(e,t,n,s,r,i,a="NDHWC"){const[o,l,u]=of(t);let c,h;if("NDHWC"===a)h="channelsLast",c=[o,l,u,e[4],e[4]];else{if("NCDHW"!==a)throw new Error(`Unknown dataFormat ${a}`);h="channelsFirst",c=[o,l,u,e[1],e[1]]}return sf(e,c,n,s,r,!1,h,i)}function nf(e,t,n,s,r,i,a=!1,o="channelsLast"){let[l,u,c,h]=[-1,-1,-1,-1];if("channelsLast"===o)[l,u,c,h]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,h,u,c]=e}const[d,p,,f]=t,[m,g]=af(n),[y,b]=af(s),w=lf(d,y),v=lf(p,b),{padInfo:A,outHeight:x,outWidth:C}=function(e,t,n,s,r,i,a,o,l){let u,c,h;if("number"==typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const r=function(e,t,n,s,r){null==s&&(s=rf(e,t,n));const i=e[0],a=e[1],o=uf((i-t+2*s)/n+1,r),l=uf((a-t+2*s)/n+1,r);return[o,l]}([t,n],i,s,e,o);c=r[0],h=r[1]}else if("same"===e){c=Math.ceil(t/s),h=Math.ceil(n/r);const e=Math.max(0,(c-1)*s+i-t),o=Math.max(0,(h-1)*r+a-n),l=Math.floor(e/2),d=e-l,p=Math.floor(o/2);u={top:l,bottom:d,left:p,right:o-p,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((t-i+1)/s),h=Math.ceil((n-a+1)/r);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const d="channelsLast"===l?e[1][0]:e[2][0],p="channelsLast"===l?e[1][1]:e[2][1],f="channelsLast"===l?e[2][0]:e[3][0],m="channelsLast"===l?e[2][1]:e[3][1];u={top:d,bottom:p,left:f,right:m,type:0===d&&0===p&&0===f&&0===m?"VALID":"EXPLICIT"},c=uf((t-i+d+p)/s+1,o),h=uf((n-a+f+m)/r+1,o)}}return{padInfo:u,outHeight:c,outWidth:h}}(r,u,c,m,g,w,v,i,o),k=a?f*h:f;let S;return"channelsFirst"===o?S=[l,k,x,C]:"channelsLast"===o&&(S=[l,x,C,k]),{batchSize:l,dataFormat:o,inHeight:u,inWidth:c,inChannels:h,outHeight:x,outWidth:C,outChannels:k,padInfo:A,strideHeight:m,strideWidth:g,filterHeight:d,filterWidth:p,effectiveFilterHeight:w,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:b,inShape:e,outShape:S,filterShape:t}}function sf(e,t,n,s,r,i=!1,a="channelsLast",o){let[l,u,c,h,d]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[l,u,c,h,d]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[l,d,u,c,h]=e}const[p,f,m,,g]=t,[y,b,w]=of(n),[v,A,x]=of(s),C=lf(p,v),k=lf(f,A),S=lf(m,x),{padInfo:_,outDepth:E,outHeight:I,outWidth:T}=function(e,t,n,s,r,i,a,o,l,u,c){let h,d,p,f;"valid"===e&&(e=0);if("number"==typeof e){h={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const m=function(e,t,n,s,r,i){null==r&&(r=rf(e,t[0],s[0]));const a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*r>=t[n]&&(a[n]=uf((e[n]-t[n]+2*r)/s[n]+1,i));return a}([t,n,s,1],[o,l,u],1,[r,i,a],e,c);d=m[0],p=m[1],f=m[2]}else{if("same"!==e)throw Error(`Unknown padding parameter: ${e}`);{d=Math.ceil(t/r),p=Math.ceil(n/i),f=Math.ceil(s/a);const e=(d-1)*r+o-t,c=(p-1)*i+l-n,m=(f-1)*a+u-s,g=Math.floor(e/2),y=e-g,b=Math.floor(c/2),w=c-b,v=Math.floor(m/2);h={top:b,bottom:w,left:v,right:m-v,front:g,back:y,type:"SAME"}}}return{padInfo:h,outDepth:d,outHeight:p,outWidth:f}}(r,u,c,h,y,b,w,C,k,S,o),N=i?g*d:g;let O;return"channelsFirst"===a?O=[l,N,E,I,T]:"channelsLast"===a&&(O=[l,E,I,T,N]),{batchSize:l,dataFormat:a,inDepth:u,inHeight:c,inWidth:h,inChannels:d,outDepth:E,outHeight:I,outWidth:T,outChannels:N,padInfo:_,strideDepth:y,strideHeight:b,strideWidth:w,filterDepth:p,filterHeight:f,filterWidth:m,effectiveFilterDepth:C,effectiveFilterHeight:k,effectiveFilterWidth:S,dilationDepth:v,dilationHeight:A,dilationWidth:x,inShape:e,outShape:O,filterShape:t}}function rf(e,t,n,s=1){const r=lf(t,s);return Math.floor((e[0]*(n-1)-n+r)/2)}function af(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function of(e){return"number"==typeof e?[e,e,e]:e}function lf(e,t){return t<=1?e:e+(e-1)*(t-1)}function uf(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function cf(e){const[t,n,s]=af(e);return 1===t&&1===n&&1===s}function hf(e,t){return cf(e)||cf(t)}function df(e){return af(e).every((e=>e>0))}function pf(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function ff(e,t,n){if(null!=n){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`);if("number"==typeof t)Ni(Fi(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`));else{if("object"!=typeof t)throw Error(`Error in ${e}: Unknown padding parameter: ${t}`);t.forEach((t=>{t.forEach((t=>{Ni(Fi(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}const mf=Jc({reshape_:function(e,t){const n={x:Zc(e,"x","reshape","string_or_numeric")},s={shape:t};return Wc.runKernel(El,n,s)}});const gf=Jc({avgPool_:function(e,t,n,s,r){const i=Zc(e,"x","avgPool","float32");Ni(hf(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let a=i,o=!1;3===i.rank&&(o=!0,a=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Ni(4===a.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${a.rank}.`)),ff("avgPool",s,r);const l={x:a},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r};let c=Wc.runKernel(Ta,l,u);return c=md(c,i.dtype),o?mf(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const yf=Jc({avgPool3d_:function(e,t,n,s,r,i="NDHWC"){const a=Zc(e,"x","avgPool3d","float32");let o=a,l=!1;4===a.rank&&(l=!0,o=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Ni(5===o.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`)),Ni("NDHWC"===i,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),Ni("number"==typeof n&&n>0||Array.isArray(n)&&n[0]>0&&n[1]>0&&n[2]>0,(()=>`Error in avgPool3d: Stride must be > 0, but got '${n}'`)),ff("avgPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i};let h=Wc.runKernel(Oa,u,c);return h=md(h,o.dtype),l?mf(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const bf=Jc({concat_:function(e,t=0){Ni(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=Yc(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${e.dtype}. `)})),1===n.length)return gd(n[0]);const s=n,r={axis:t};return Wc.runKernel(Ua,s,r)}});const wf=Jc({matMul_:function(e,t,n=!1,s=!1){let r=Zc(e,"a","matMul"),i=Zc(t,"b","matMul");[r,i]=Dc(r,i);const a={a:r,b:i},o={transposeA:n,transposeB:s};return Wc.runKernel(Da,a,o)}});const vf=Jc({sigmoid_:function(e){const t={x:Zc(e,"x","sigmoid","float32")};return Wc.runKernel(jl,t)}});const Af=Jc({slice_:function(e,t,n){const s=Zc(e,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const r={x:s},i={begin:t,size:n};return Wc.runKernel(Wl,r,i)}});const xf=Jc({tanh_:function(e){const t={x:Zc(e,"x","tanh","float32")};return Wc.runKernel(du,t)}});const Cf=Jc({basicLSTMCell_:function(e,t,n,s,r,i){const a=Zc(e,"forgetBias","basicLSTMCell"),o=Zc(t,"lstmKernel","basicLSTMCell"),l=Zc(n,"lstmBias","basicLSTMCell"),u=Zc(s,"data","basicLSTMCell"),c=Zc(r,"c","basicLSTMCell"),h=Zc(i,"h","basicLSTMCell"),d=bf([u,h],1),p=wf(d,o),f=bd(p,l),m=f.shape[0],g=f.shape[1]/4,y=[m,g],b=Af(f,[0,0],y),w=Af(f,[0,g],y),v=Af(f,[0,2*g],y),A=Af(f,[0,3*g],y),x=bd(Ad(vf(b),xf(w)),Ad(c,vf(bd(a,v))));return[x,Ad(xf(x),vf(A))]}});const kf=Jc({batchToSpaceND_:function(e,t,n){const s=Zc(e,"x","batchToSpaceND"),r=t.reduce(((e,t)=>e*t));Ni(s.rank>=1+t.length,(()=>`input rank is ${s.rank} but should be > than blockShape.length ${t.length}`)),Ni(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),Ni(s.shape[0]%r==0,(()=>`input tensor batch is ${s.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`));const i={x:s},a={blockShape:t,crops:n};return Wc.runKernel(Ma,i,a)}});const Sf=Jc({batchNorm_:function(e,t,n,s,r,i){null==i&&(i=.001);const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(o.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),Ni(null==c||o.rank===c.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),Ni(null==u||o.rank===u.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const h={x:function(e){let t;return t=0===e.rank||1===e.rank?mf(e,[1,1,1,e.size]):2===e.rank?mf(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?mf(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(a),scale:u,offset:c,mean:o,variance:l},d={varianceEpsilon:i},p=Wc.runKernel(_o,h,d);return mf(p,a.shape)}});const _f=Jc({batchNorm2d_:function(e,t,n,s,r,i){const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;return null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(2===a.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`)),Ni(2===o.rank||1===o.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`)),Ni(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=u&&Ni(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`)),null!=c&&Ni(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`)),Sf(a,o,l,c,u,i)}});const Ef=Jc({batchNorm3d_:function(e,t,n,s,r,i){const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;return null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(3===a.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`)),Ni(3===o.rank||1===o.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`)),Ni(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=u&&Ni(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`)),null!=c&&Ni(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`)),Sf(a,o,l,c,u,i)}});const If=Jc({batchNorm4d_:function(e,t,n,s,r,i){const a=Zc(e,"x","batchNorm"),o=Zc(t,"mean","batchNorm"),l=Zc(n,"variance","batchNorm");let u,c;return null!=r&&(u=Zc(r,"scale","batchNorm")),null!=s&&(c=Zc(s,"offset","batchNorm")),Ni(4===a.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`)),Ni(4===o.rank||1===o.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`)),Ni(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=u&&Ni(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`)),null!=c&&Ni(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`)),Sf(a,o,l,c,u,i)}});const Tf=Jc({bincount_:function(e,t,n){const s=Zc(e,"x","bincount"),r=Zc(t,"weights","bincount");Ni("int32"===s.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${s.dtype}`)),Ni(n>=0,(()=>`size must be non-negative, but got ${n}.`)),Ni(r.size===s.size||0===r.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${s.shape}, weights shape: ${r.shape}.`));const i={x:s,weights:r},a={size:n};return Wc.runKernel(Fa,i,a)}});const Nf=Jc({bitwiseAnd_:function(e,t){const n=Zc(e,"x","bitwiseAnd"),s=Zc(t,"y","bitwiseAnd");if(!Mi(n.shape,s.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${n.shape}, y: ${s.shape}`);if("int32"!==n.dtype||"int32"!==s.dtype)throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${n.dtype} and type of y: ${s.dtype}`);const r={a:n,b:s};return Wc.runKernel(Ba,r)}});const Of=Jc({broadcastArgs_:function(e,t){const n=Zc(e,"s0","broadcastArgs","int32"),s=Zc(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==s.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${s.rank}`);const r={s0:n,s1:s};return Wc.runKernel(za,r)}});const Rf=Jc({broadcastTo_:function(e,t){let n=Zc(e,"broadcastTo","x");const s=n.shape;if(sa(t),t.lengthn.rank){const e=n.shape.slice();for(;e.length=0;e--)if(r[e]===t[e])i[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${t}].`);if(0===i.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return gd(n);const a={x:n},o={reps:i};return Wc.runKernel(pu,a,o)}});const Df=Jc({ceil_:function(e){const t={x:Zc(e,"x","ceil","float32")};return Wc.runKernel(Pa,t)}});const Mf=Jc({clipByValue_:function(e,t,n){const s=Zc(e,"x","clipByValue");if(Ni(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return Md(s.shape,t,s.dtype);const r={x:s},i={clipValueMin:t,clipValueMax:n};return Wc.runKernel(Va,r,i)}});const Ff=Jc({concat1d_:function(e){return bf(e,0)}});const Bf=Jc({concat2d_:function(e,t){return bf(e,t)}});const zf=Jc({concat3d_:function(e,t){return bf(e,t)}});const Lf=Jc({concat4d_:function(e,t){return bf(e,t)}});const Pf=Jc({conv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=Zc(e,"x","conv2d","float32"),l=Zc(t,"filter","conv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),Ni(4===u.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`)),Ni(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),ff("conv2d",s,a);const h="NHWC"===r?u.shape[3]:u.shape[1];Ni(h===l.shape[2],(()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`)),Ni(hf(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),Ni(df(i),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),Ni(df(n),(()=>"Error in conv2D: Strides should be larger than 0."));const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=Wc.runKernel(qa,d,p);return c?mf(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Vf=Jc({conv1d_:function(e,t,n,s,r="NWC",i=1,a){const o=Zc(e,"x","conv1d"),l=Zc(t,"filter","conv1d");let u=o,c=!1;2===o.rank&&(c=!0,u=mf(o,[1,o.shape[0],o.shape[1]])),Ni(3===u.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`)),Ni(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),ff("conv1d",s,a),Ni(u.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),Ni(hf(n,i),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`)),Ni(df(i),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),Ni(df(n),(()=>"Error in conv1D: Stride should be larger than 0.")),Ni("NWC"===r,(()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`));const h=mf(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=mf(u,[u.shape[0],1,u.shape[1],u.shape[2]]),p=Pf(d,h,[1,n],s,"NHWC",[1,i],a);return mf(p,c?[p.shape[2],p.shape[3]]:[p.shape[0],p.shape[2],p.shape[3]])}});const Wf=Jc({conv2DBackpropInput_:function(e,t,n,s,r,i="NHWC",a){Ni(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let o=e,l=t,u=!1;3===t.rank&&(u=!0,l=mf(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),Ni(4===o.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`)),Ni(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),Ni(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const c="NHWC"===i?o[3]:o[1],h="NHWC"===i?l.shape[3]:l.shape[1];Ni(c===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${n.shape[2]}.`)),Ni(h===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`)),ff("conv2dDerInput",r,a);const d={dy:l,filter:n},p={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,inputShape:o},f=Wc.runKernel(Ha,d,p);return u?mf(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Gf=Jc({conv2dTranspose_:function(e,t,n,s,r,i){const a=Zc(e,"x","conv2dTranspose"),o=Zc(t,"filter","conv2dTranspose");return Wf(n,a,o,s,r,"NHWC",i)}});const Uf=Jc({conv3d_:function(e,t,n,s,r="NDHWC",i=[1,1,1]){const a=Zc(e,"x","conv3d"),o=Zc(t,"filter","conv3d");let l=a,u=!1;4===a.rank&&(u=!0,l=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Ni(5===l.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`)),Ni(5===o.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`)),Ni(l.shape[4]===o.shape[3],(()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`)),Ni(hf(n,i),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),Ni("NDHWC"===r,(()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`)),Ni(df(i),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),Ni(df(n),(()=>"Error in conv3D: Strides should be larger than 0."));const c={x:l,filter:o},h={strides:n,pad:s,dataFormat:r,dilations:i},d=Wc.runKernel($a,c,h);return u?mf(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const qf=Jc({conv3DBackpropInput_:function(e,t,n,s,r){Ni(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let i=e,a=t,o=!1;4===t.rank&&(o=!0,a=mf(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),i=[1,e[0],e[1],e[2],e[3]]);const l=i[4],u=a.shape[4];Ni(5===i.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`)),Ni(5===a.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`)),Ni(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),Ni(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),Ni(u===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`));const c={dy:a,filter:n},h={pad:r,strides:s,inputShape:i},d=Wc.runKernel(Xa,c,h);return o?mf(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const jf=Jc({conv3dTranspose_:function(e,t,n,s,r){const i=Zc(e,"x","conv3dTranspose"),a=Zc(t,"filter","conv3dTranspose");return qf(n,i,a,s,r)}});const Hf=Jc({cos_:function(e){const t={x:Zc(e,"x","cos","float32")};return Wc.runKernel(Za,t)}});const $f=Jc({cosh_:function(e){const t={x:Zc(e,"x","cosh","float32")};return Wc.runKernel(Ya,t)}});const Kf=Jc({cumprod_:function(e,t=0,n=!1,s=!1){const r={x:Zc(e,"x","cumprod")},i={axis:t,exclusive:n,reverse:s};return Wc.runKernel(Qa,r,i)}});const Xf=Jc({cumsum_:function(e,t=0,n=!1,s=!1){const r={x:Zc(e,"x","cumsum")},i={axis:t,exclusive:n,reverse:s};return Wc.runKernel(Ja,r,i)}});const Zf=Jc({denseBincount_:function(e,t,n,s=!1){const r=Zc(e,"x","denseBincount"),i=Zc(t,"weights","denseBincount");Ni("int32"===r.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`)),Ni(r.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`)),Ni(n>=0,(()=>`size must be non-negative, but got ${n}.`)),Ni(i.size===r.size||0===i.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${i.shape}.`));const a={x:r,weights:i},o={size:n,binaryOutput:s};return Wc.runKernel(to,a,o)}});const Yf=Jc({depthToSpace_:function(e,t,n="NHWC"){const s=Zc(e,"x","depthToSpace","float32"),r="NHWC"===n?s.shape[1]:s.shape[2],i="NHWC"===n?s.shape[2]:s.shape[3],a="NHWC"===n?s.shape[3]:s.shape[1];Ni(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),Ni(r*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${t} for depthToSpace with input shape\n ${s.shape}`)),Ni(i*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${i} and ${t} for depthToSpace with input shape\n ${s.shape}`)),Ni(a%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${s.shape}`));const o={x:s},l={blockSize:t,dataFormat:n};return Wc.runKernel(no,o,l)}});const Qf=Jc({depthwiseConv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=Zc(e,"x","depthwiseConv2d","float32"),l=Zc(t,"filter","depthwiseConv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),Ni(4===u.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`)),Ni(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`));const h="NHWC"===r?u.shape[3]:u.shape[1];Ni(h===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${h}) must match the inChannels dimension in filter ${l.shape[2]}.`)),ff("depthwiseConv2d",s,a);const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=Wc.runKernel(so,d,p);return c?mf(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const Jf=Jc({diag_:function(e){const t={x:Zc(e,"x","diag")};return Wc.runKernel(ao,t)}});const em=Jc({dilation2d_:function(e,t,n,s,r=[1,1],i="NHWC"){const a=Zc(e,"x","dilation2d"),o=Zc(t,"filter","dilation2d");Ni(3===a.rank||4===a.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`)),Ni(3===o.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`)),Ni("NHWC"===i,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`));let l=a,u=!1;3===a.rank&&(l=mf(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0),Ni(l.shape[3]===o.shape[2],(()=>`Error in dilation2d: input and filter must have the same depth: ${l.shape[3]} vs ${o.shape[2]}`));const c={x:l,filter:o},h={strides:n,pad:s,dilations:r},d=Wc.runKernel(oo,c,h);return u?mf(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const tm=Jc({equal_:function(e,t){let n=Zc(e,"a","equal","string_or_numeric"),s=Zc(t,"b","equal","string_or_numeric");[n,s]=Dc(n,s),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(yo,r)}});const nm=Jc({where_:function(e,t,n){const s=Zc(t,"a","where"),r=Zc(n,"b","where"),i=Zc(e,"condition","where","bool"),a=Gd(Gd(i.shape,s.shape),r.shape),o={condition:Rf(i,a),t:Rf(s,a),e:Rf(r,a)};return Wc.runKernel(Pl,o)}});const sm=Jc({divNoNan_:function(e,t){let n=Zc(e,"a","div"),s=Zc(t,"b","div");[n,s]=Dc(n,s);const r=vd(n,s),i=kd(r),a=tm(s,i);return nm(a,i,r)}});const rm=Jc({dot_:function(e,t){const n=Zc(e,"t1","dot"),s=Zc(t,"t2","dot");Ni(!(1!==n.rank&&2!==n.rank||1!==s.rank&&2!==s.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${s.rank}.`));const r=1===n.rank?n.size:n.shape[1],i=1===s.rank?s.size:s.shape[0];if(Ni(r===i,(()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${i}.`)),1===n.rank&&1===s.rank){const e=mf(n,[1,-1]),t=mf(s,[-1,1]),r=wf(e,t);return mf(r,[])}if(1===n.rank&&2===s.rank){const e=mf(n,[1,-1]),t=mf(s,[s.shape[0],s.shape[1]]),r=wf(e,t);return mf(r,[r.size])}if(2===n.rank&&1===s.rank){const e=mf(s,[-1,1]),t=wf(n,e);return mf(t,[t.size])}{const e=mf(s,[s.shape[0],s.shape[1]]);return wf(n,e)}}});const im=Jc({einsum_:function(e,...t){const n=t.map(((e,t)=>Zc(e,`tensors${t}`,"einsum"))),s={equation:e};return Wc.runKernel(po,n,s)}});const am=Jc({elu_:function(e){const t={x:Zc(e,"x","elu","float32")};return Wc.runKernel(fo,t)}});const om=Jc({ensureShape_:function(e,t){const n=Zc(e,"x","ensureShape","string_or_numeric");if(!function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=md(t,"float32"));const n={x:t};return Wc.runKernel(go,n)}});function um(e,t){for(let n=0;ne[t]))]}function dm(e,t){return cm(e,t.map((e=>1)),t)}function pm(e,t,n){Ni(um(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function fm(e,t){if(um(e,t))return null;const n=[];for(let s=0;sn.push(e))),n}function mm(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function gm(e,t){const n=[];for(let s=t-e;s"Axis must be <= rank of the tensor"));const s={input:n},r={dim:t};return Wc.runKernel(wo,s,r)}});const Sm=Jc({expm1_:function(e){const t={x:Zc(e,"x","expm1")};return Wc.runKernel(vo,t)}});const _m=Jc({tile_:function(e,t){const n=Zc(e,"x","tile","string_or_numeric");Ni(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`));const s={x:n},r={reps:t};return Wc.runKernel(pu,s,r)}});const Em=Jc({eye_:function(e,t,n,s="float32"){null==t&&(t=e);const r=fd([e,t],s),i=e<=t?e:t;for(let e=0;e`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${i.rank}.`)),Ni(Fi(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let a=i,o=!1;3===i.rank&&(o=!0,a=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:a},u={depthRadius:t,bias:n,alpha:s,beta:r},c=Wc.runKernel(Ho,l,u);return o?mf(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Wm=Jc({log_:function(e){const t={x:Zc(e,"x","log","float32")};return Wc.runKernel(Wo,t)}});const Gm=Jc({log1p_:function(e){const t={x:Zc(e,"x","log1p")};return Wc.runKernel(Go,t)}});const Um=Jc({neg_:function(e){const t={x:Zc(e,"x","neg")};return Wc.runKernel(ll,t)}});const qm=Jc({softplus_:function(e){const t={x:Zc(e,"x","softplus")};return Wc.runKernel(Hl,t)}});const jm=Jc({logSigmoid_:function(e){const t=Zc(e,"x","logSigmoid");return Sd((e=>({value:Um(qm(Um(e))),gradFunc:t=>Ad(t,vf(Um(e)))})))(t)}});const Hm=Jc({logSoftmax_:function(e,t=-1){const n=Zc(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);const s=Sd(((e,n)=>{const s=ym(e,t,!0),r=zd(e,s),i=zd(md(r,"float32"),Wm(wm(Cm(r),t,!0)));n([i]);return{value:i,gradFunc:(e,n)=>{const[s]=n,r=Cm(s);return zd(e,Ad(wm(e,t,!0),r))}}}));return s(n)}});const $m=Jc({logSumExp_:function(e,t=null,n=!1){const s=Zc(e,"x","logSumExp"),r=Vi(t,s.shape),i=ym(s,r,!0),a=zd(s,i),o=Cm(a),l=wm(o,r),u=Wm(l),c=bd(mf(i,u.shape),u);if(n){const e=dm(c.shape,r);return mf(c,e)}return c}});const Km=Jc({logicalAnd_:function(e,t){const n=Zc(e,"a","logicalAnd","bool"),s=Zc(t,"b","logicalAnd","bool");Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(Uo,r)}});const Xm=Jc({logicalNot_:function(e){const t={x:Zc(e,"x","logicalNot","bool")};return Wc.runKernel(qo,t)}});const Zm=Jc({logicalOr_:function(e,t){const n=Zc(e,"a","logicalOr","bool"),s=Zc(t,"b","logicalOr","bool");Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(jo,r)}});const Ym=Jc({logicalXor_:function(e,t){const n=Zc(e,"a","logicalXor","bool"),s=Zc(t,"b","logicalXor","bool");return Gd(n.shape,s.shape),Km(Zm(e,t),Xm(Km(e,t)))}}),Qm=2147483648;const Jm=Jc({searchSorted_:function(e,t,n="left"){const s=Zc(e,"sortedSequence","searchSorted"),r=Zc(t,"values","searchSorted"),i=s.shape[s.shape.length-1],a=r.shape[r.shape.length-1],o=mf(s,[-1,i]),l=mf(r,[-1,a]);if(o.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(o.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(Di(l.shape)>=Qm)throw new Error("values tensor size must less than 2147483648");if(o.shape[1]>=Qm)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${o.shape[1]}`);const u={sortedSequence:o,values:l},c={side:n};return Wc.runKernel(Ll,u,c)}});function eg(e,t){return Jm(e,t,"left")}const tg=Jc({maxPool_:function(e,t,n,s,r){const i=Zc(e,"x","maxPool");let a=i,o=!1;3===i.rank&&(o=!0,a=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Ni(4===a.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${a.rank}.`)),Ni(hf(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),ff("maxPool",s,r);const l={x:a},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r},c=Wc.runKernel(Zo,l,u);return o?mf(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const ng=Jc({maxPool3d_:function(e,t=[1,1,1],n,s,r,i="NDHWC"){const a=Zc(e,"x","maxPool3d");let o=a,l=!1;4===a.rank&&(l=!0,o=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),Ni(5===o.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`)),Ni("NDHWC"===i,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),ff("maxPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i},h=Wc.runKernel(Qo,u,c);return l?mf(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const sg=Jc({maxPoolWithArgmax_:function(e,t,n,s,r=!1){const i={x:Zc(e,"x","maxPoolWithArgmax")},a={filterSize:t,strides:n,pad:s,includeBatchInIndex:r},o=Wc.runKernel(el,i,a);return{result:o[0],indexes:o[1]}}});const rg=Jc({mean_:function(e,t=null,n=!1){const s={x:Zc(e,"x","mean")},r={axis:t,keepDims:n};return Wc.runKernel(tl,s,r)}});function ig(e,t="float32"){if(sa(e),"complex64"===t){const t=ig(e,"float32"),n=ig(e,"float32");return eh(t,n)}const n=ta(Di(e),t);return Wc.makeTensor(n,e,t)}function ag(e,t="float32"){if(sa(e),"complex64"===t){const t=ag(e,"float32"),n=ig(e,"float32");return eh(t,n)}const n=ea(Di(e),t);return Wc.makeTensor(n,e,t)}function og(e,t,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===e)return[];let s=Zc(e,"x","meshgrid",e instanceof vc?e.dtype:"float32");if(void 0===t)return[s];let r=Zc(t,"y","meshgrid",t instanceof vc?t.dtype:"float32");const i=Di(s.shape),a=Di(r.shape);return"xy"===n?(s=mf(s,[1,-1]),r=mf(r,[-1,1]),[wf(ag([a,1],s.dtype),s),wf(r,ag([1,i],r.dtype))]):(s=mf(s,[-1,1]),r=mf(r,[1,-1]),[wf(s,ag([1,a],s.dtype)),wf(ag([i,1],r.dtype),r)])}const lg=Jc({minimum_:function(e,t){let n=Zc(e,"a","minimum"),s=Zc(t,"b","minimum");[n,s]=Dc(n,s),"bool"===n.dtype&&(n=md(n,"int32"),s=md(s,"int32")),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(sl,r)}});const ug=Jc({mirrorPad_:function(e,t,n){Ni("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const s=Zc(e,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");Ni(t.length===s.rank,(()=>`Padding doesn't match input. Must be ${s.rank}. Got ${t.length}.`));const r="reflect"===n?1:0;for(let e=0;e"Invalid number of paddings. Must be length of 2 each.")),Ni(t[e][0]>=0&&t[e][0]<=s.shape[e]-r&&t[e][1]>=0&&t[e][1]<=s.shape[e]-r,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${s.shape[e]-r} or less than 0 for input of shape ${s.shape}`));const i={paddings:t,mode:n},a={x:s};return Wc.runKernel(rl,a,i)}});const cg=Jc({mod_:function(e,t){let n=Zc(e,"a","mod"),s=Zc(t,"b","mod");[n,s]=Dc(n,s);const r={a:n,b:s};return Wc.runKernel(il,r)}});const hg=Jc({moments_:function(e,t=null,n=!1){const s=Vi(t,(e=Zc(e,"x","moments")).shape),r=rg(e,s,n);let i=r.shape;n||(i=dm(r.shape,s));const a=Cd(zd(md(e,"float32"),mf(r,i)));return{mean:r,variance:rg(a,s,n)}}});const dg=Jc({multiRNNCell_:function(e,t,n,s){const r=Zc(t,"data","multiRNNCell"),i=Yc(n,"c","multiRNNCell"),a=Yc(s,"h","multiRNNCell");let o=r;const l=[];for(let t=0;t2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);n=n||Math.random();const o={logits:1===a?mf(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:s},u=Wc.runKernel(al,o,l);return 1===a?mf(u,[u.size]):u}});const fg=Jc({notEqual_:function(e,t){let n=Zc(e,"a","notEqual","string_or_numeric"),s=Zc(t,"b","notEqual","string_or_numeric");[n,s]=Dc(n,s),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(ul,r)}});const mg=Jc({oneHot_:function(e,t,n=1,s=0,r="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const i={indices:Zc(e,"indices","oneHot","int32")},a={dtype:r,depth:t,onValue:n,offValue:s};return Wc.runKernel(fl,i,a)}});const gg=Jc({onesLike_:function(e){const t={x:Zc(e,"x","onesLike")};return Wc.runKernel(pl,t)}});const yg=Jc({outerProduct_:function(e,t){const n=Zc(e,"v1","outerProduct"),s=Zc(t,"v2","outerProduct");Ni(1===n.rank&&1===s.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${s.rank}.`));const r=mf(n,[-1,1]),i=mf(s,[1,-1]);return wf(r,i)}});const bg=Jc({pad_:function(e,t,n=0){const s=Zc(e,"x","pad");if(0===s.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const r={paddings:t,constantValue:n},i={x:s};return Wc.runKernel(gl,i,r)}});const wg=Jc({pad1d_:function(e,t,n=0){return Ni(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),bg(e,[t],n)}});const vg=Jc({pad2d_:function(e,t,n=0){return Ni(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),bg(e,t,n)}});const Ag=Jc({pad3d_:function(e,t,n=0){return Ni(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),bg(e,t,n)}});const xg=Jc({pad4d_:function(e,t,n=0){return Ni(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),bg(e,t,n)}});const Cg=Jc({spaceToBatchND_:function(e,t,n){const s=Zc(e,"x","spaceToBatchND");Ni(s.rank>=1+t.length,(()=>`input rank ${s.rank} should be > than [blockShape] ${t.length}`)),Ni(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),Ni(s.shape.reduce(((e,s,r)=>r>0&&r<=t.length?e&&(s+n[r-1][0]+n[r-1][1])%t[r-1]==0:e),!0),(()=>`input spatial dimensions ${s.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`));const r={x:s},i={blockShape:t,paddings:n};return Wc.runKernel(Xl,r,i)}});const kg=Jc({pool_:function(e,t,n,s,r,i,a){null==r&&(r=[1,1]),null==i&&(i=1),0===s&&(s="valid");const o=Zc(e,"x","maxPool");let l=o,u=!1;3===o.rank&&(u=!0,l=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),Ni(hf(i,r),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${r}'`));const c=ef(l.shape,t,i,r,s),h=[c.dilationHeight,c.dilationWidth];let d;d="same"===s?function(e,t){const n=e.map(((e,n)=>e+(e-1)*(t[n]-1))),s=n.map((e=>e-1)),r=s.map((e=>Math.floor(e/2))),i=s.map(((e,t)=>e-r[t]));return s.map(((e,t)=>[r[t],i[t]]))}([c.filterHeight,c.filterWidth],h):[[0,0],[0,0]];const p=1===h[0]&&1===h[1],[f,m]=function(e,t,n){const s=n.map((e=>e[0])),r=n.map((e=>e[1])),i=e.concat(s,r),a=t.map(((e,t)=>(e-i[t]%e)%e)),o=r.map(((e,t)=>e+a[t])),l=t.map(((e,t)=>[s[t],o[t]])),u=t.map(((e,t)=>[0,a[t]]));return[l,u]}([c.inHeight,c.inWidth],h,d),g=p?s:"valid",y=p?l:Cg(l,h,f),b=("avg"===n?()=>gf(y,t,i,g,a):()=>tg(y,t,i,g,a))(),w=p?b:kf(b,h,m);return u?mf(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});const Sg=Jc({prelu_:function(e,t){const n={x:Zc(e,"x","prelu"),alpha:Zc(t,"alpha","prelu")};return Wc.runKernel(bl,n)}});const _g=Jc({prod_:function(e,t=null,n=!1){let s=Zc(e,"x","prod");"bool"===s.dtype&&(s=md(s,"int32"));const r={x:s},i={axis:t,keepDims:n};return Wc.runKernel(wl,r,i)}});const Eg=Jc({raggedGather_:function(e,t,n,s){const r={paramsNestedSplits:e.map(((e,t)=>Zc(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:Zc(t,"paramsDenseValues","raggedGather"),indices:Zc(n,"indices","raggedGather","int32")},i={outputRaggedRank:s},a=Wc.runKernel(vl,r,i);return{outputNestedSplits:a.slice(0,a.length-1),outputDenseValues:a[a.length-1]}}});const Ig=Jc({raggedRange_:function(e,t,n){const s=Zc(e,"starts","raggedRange"),r={starts:s,limits:Zc(t,"limits","raggedRange",s.dtype),deltas:Zc(n,"deltas","raggedRange",s.dtype)},i=Wc.runKernel(Al,r);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}});const Tg=Jc({raggedTensorToTensor_:function(e,t,n,s,r){const i=Zc(e,"shape","raggedTensorToTensor","int32"),a=Zc(t,"values","raggedTensorToTensor"),o={shape:i,values:a,defaultValue:Zc(n,"defaultValue","raggedTensorToTensor",a.dtype),rowPartitionTensors:s.map(((e,t)=>Zc(e,`tensors${t}`,"raggedTensorToTensor","int32")))},l={rowPartitionTypes:r};return Wc.runKernel(xl,o,l)}});const Ng=Jc({rand_:function(e,t,n){sa(e);const s=Di(e);let r=null;if(null==n||"float32"===n)r=new Float32Array(s);else if("int32"===n)r=new Int32Array(s);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);r=new Uint8Array(s)}for(let e=0;e=1||0===i);const a=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*s*a,t=this.mean+this.stdDev*r*a,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class Dg{constructor(e,t,n,s){this.alpha=e,this.beta=1/t,this.dtype=n;const r=s||Math.random();this.randu=Og.alea(r.toString()),this.randn=new Rg(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,s,r,i;for(;;){do{s=this.randn.nextValue(),i=1+this.c*s}while(i<=0);if(i*=i*i,e=s*s,t=1-.331*e*e,n=.5*e+this.d*(1-i+Math.log(i)),r=this.randu(),rnull==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==s&&(s=Math.random()),"number"==typeof s&&(s=s.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=Og.alea(s)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const Fg=Jc({randomGamma_:function(e,t,n=1,s="float32",r){if(sa(e),null==n&&(n=1),null==s&&(s="float32"),"float32"!==s&&"int32"!==s)throw new Error(`Unsupported data type ${s}`);const i=new Dg(t,n,s,r),a=fd(e,s);for(let e=0;e`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),jg(t,0)}});const $g=Jc({reverse2d_:function(e,t){const n=Zc(e,"x","reverse");return Ni(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),jg(n,t)}});const Kg=Jc({reverse3d_:function(e,t){const n=Zc(e,"x","reverse");return Ni(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),jg(n,t)}});const Xg=Jc({reverse4d_:function(e,t){const n=Zc(e,"x","reverse");return Ni(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),jg(n,t)}});const Zg=Jc({round_:function(e){const t={x:Zc(e,"x","round")};return Wc.runKernel(Ml,t)}});const Yg=Jc({rsqrt_:function(e){const t={x:Zc(e,"x","rsqrt","float32")};return Wc.runKernel(Fl,t)}});const Qg=Jc({selu_:function(e){const t={x:Zc(e,"x","selu")};return Wc.runKernel(Vl,t)}});const Jg=Jc({separableConv2d_:function(e,t,n,s,r,i=[1,1],a="NHWC"){const o=Zc(e,"x","separableConv2d"),l=Zc(t,"depthwiseFilter","separableConv2d"),u=Zc(n,"pointwiseFilter","separableConv2d");let c=o,h=!1;if(3===o.rank&&(h=!0,c=mf(o,[1,o.shape[0],o.shape[1],o.shape[2]])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");Ni(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),Ni(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),Ni(4===u.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),Ni(1===u.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`)),Ni(1===u.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`));const d=l.shape[2],p=l.shape[3];Ni(u.shape[2]===d*p,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${u.shape[2]}.`));const f=Qf(c,l,s,r,a,i),m=Pf(f,u,1,"valid",a);return h?mf(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const ey=async function(e,t){const n=Zc(e,"x","setdiff1d"),s=Zc(t,"y","setdiff1d");Ni(n.dtype===s.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${s.dtype}).`)),Ni(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),Ni(1===s.rank,(()=>`y should be 1D tensor, but got y (${s.shape}).`));const r=await n.data(),i=await s.data(),a=new Set(i);let o=0;for(let e=0;e`slice1d expects a rank-1 tensor, but got a rank-${s.rank} tensor`)),Af(s,[t],[n])}});const iy=Jc({slice2d_:function(e,t,n){const s=Zc(e,"x","slice2d");return Ni(2===s.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${s.rank} tensor`)),Af(s,t,n)}});const ay=Jc({slice3d_:function(e,t,n){const s=Zc(e,"x","slice3d");return Ni(3===s.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${s.rank} tensor`)),Af(s,t,n)}});const oy=Jc({slice4d_:function(e,t,n){const s=Zc(e,"x","slice4d");return Ni(4===s.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${s.rank} tensor`)),Af(s,t,n)}});const ly=Jc({softmax_:function(e,t=-1){const n=Zc(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);const s={logits:n},r={dim:t};return Wc.runKernel(Yl,s,r)}});const uy=Jc({fft_:function(e){Ni("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return Wc.runKernel(Ao,t)}});const cy=Jc({ifft_:function(e){Ni("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return Wc.runKernel(Ro,t)}});const hy=Jc({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let s;if(t<=2){const r=mf(e,[n,t]);s=cy(r)}else{const r=[n,2*(t-1)],i=mf(Wg(e),[n,t]),a=mf(Rm(e),[n,t]),o=jg(Af(i,[0,1],[n,t-2]),1),l=Ad(jg(Af(a,[0,1],[n,t-2]),1),_d(-1)),u=bf([i,o],1),c=bf([a,l],1),h=mf(eh(u,c),[r[0],r[1]]);s=cy(h)}if(s=Wg(s),3===e.rank&&0!==e.shape[0]){const t=s,n=e.shape[0];s=mf(s,[n,s.shape[0]/n,s.shape[1]]),t.dispose()}return s}});const dy=Jc({split_:function(e,t,n=0){const s={x:Zc(e,"x","split")},r={numOrSizeSplits:t,axis:n};return Wc.runKernel(Zl,s,r)}});const py=Jc({rfft_:function(e,t){Ni("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let n=e.shape[e.shape.length-1];const s=e.size/n;let r;if(null!=t&&t0)),i=e.shape.map((e=>e));i[e.shape.length-1]=t,r=Af(e,s,i),n=t}else if(null!=t&&t>n){const s=e.shape.map((e=>e));s[e.shape.length-1]=t-n,r=bf([e,ig(s)],e.shape.length-1),n=t}else r=e;const i=kd(r),a=mf(eh(r,i),[s,n]),o=uy(a),l=Math.floor(n/2)+1,u=Wg(o),c=Rm(o),h=dy(u,[l,n-l],u.shape.length-1),d=dy(c,[l,n-l],c.shape.length-1),p=r.shape.slice();return p[r.shape.length-1]=l,mf(eh(h[0],d[0]),p)}});const fy=Jc({squaredDifference_:function(e,t){let n=Zc(e,"a","squaredDifference"),s=Zc(t,"b","squaredDifference");[n,s]=Dc(n,s),Gd(n.shape,s.shape);const r={a:n,b:s};return Wc.runKernel(su,r,{})}});const my=Jc({squeeze_:function(e,t){const n=Zc(e,"x","squeeze","string_or_numeric");return mf(n,Wi(n.shape,t).newShape)}});const gy=Jc({stack_:function(e,t=0){const n=Yc(e,"tensors","stack","string_or_numeric");Ni(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&Ni(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const s=n,r={axis:t};return Wc.runKernel(ml,s,r)}});const yy=Jc({step_:function(e,t=0){const n={x:Zc(e,"x","step")},s={alpha:t};return Wc.runKernel(Au,n,s)}});const by=Jc({stridedSlice_:function(e,t,n,s,r=0,i=0,a=0,o=0,l=0){const u={x:Zc(e,"x","stridedSlice","string_or_numeric")},c={begin:t,end:n,strides:s,beginMask:r,endMask:i,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};return Wc.runKernel(au,u,c)}});const wy=Jc({tan_:function(e){const t={x:Zc(e,"x","tan","float32")};return Wc.runKernel(hu,t)}});function vy(e,t){Ri(e);const n=$c(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return th(e,null,n,t)}function Ay(e,t,n){if(Ri(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const s=$c(e,n);if(2!==s.length&&1!==s.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return th(e,t,s,n)}function xy(e,t,n){if(Ri(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const s=$c(e,n);if(4!==s.length&&1!==s.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return th(e,t,s,n)}function Cy(e,t,n){if(Ri(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const s=$c(e,n);if(5!==s.length&&1!==s.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return th(e,t,s,n)}function ky(e,t,n){if(Ri(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const s=$c(e,n);if(6!==s.length&&1!==s.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return th(e,t=t||s,s,n)}function Sy(e,t,n){const s=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,i=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${s}, and batchDim: ${r}.`;if(n.rank1?t.shape[s-1]:1,i=n.length;let a=1;for(let e=r;e= 0 but got ${t}`);if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);const i={x:s},a={k:t,sorted:n},[o,l]=Wc.runKernel(fu,i,a);return{values:o,indices:l}}});const Ny=Jc({truncatedNormal_:function(e,t=0,n=1,s,r){if(sa(e),null!=s&&"bool"===s)throw new Error("Unsupported data type $ { dtype }");const i=new Rg(t,n,s,!0,r),a=fd(e,s);for(let e=0;e0,(()=>"The input tensor must be at least 1D"));const s={x:n},r={axis:t},[i,a]=Wc.runKernel(yu,s,r);return{values:i,indices:a}}});const Ry=Jc({unsortedSegmentSum_:function(e,t,n){const s=Zc(e,"x","unsortedSegmentSum"),r=Zc(t,"segmentIds","unsortedSegmentSum","int32");Ni(Fi(n),(()=>"numSegments must be of dtype int"));const i={x:s,segmentIds:r},a={numSegments:n};return Wc.runKernel(wu,i,a)}});const Dy=Jc({unstack_:function(e,t=0){const n=Zc(e,"x","unstack","string_or_numeric");Ni(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const s={value:n},r={axis:t};return Wc.runKernel(bu,s,r)}});function My(e,t){return Jm(e,t,"right")}function Fy(e,t=!0,n,s){return Wc.makeVariable(e,t,n,s)}function By(e,t){const n=[];for(let e=0;e0,(()=>"mask cannot be scalar")),Oi(o.slice(i,i+a),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=i;et)).reverse()),Ni(s.rank===t.length,(()=>`Error in transpose: rank of input ${s.rank} must match length of perm ${t}.`)),t.forEach((e=>{Ni(e>=0&&e"All entries in 'perm' must be between 0 and "+(s.rank-1)+` but got ${t}`))})),s.rank<=1)return s.clone();const r={x:s},i={perm:t};return"complex64"===s.dtype?oh((()=>{let e=Wg(s),t=Rm(s);return e=Wc.runKernel(gu,{x:e},i),t=Wc.runKernel(gu,{x:t},i),n&&(t=Um(t)),eh(e,t)})):Wc.runKernel(gu,r,i)}});const Vy=Jc({movingAverage_:function(e,t,n,s,r=!0){const i=Zc(e,"v","movingAverage"),a=Zc(t,"x","movingAverage"),o=Zc(n,"decay","movingAverage");var l,u;u=a,Ni((l=i).dtype===u.dtype,(()=>`The dtypes of the first(${l.dtype}) and second(${u.dtype}) input must match`)),Ni(Mi(i.shape,a.shape),(()=>"Shape mismatch in v and x"));const c=_d(1),h=zd(c,o);let d=Ad(zd(a,i),h);if(r){Ni(null!=s,(()=>"When using zeroDebias: true, step is required."));const e=Zc(s,"step","movingAverage");d=vd(d,zd(c,Bd(o,e)))}return bd(i,d)}});const Wy=Jc({scatterND_:function(e,t,n){sa(n);const s=Zc(e,"indices","scatterND","int32"),r=Zc(t,"updates","scatterND");_y(r,s,n);const i={indices:s,updates:r},a={shape:n};return Wc.runKernel(Bl,i,a)}});const Gy=Jc({sparseToDense_:function(e,t,n,s=0){sa(n);const r=Zc(e,"sparseIndices","sparseToDense","int32"),i=Zc(t,"sparseValues","sparseToDense","string_or_numeric"),a=Zc(s,"defaultValue","sparseToDense",i.dtype);!function(e,t,n,s){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const r=e.rank>0?e.shape[0]:1,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const a=t.size;if(0!==t.rank&&(1!==t.rank||a!==r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==s.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(r,i,n,a);const o={sparseIndices:r,sparseValues:i,defaultValue:a},l={outputShape:n};return Wc.runKernel(nu,o,l)}});const Uy=Jc({gatherND_:function(e,t){const n=Zc(t,"indices","gatherND","int32"),s={params:Zc(e,"x","gatherND","string_or_numeric"),indices:n};return Wc.runKernel(Io,s)}});const qy=Jc({dropout_:function(e,t,n,s){const r=Zc(e,"x","dropout");if(Ni("float32"===r.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`)),Ni(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof vc?r.clone():r;const i=function(e,t){if(null==t)return e.shape.slice();if(Mi(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let s=0;s1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${s.rank}`)),Ni(s.rank-1===r.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${s.rank} and targets rank ${r.rank}`)),Oi(s.shape.slice(0,s.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const i=s.shape[s.shape.length-1];Ni(n>0&&n<=i,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${i}), but got ${n}`));const a=await s.data(),o=await r.data(),[l,u]=[a.length/i,i],c=Gi("bool",l);for(let e=0;et.value-e.value)),c[e]=0;for(let t=0;t`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`)),Ni(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),Ni(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const u="NHWC"===i?o.shape[3]:o.shape[1],c="NHWC"===i?l.shape[3]:l.shape[1];Ni(u===n[2],(()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`)),Ni(c===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${n[3]}).`)),ff("conv2dDerFilter",r,a);const h={x:o,dy:l},d={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,filterShape:n};return Wc.runKernel(ja,h,d)}});function Xy(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Ad(e,yy(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function Zy(e,t){let n=t;const s=Wd(e.shape,t.shape);return s.length>0&&(n=wm(n,s)),mf(n,e.shape)}function Yy(e,t,n,s){if("linear"===t)return e;if("relu"===t)return Ug(e);if("elu"===t)return am(e);if("relu6"===t)return qg(e);if("prelu"===t)return Sg(e,n);if("leakyrelu"===t)return Bm(e,s);if("sigmoid"===t)return vf(e);throw new Error(`Unknown fused activation ${t}.`)}const Qy=(e,t)=>!(e>0)||"linear"===t;const Jy=Jc({fusedConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(l=l||"linear",!1===Qy(Wc.state.gradientDepth,l)){Ni("NHWC"===r,(()=>`Error in fused conv2d: got dataFormat of ${r} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`));let h=Pf(e,t,n,s,r,i,a);return null!=o&&(h=bd(h,o)),Yy(h,l,u,c)}const h=Zc(e,"x","conv2d","float32"),d=Zc(t,"filter","conv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=mf(h,[1,h.shape[0],h.shape[1],h.shape[2]])),Ni(4===p.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`)),Ni(4===d.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`)),ff("fused conv2d",s,a);const m="NHWC"===r?p.shape[3]:p.shape[1];Ni(d.shape[2]===m,(()=>`Error in conv2d: depth of input (${m}) must match input depth for filter ${d.shape[2]}.`)),Ni(hf(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`));const g=nf(p.shape,d.shape,n,i,s,a);let y,b;if(null!=o&&(y=Zc(o,"bias","fused conv2d"),[y]=Dc(y,h),"NHWC"===r?Gd(g.outShape,y.shape):(Ni(y.shape.length<=1,(()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${y.shape.length}.`)),Ni(0===y.shape.length||y.shape[0]===g.outChannels||1===y.shape[0],(()=>`Error in fused conv2d: bias shape (${y.shape}) is not compatible with the number of output channels (${g.outChannels})`)))),null!=u){const e=u.shape;if(Ni(e.length<=1||3===e.length,(()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${e.length}.`)),1===e.length)Ni(1===e[0]||e[0]===g.outChannels,(()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${g.outChannels}).`));else if(3===e.length)try{Gd(e,g.outShape)}catch(t){const n=`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(n)}b=Zc(u,"prelu weights","fused conv2d")}const w=(e,t)=>{Ni("NHWC"===r,(()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`));const[a,o,u,c]=t,h=Xy(e,u,l);Ni(cf(i),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const d=[Wf(o.shape,h,a,n,s),Ky(o,h,a.shape,n,s)];if(null!=c){const e=Zy(c,h);d.push(e)}return d},v={x:p,filter:d,bias:y,preluActivationWeights:b},A={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:c};if(null==o){const e=Sd(((e,t,n)=>{let s=Wc.runKernel(Su,v,A);return n([t,e,s]),f&&(s=mf(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:w}}));return e(p,d)}{const e=Sd(((e,t,n,s)=>{let r=Wc.runKernel(Su,v,A);return s([t,e,r,n]),f&&(r=mf(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}}));return e(p,d,y)}}});const eb=Jc({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,s,r,i=[1,1],a){let o=e;3===e.rank&&(o=mf(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=mf(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={x:o,dy:l},c={strides:s,pad:r,dimRoundingMode:a,dilations:i,filterShape:n};return Wc.runKernel(ro,u,c)}});const tb=Jc({depthwiseConv2dNativeBackpropInput_:function(e,t,n,s,r,i=[1,1],a){let o=t,l=!1;3===t.rank&&(l=!0,o=mf(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={dy:o,filter:n},c={strides:s,pad:r,dimRoundingMode:a,dilations:i,inputShape:e},h=Wc.runKernel(io,u,c);return l?mf(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const nb=Jc({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(!1===Qy(Wc.state.gradientDepth,l)){let h=Qf(e,t,n,s,r,i,a);return null!=o&&(h=bd(h,o)),Yy(h,l,u,c)}const h=Zc(e,"x","depthwiseConv2d","float32"),d=Zc(t,"filter","depthwiseConv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=mf(h,[1,h.shape[0],h.shape[1],h.shape[2]])),Ni(4===p.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`)),Ni(4===d.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`)),Ni(p.shape[3]===d.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${p.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`)),null==i&&(i=[1,1]),Ni(hf(n,i),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),ff("fused depthwiseConv2d",s,a);const m=nf(p.shape,d.shape,n,i,s,a,!0);let g,y;null!=o&&(g=Zc(o,"bias","fused conv2d"),[g]=Dc(g,h),Gd(m.outShape,g.shape)),null!=u&&(y=Zc(u,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>{Ni(cf(i),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`));const[r,o,u,c]=t,h=Xy(e,u,l),d=tb(o.shape,h,r,n,s,i,a),p=eb(o,h,r.shape,n,s,i,a);if(null!=c){return[d,p,Zy(g,h)]}return[d,p]},w={x:p,filter:d,bias:g,preluActivationWeights:y},v={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:c};if(null==o){const e=Sd(((e,t,n)=>{let s=Wc.runKernel(_u,w,v);return n([t,e,s]),f&&(s=mf(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:b}}));return e(p,d)}{const e=Sd(((e,t,n,s)=>{let r=Wc.runKernel(_u,w,v);return s([t,e,r,n]),f&&(r=mf(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}}));return e(p,d,g)}}});const sb=Jc({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:s=!1,bias:r,activation:i="linear",preluActivationWeights:a,leakyreluAlpha:o=.2}){if(!1===Qy(Wc.state.gradientDepth,i)){let l=wf(e,t,n,s);return null!=r&&(l=bd(l,r)),Yy(l,i,a,o)}let l=Zc(e,"a","fused matMul"),u=Zc(t,"b","fused matMul");[l,u]=Dc(l,u);const c=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=s?u.shape[u.rank-1]:u.shape[u.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=s?u.shape[u.rank-2]:u.shape[u.rank-1],f=l.shape.slice(0,-2),m=u.shape.slice(0,-2),g=Di(f),y=Di(m);Ni(c===h,(()=>`Error in fused matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${s} must match.`));const b=Gd(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([d,p]),w=mf(l,n?[g,c,d]:[g,d,c]),v=mf(u,s?[y,p,h]:[y,h,p]);let A,x;null!=r&&(A=Zc(r,"bias","fused matMul"),[A]=Dc(A,l),Gd(b,A.shape)),null!=a&&(x=Zc(a,"prelu weights","fused matMul"));const C=(e,t)=>{const[a,o,l,u]=t,c=Xy(mf(e,l.shape),l,i);let h,d;if(n||s?!n&&s?(h=wf(c,o,!1,!1),d=wf(c,a,!0,!1)):n&&!s?(h=wf(o,c,!1,!0),d=wf(a,c,!1,!1)):(h=wf(o,c,!0,!0),d=wf(c,a,!0,!0)):(h=wf(c,o,!1,!0),d=wf(a,c,!0,!1)),null!=r){return[h,d,Zy(u,c)]}return[h,d]},k={a:w,b:v,bias:A,preluActivationWeights:x},S={transposeA:n,transposeB:s,activation:i,leakyreluAlpha:o};if(null==r){const e=Sd(((e,t,n)=>{const s=Wc.runKernel(ku,k,S);return n([e,t,s]),{value:mf(s,b),gradFunc:C}}));return e(w,v)}{const e=Sd(((e,t,n,s)=>{const r=Wc.runKernel(ku,k,S);return s([e,t,r,n]),{value:mf(r,b),gradFunc:C}}));return e(w,v,A)}}});const rb=Jc({hammingWindow_:function(e){return Hy(e,.54,.46)}});const ib=Jc({hannWindow_:function(e){return Hy(e,.5,.5)}});const ab=Jc({frame_:function(e,t,n,s=!1,r=0){let i=0;const a=[];for(;i+t<=e.size;)a.push(Af(e,i,t)),i+=n;if(s)for(;i`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`)),Ni(2===o.rank&&4===o.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${o.shape}.`)),Ni(1===l.rank&&l.shape[0]===u,(()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${o.shape}.`)),Ni(2===s.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${s.length}.`)),Ni(s[0]>=1&&s[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${s}`)),Ni("bilinear"===r||"nearest"===r,(()=>`method must be bilinear or nearest, but was ${r}`));const c={image:a,boxes:o,boxInd:l},h={method:r,extrapolationValue:i,cropSize:s};return Wc.runKernel(eo,c,h)}});const ub=Jc({flipLeftRight_:function(e){const t=Zc(e,"image","flipLeftRight","float32");Ni(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return Wc.runKernel(Co,n,{})}});const cb=Jc({grayscaleToRGB_:function(e){const t=Zc(e,"image","grayscaleToRGB"),n=t.rank-1,s=t.shape[n];Ni(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),Ni(1===s,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${s}.`));const r=new Array(t.rank);return r.fill(1,0,n),r[n]=3,_m(t,r)}});const hb=Jc({rgbToGrayscale_:function(e){const t=Zc(e,"image","RGBToGrayscale"),n=t.rank-1,s=t.shape[n];Ni(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),Ni(3===s,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${s}.`));const r=t.dtype,i=md(t,"float32"),a=vy([.2989,.587,.114]);let o;switch(t.rank){case 2:o=im("ij,j->i",i,a);break;case 3:o=im("ijk,k->ij",i,a);break;case 4:o=im("ijkl,l->ijk",i,a);break;case 5:o=im("ijklm,m->ijkl",i,a);break;case 6:o=im("ijklmn,n->ijklm",i,a);break;default:throw new Error("Not a valid tensor rank.")}return o=km(o,-1),md(o,r)}});const db=Jc({rotateWithOffset_:function(e,t,n=0,s=.5){const r=Zc(e,"image","rotateWithOffset","float32");Ni(4===r.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`));const i={image:r},a={radians:t,fillValue:n,center:s};return Wc.runKernel(Cu,i,a)}});function pb(e,t,n,s,r,i){null==s&&(s=.5),null==r&&(r=Number.NEGATIVE_INFINITY),null==i&&(i=0);const a=e.shape[0];return n=Math.min(n,a),Ni(0<=s&&s<=1,(()=>`iouThreshold must be in [0, 1], but was '${s}'`)),Ni(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),Ni(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),Ni(1===t.rank,(()=>"scores must be a 1D tensor")),Ni(t.shape[0]===a,(()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`)),Ni(0<=i&&i<=1,(()=>`softNmsSigma must be in [0, 1], but was '${i}'`)),{maxOutputSize:n,iouThreshold:s,scoreThreshold:r,softNmsSigma:i}}const fb=Jc({nonMaxSuppression_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=Zc(e,"boxes","nonMaxSuppression","float32"),a=Zc(t,"scores","nonMaxSuppression","float32"),o=pb(i,a,n,s,r),l={maxOutputSize:n=o.maxOutputSize,iouThreshold:s=o.iouThreshold,scoreThreshold:r=o.scoreThreshold};return Wc.runKernel(cl,{boxes:i,scores:a},l)}});function mb(e,t,n){const s=function(e,t,n){return function(e,t,n){let s=0,r=e.length,i=0,a=!1;for(;s>>1);const o=n(t,e[i]);o>0?s=i+1:(r=i,a=!o)}return a?s:-s-1}(e,t,n||gb)}(e,t,n),r=s<0?-(s+1):s;e.splice(r,0,t)}function gb(e,t){return e>t?1:er&&u.push({score:t[e],boxIndex:e,suppressBeginIndex:0});u.sort(Cb);const c=i>0?-.5/i:0,h=[],d=[];for(;h.length0;){const t=u.pop(),{score:n,boxIndex:i,suppressBeginIndex:a}=t;if(n=a;--n){const a=Ab(e,i,h[n]);if(a>=s){o=!0;break}if(t.score=t.score*xb(s,c,a),t.score<=r)break}t.suppressBeginIndex=h.length,o||(t.score===n?(h.push(i),d.push(t.score)):t.score>r&&mb(u,t,Cb))}const p=h.length,f=n-p;o&&f>0&&(h.push(...new Array(f).fill(0)),d.push(...new Array(f).fill(0)));const m={selectedIndices:h};return a&&(m.selectedScores=d),l&&(m.validOutputs=p),m}function Ab(e,t,n){const s=e.subarray(4*t,4*t+4),r=e.subarray(4*n,4*n+4),i=Math.min(s[0],s[2]),a=Math.min(s[1],s[3]),o=Math.max(s[0],s[2]),l=Math.max(s[1],s[3]),u=Math.min(r[0],r[2]),c=Math.min(r[1],r[3]),h=Math.max(r[0],r[2]),d=Math.max(r[1],r[3]),p=(o-i)*(l-a),f=(h-u)*(d-c);if(p<=0||f<=0)return 0;const m=Math.max(i,u),g=Math.max(a,c),y=Math.min(o,h),b=Math.min(l,d),w=Math.max(y-m,0)*Math.max(b-g,0);return w/(p+f-w)}function xb(e,t,n){const s=Math.exp(t*n*n);return n<=e?s:0}function Cb(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const kb=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=Zc(e,"boxes","nonMaxSuppressionAsync"),a=Zc(t,"scores","nonMaxSuppressionAsync"),o=pb(i,a,n,s,r);n=o.maxOutputSize,s=o.iouThreshold,r=o.scoreThreshold;const l=await Promise.all([i.data(),a.data()]),u=l[0],c=l[1],{selectedIndices:h}=yb(u,c,n,s,r);return i!==e&&i.dispose(),a!==t&&a.dispose(),vy(h,"int32")};const Sb=Jc({nonMaxSuppressionWithScore_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=Zc(e,"boxes","nonMaxSuppression"),o=Zc(t,"scores","nonMaxSuppression"),l=pb(a,o,n,s,r,i),u={boxes:a,scores:o},c={maxOutputSize:n=l.maxOutputSize,iouThreshold:s=l.iouThreshold,scoreThreshold:r=l.scoreThreshold,softNmsSigma:i=l.softNmsSigma},h=Wc.runKernel(dl,u,c);return{selectedIndices:h[0],selectedScores:h[1]}}});const _b=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=Zc(e,"boxes","nonMaxSuppressionAsync"),o=Zc(t,"scores","nonMaxSuppressionAsync"),l=pb(a,o,n,s,r,i);n=l.maxOutputSize,s=l.iouThreshold,r=l.scoreThreshold,i=l.softNmsSigma;const u=await Promise.all([a.data(),o.data()]),c=u[0],h=u[1],{selectedIndices:d,selectedScores:p}=wb(c,h,n,s,r,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:vy(d,"int32"),selectedScores:vy(p)}};const Eb=Jc({nonMaxSuppressionPadded_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=Zc(e,"boxes","nonMaxSuppression"),o=Zc(t,"scores","nonMaxSuppression"),l=pb(a,o,n,s,r,null),u={boxes:a,scores:o},c={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:i},h=Wc.runKernel(hl,u,c);return{selectedIndices:h[0],validOutputs:h[1]}}});const Ib=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=Zc(e,"boxes","nonMaxSuppressionAsync"),o=Zc(t,"scores","nonMaxSuppressionAsync"),l=pb(a,o,n,s,r,null),u=l.maxOutputSize,c=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([a.data(),o.data()]),{selectedIndices:f,validOutputs:m}=bb(d,p,u,c,h,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:vy(f,"int32"),validOutputs:_d(m,"int32")}};const Tb=Jc({resizeBilinear_:function(e,t,n=!1,s=!1){const r=Zc(e,"images","resizeBilinear");Ni(3===r.rank||4===r.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`)),Ni(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),Ni(!1===s||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=mf(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},u=Wc.runKernel(Nl,o,l);return a?mf(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const Nb=Jc({resizeNearestNeighbor_:function(e,t,n=!1,s=!1){const r=Zc(e,"images","resizeNearestNeighbor");Ni(3===r.rank||4===r.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`)),Ni(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),Ni("float32"===r.dtype||"int32"===r.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),Ni(!1===s||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=mf(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},u=Wc.runKernel(Il,o,l);return a?mf(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const Ob=Jc({threshold_:function(e,t="binary",n=!1,s=.5){const r=Zc(e,"image","threshold"),i=r.shape[0]*r.shape[1];let a,o,l,u,c=Ad(vy([s]),255);if(Ni(3===r.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`)),Ni(3===r.shape[2]||1===r.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`)),Ni("int32"===r.dtype||"float32"===r.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`)),Ni("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===r.shape[2]){[a,o,l]=dy(r,[1,1,1],-1);const e=Ad(a,.2989),t=Ad(o,.587),n=Ad(l,.114);u=bd(bd(e,t),n)}else u=e;if("otsu"===t){c=function(e,t){let n,s,r,i,a,o,l=vy([-1]),u=vy([0]),c=vy([0]);for(let h=0;h`Error in transform: image must be rank 4,but got rank ${a.rank}.`)),Ni(2===o.rank&&(o.shape[0]===a.shape[0]||1===o.shape[0])&&8===o.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),Ni(null==i||2===i.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`));const l={image:a,transforms:o},u={interpolation:n,fillMode:s,fillValue:r,outputShape:i};return Wc.runKernel(mu,l,u)}});const Db=Jc({bandPart_:function(e,t,n){const s=Zc(e,"a","bandPart");Ni(s.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${s.rank}.`));const r=s.shape,[i,a]=s.shape.slice(-2);let o,l;"number"==typeof t?(Ni(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),Ni(t<=i,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${i}).`)),o=Zc(t<0?i:t,"numLower","bandPart")):(Ni("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),o=nm(zm(t,0),i,lg(t,i))),"number"==typeof n?(Ni(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),Ni(n<=a,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${a}).`)),l=Zc(n<0?a:n,"numUpper","bandPart")):(Ni("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),l=nm(zm(n,0),a,lg(n,a)));const u=mf(Vg(0,i,1,"int32"),[-1,1]),c=Vg(0,a,1,"int32"),h=zd(u,c),d=Km(Lm(h,o),Om(h,Um(l))),p=ig([i,a],s.dtype);return mf(gy(Dy(mf(s,[-1,i,a])).map((e=>nm(d,e,p)))),r)}});const Mb=Jc({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,Ni(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const n=e[0].shape[0];for(let t=1;t`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`))}else t=!0,e=dy(e,e.shape[0],0).map((e=>my(e,[0])));Ni(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const n=[],s=e;for(let t=0;t{let e=s[t];if(t>0)for(let s=0;s{Ni(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const n=e.shape[0],s=e.shape[1];let r=Em(n),i=gd(e);const a=Ay([[1]],[1,1]);let o=gd(a);const l=n>=s?s:n;for(let e=0;e{const t=Af(i,[e,e],[n-e,1]),l=Am(t),u=Af(i,[e,e],[1,1]),c=nm(Nm(u,0),Ay([[-1]]),Ay([[1]])),h=zd(u,Ad(c,l)),d=vd(t,h);o=1===d.shape[0]?gd(a):bf([a,Af(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const p=Um(vd(wf(c,h),l)),f=Af(i,[e,0],[n-e,s]),m=Ad(p,o),g=Py(o);if(0===e)i=zd(f,wf(m,wf(g,f)));else{const t=zd(f,wf(m,wf(g,f)));i=bf([Af(i,[0,0],[e,s]),t],0)}const y=Py(m),b=Af(r,[0,e],[n,r.shape[1]-e]);if(0===e)r=zd(b,wf(wf(b,o),y));else{const t=zd(b,wf(wf(b,o),y));r=bf([Af(r,[0,0],[n,e]),t],1)}return[o,i,r]})),lh([t,l,u])}return!t&&n>s&&(r=Af(r,[0,0],[n,s]),i=Af(i,[0,0],[s,s])),[r,i]}))}const Bb=Jc({qr_:function(e,t=!1){if(Ni(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return Fb(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),s=Dy(mf(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],i=[];s.forEach((e=>{const[n,s]=Fb(e,t);r.push(n),i.push(s)}));return[mf(gy(r,0),e.shape),mf(gy(i,0),e.shape)]}}});var zb;!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(zb||(zb={}));const Lb=Jc({computeWeightedLoss_:function(e,t,n=zb.SUM_BY_NONZERO_WEIGHTS){const s=Zc(e,"losses","computeWeightedLoss");let r=null;null!=t&&(r=Zc(t,"weights","computeWeightedLoss"));const i=null==r?s:Ad(s,r);if(n===zb.NONE)return i;if(n===zb.SUM)return wm(i);if(n===zb.MEAN){if(null==r)return rg(i);{const e=s.size/r.size,t=vd(wm(i),wm(r));return e>1?vd(t,_d(e)):t}}if(n===zb.SUM_BY_NONZERO_WEIGHTS){if(null==r)return vd(wm(i),_d(s.size));{const e=Ad(r,ag(s.shape)),t=md(wm(fg(e,_d(0))),"float32");return vd(wm(i),t)}}throw Error(`Unknown reduction: ${n}`)}});const Pb=Jc({absoluteDifference_:function(e,t,n,s=zb.SUM_BY_NONZERO_WEIGHTS){const r=Zc(e,"labels","absoluteDifference"),i=Zc(t,"predictions","absoluteDifference");let a=null;null!=n&&(a=Zc(n,"weights","absoluteDifference")),Oi(r.shape,i.shape,"Error in absoluteDifference: ");const o=Pd(zd(r,i));return Lb(o,a,s)}});const Vb=Jc({cosineDistance_:function(e,t,n,s,r=zb.SUM_BY_NONZERO_WEIGHTS){const i=Zc(e,"labels","cosineDistance"),a=Zc(t,"predictions","cosineDistance");let o=null;null!=s&&(o=Zc(s,"weights","cosineDistance")),Oi(i.shape,a.shape,"Error in cosineDistance: ");const l=_d(1),u=zd(l,wm(Ad(i,a),n,!0));return Lb(u,o,r)}});const Wb=Jc({hingeLoss_:function(e,t,n,s=zb.SUM_BY_NONZERO_WEIGHTS){let r=Zc(e,"labels","hingeLoss");const i=Zc(t,"predictions","hingeLoss");let a=null;null!=n&&(a=Zc(n,"weights","hingeLoss")),Oi(r.shape,i.shape,"Error in hingeLoss: ");const o=_d(1);r=zd(Ad(_d(2),r),o);const l=Ug(zd(o,Ad(r,i)));return Lb(l,a,s)}});const Gb=Jc({huberLoss_:function(e,t,n,s=1,r=zb.SUM_BY_NONZERO_WEIGHTS){const i=Zc(e,"labels","huberLoss"),a=Zc(t,"predictions","huberLoss");let o=null;null!=n&&(o=Zc(n,"weights","huberLoss")),Oi(i.shape,a.shape,"Error in huberLoss: ");const l=_d(s),u=Pd(zd(a,i)),c=lg(u,l),h=zd(u,c),d=bd(Ad(_d(.5),Cd(c)),Ad(l,h));return Lb(d,o,r)}});const Ub=Jc({logLoss_:function(e,t,n,s=1e-7,r=zb.SUM_BY_NONZERO_WEIGHTS){const i=Zc(e,"labels","logLoss"),a=Zc(t,"predictions","logLoss");let o=null;null!=n&&(o=Zc(n,"weights","logLoss")),Oi(i.shape,a.shape,"Error in logLoss: ");const l=_d(1),u=_d(s),c=Um(Ad(i,Wm(bd(a,u)))),h=Ad(zd(l,i),Wm(bd(zd(l,a),u))),d=zd(c,h);return Lb(d,o,r)}});const qb=Jc({meanSquaredError_:function(e,t,n,s=zb.SUM_BY_NONZERO_WEIGHTS){const r=Zc(e,"labels","meanSquaredError"),i=Zc(t,"predictions","meanSquaredError");let a=null;null!=n&&(a=Zc(n,"weights","meanSquaredError")),Oi(r.shape,i.shape,"Error in meanSquaredError: ");const o=fy(r,i);return Lb(o,a,s)}});const jb=Jc({sigmoidCrossEntropy_:function(e,t,n,s=0,r=zb.SUM_BY_NONZERO_WEIGHTS){let i=Zc(e,"multiClassLabels","sigmoidCrossEntropy");const a=Zc(t,"logits","sigmoidCrossEntropy");let o=null;if(null!=n&&(o=Zc(n,"weights","sigmoidCrossEntropy")),Oi(i.shape,a.shape,"Error in sigmoidCrossEntropy: "),s>0){const e=_d(s),t=_d(1),n=_d(.5);i=bd(Ad(i,zd(t,e)),Ad(n,e))}const l=function(e,t){const n=Zc(e,"labels","sigmoidCrossEntropyWithLogits"),s=Zc(t,"logits","sigmoidCrossEntropyWithLogits");Oi(n.shape,s.shape,"Error in sigmoidCrossEntropyWithLogits: ");const r=Ug(s),i=Ad(s,n),a=Gm(Cm(Um(Pd(s))));return bd(zd(r,i),a)}(i,a);return Lb(l,o,r)}});const Hb=Jc({softmaxCrossEntropy_:function(e,t,n,s=0,r=zb.SUM_BY_NONZERO_WEIGHTS){let i=Zc(e,"onehotLabels","softmaxCrossEntropy");const a=Zc(t,"logits","softmaxCrossEntropy");let o=null;if(null!=n&&(o=Zc(n,"weights","softmaxCrossEntropy")),Oi(i.shape,a.shape,"Error in softmaxCrossEntropy: "),s>0){const e=_d(s),t=_d(1),n=_d(i.shape[1]);i=bd(Ad(i,zd(t,e)),vd(e,n))}const l=function(e,t,n=-1){if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);const s=Sd(((e,t,s)=>{const r=$m(t,[n],!0),i=zd(md(t,"float32"),r);s([e,i]);const a=Um(Ad(i,e));return{value:wm(a,[n]),gradFunc:(e,t)=>{const[s,r]=t,i=dm(e.shape,[n]);return[Ad(mf(e,i),zd(md(s,"float32"),Cm(r))),Ad(mf(e,i),zd(Cm(r),md(s,"float32")))]}}}));return s(e,t)}(i,a);return Lb(l,o,r)}});const $b=Jc({sparseFillEmptyRows_:function(e,t,n,s){const r=Zc(e,"indices","sparseFillEmptyRows","int32"),i=Zc(t,"values","sparseFillEmptyRows"),a=Zc(n,"denseShape","sparseFillEmptyRows","int32"),o=Zc(s,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==r.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==a.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(0!==o.rank)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);const l={indices:r,values:i,denseShape:a,defaultValue:o},u=Wc.runKernel(Ql,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}});const Kb=Jc({sparseReshape_:function(e,t,n){const s=Zc(e,"inputIndices","sparseReshape","int32"),r=Zc(t,"inputShape","sparseReshape","int32"),i=Zc(n,"newShape","sparseReshape","int32");if(2!==s.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${s.shape}`);if(1!==r.rank)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(1!==i.rank)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const a={inputIndices:s,inputShape:r,newShape:i},o=Wc.runKernel(Jl,a);return{outputIndices:o[0],outputShape:o[1]}}});const Xb=Jc({sparseSegmentMean_:function(e,t,n){const s=Zc(e,"data","sparseSegmentMean"),r=Zc(t,"indices","sparseSegmentMean","int32"),i=Zc(n,"segmentIds","sparseSegmentMean","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return Wc.runKernel(eu,a)}});const Zb=Jc({sparseSegmentSum_:function(e,t,n){const s=Zc(e,"data","sparseSegmentSum"),r=Zc(t,"indices","sparseSegmentSum","int32"),i=Zc(n,"segmentIds","sparseSegmentSum","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return Wc.runKernel(tu,a)}});const Yb=Jc({stringNGrams_:function(e,t,n,s,r,i,a,o){const l=Zc(e,"data","stringNGrams","string");if("string"!==l.dtype)throw new Error("Data must be of datatype string");if(1!==l.shape.length)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=Zc(t,"dataSplits","stringNGrams");if("int32"!==u.dtype)throw new Error("Data splits must be of datatype int32");const c={separator:n,nGramWidths:s,leftPad:r,rightPad:i,padWidth:a,preserveShortSequences:o},h={data:l,dataSplits:u},d=Wc.runKernel(ou,h,c);return{nGrams:d[0],nGramsSplits:d[1]}}});const Qb=Jc({stringSplit_:function(e,t,n=!0){const s=Zc(e,"input","stringSplit","string"),r=Zc(t,"delimiter","stringSplit","string");if(1!==s.rank)throw new Error(`Input should be Tensor1D but received shape ${s.shape}`);if(0!==r.rank)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);const i={skipEmpty:n},a={input:s,delimiter:r},o=Wc.runKernel(lu,a,i);return{indices:o[0],values:o[1],shape:o[2]}}});const Jb=Jc({stringToHashBucketFast_:function(e,t){const n=Zc(e,"input","stringToHashBucketFast","string"),s={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const r={input:n};return Wc.runKernel(uu,r,s)}});const ew=Jc({staticRegexReplace_:function(e,t,n,s=!0){const r=Zc(e,"input","staticRegexReplace","string"),i={pattern:t,rewrite:n,replaceGlobal:s};return Wc.runKernel(iu,{x:r},i)}}),tw={fft:uy,ifft:cy,rfft:py,irfft:hy},nw={hammingWindow:rb,hannWindow:ib,frame:ab,stft:ob},sw={flipLeftRight:ub,grayscaleToRGB:cb,resizeNearestNeighbor:Nb,resizeBilinear:Tb,rgbToGrayscale:hb,rotateWithOffset:db,cropAndResize:lb,nonMaxSuppression:fb,nonMaxSuppressionAsync:kb,nonMaxSuppressionWithScore:Sb,nonMaxSuppressionWithScoreAsync:_b,nonMaxSuppressionPadded:Eb,nonMaxSuppressionPaddedAsync:Ib,threshold:Ob,transform:Rb},rw={bandPart:Db,gramSchmidt:Mb,qr:Bb},iw={absoluteDifference:Pb,computeWeightedLoss:Lb,cosineDistance:Vb,hingeLoss:Wb,huberLoss:Gb,logLoss:Ub,meanSquaredError:qb,sigmoidCrossEntropy:jb,softmaxCrossEntropy:Hb},aw={sparseFillEmptyRows:$b,sparseReshape:Kb,sparseSegmentMean:Xb,sparseSegmentSum:Zb},ow={stringNGrams:Yb,stringSplit:Qb,stringToHashBucketFast:Jb,staticRegexReplace:ew};const lw=class{static sgd(e){return new jd(e)}static momentum(e,t,n=!1){return new Hd(e,t,n)}static rmsprop(e,t=.9,n=0,s=null,r=!1){return new $d(e,t,n,s,r)}static adam(e=.001,t=.9,n=.999,s=null){return new Ld(e,t,n,s)}static adadelta(e=.001,t=.95,n=null){return new Dd(e,t,n)}static adamax(e=.002,t=.9,n=.999,s=null,r=0){return new qd(e,t,n,s,r)}static adagrad(e,t=.1){return new Fd(e,t)}},uw="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function cw(){return new Promise((e=>uw((()=>e()))))}function hw(e,t){const n=e[0].length;e.forEach(((e,t)=>{Ni(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),Ni(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const s=e[0];e.forEach(((e,r)=>{for(let i=0;i`Error in concat${n}D: Shape of tensors[${r}] (${e}) does not match the shape of the rest (${s}) along the non-concatenated axis ${r}.`))}))}function dw(e,t){const n=e[0].slice();for(let s=1;s=0)if(o>=0){if(o!==i)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${i} but shape[${r+e}] = ${o}`)}else s[a]=i}return s}function mw(e){const t={FIRST_DIM_SIZE:pw.FIRST_DIM_SIZE,VALUE_ROWIDS:pw.VALUE_ROWIDS,ROW_LENGTHS:pw.ROW_LENGTHS,ROW_SPLITS:pw.ROW_SPLITS,ROW_LIMITS:pw.ROW_LIMITS,ROW_STARTS:pw.ROW_STARTS},n=[];for(const s of e){if(!(s in t))break;n.push(t[s])}return n}function gw(e){return 0===e.length?0:e[0]===pw.FIRST_DIM_SIZE?e.length-1:e.length}function yw(e,t){if(null==e||null==t)return;const n=e.length,s=t.length;if(n>=s)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${s})`);for(let r=0;r=0&&s>=0&&1!==n&&n!==s)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${r-e.length}] = ${n} but ragged tensor input.flatValues.shape[${r-e.length}] = ${s}`)}}!function(e){e[e.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",e[e.VALUE_ROWIDS=1]="VALUE_ROWIDS",e[e.ROW_LENGTHS=2]="ROW_LENGTHS",e[e.ROW_SPLITS=3]="ROW_SPLITS",e[e.ROW_LIMITS=4]="ROW_LIMITS",e[e.ROW_STARTS=5]="ROW_STARTS"}(pw||(pw={}));const bw=30;function ww(e){return e<=bw?e:Zi(e,Math.floor(Math.sqrt(e)))}function vw(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function Aw(e,t,n,s=!0){let r=[];if(s)r=r.concat(t.slice(0)),r.push(e[0]/n),r=r.concat(e.slice(1));else{r=r.concat(e[0]);const n=t.length;for(let s=0;s=2*t+1||s%2==1?r.push(s):n.push(s);s.push(...n),s.push(0),s.push(...r)}return s}function Cw(e,t,n,s=!0){const r=[];s?r.push(e[0]/n):r.push(e[0]*n);for(let n=1;nn)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[s-1]} vs. ${n}`);if(0===Di(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const r=t.shape,i=r[r.length-1];let a=1;for(let e=0;ee/u)),1].slice(0,i);return[l,a,u,c]}const Ew=1.7580993408473768,Iw=1.0507009873554805,Tw=.3275911,Nw=.254829592,Ow=-.284496736,Rw=1.421413741,Dw=-1.453152027,Mw=1.061405429;function Fw(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let s=0;s/g,jw=",",Hw="...";function $w(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(qw,"").length)/Uw.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${Uw}").`);const[s,r]=e.split(Uw);Ni(-1===s.indexOf(Hw),(()=>`The ellipsis notation ("${Hw}") is not supported yet.`));const i=s.split(jw),a=i.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const o=[];for(let e=0;e-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===o.indexOf(t)&&o.push(t)}for(let e=0;e-1!==e)),{permutationIndices:n,expandDims:s}}function Xw(e,t,n){const s=new Array(e);for(let e=0;e`Expected dimension ${s[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(r)}, but got dimension ${r[n]}`))}}function Zw(e,t){const n=e,s=[];let r=0;0===e.length&&n.push(-1),r=e.length+1;for(let e=0;ee===t))}function Qw(e,t){const n=[];for(let s=0;s"Number of splits must evenly divide the axis.")),s=new Array(t).fill(e.shape[n]/t);else{const r=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);Ni(r<=1,(()=>"There should be only one negative value in split array."));const i=t.indexOf(-1);if(-1!==i){const s=t.reduce(((e,t)=>t>0?e+t:e));t[i]=e.shape[n]-s}Ni(e.shape[n]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),s=t}return s}function ev(e){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${e}`}function tv(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function nv(e,t,n){return`indices(${e}, 0) is invalid: ${t} >= ${n}`}function sv(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function rv(e,t){return`size ${e} must be non-negative, not ${t}`}function iv(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function av(e,t){return`Input to reshape is a SparseTensor with ${Di(e)}\n dense values, but the requested shape requires a multiple of ${Di(t)}. inputShape=${e} outputShape= ${t}`}function ov(e,t){return`Input to reshape is a tensor with ${Di(e)} dense values, but the requested shape has ${Di(t)}. inputShape=${e} outputShape=${t}`}function lv(){return"segment ids must be >= 0"}function uv(){return"segment ids are not increasing"}function cv(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function hv(e,t,n){return`Bad: indices[${e}] == ${t} out of range [0, ${n})`}function dv(e,t){let n,s=!1;for(e<=bw?(n=e,s=!0):n=Zi(e,Math.floor(Math.sqrt(e)));!s;)n>t||n===e?s=!0:n=Zi(e,n+1);return n}function pv(e,t,n){const s=[],r=e.length;for(let i=0;ir))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${s}`);if(s<0&&(s+=r),s>i)throw new Error(`batchDims (${s}) must be less than rank(x) (\n ${i}).`);if(nnc(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function gv(e){return e.map((e=>tc(e)))}!function(){for(const e of Kd)Od(e)}();const yv={kernelName:ma,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,yy(md(n,"float32"),-1))}}},bv={kernelName:ga,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Cd(md(n,"float32")),s=xd(zd(_d(1),t));return Um(vd(e,s))}}}},wv={kernelName:ya,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=xd(zd(Cd(md(n,"float32")),1));return vd(e,t)}}}},vv={kernelName:ba,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{let t=e;const s=Wd(n.shape,r);return s.length>0&&(t=wm(t,s)),mf(t,n.shape)},b:()=>{let t=e;const n=Wd(s.shape,r);return n.length>0&&(t=wm(t,n)),mf(t,s.shape)}}}},Av={kernelName:wa,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach(((t,s)=>{n[s]=()=>e.clone()})),n}},xv={kernelName:xa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>kd(n)}}},Cv={kernelName:Ca,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>kd(n)}}},kv={kernelName:ka,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,xd(zd(_d(1),Cd(md(n,"float32")))))}}},Sv={kernelName:Sa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=xd(bd(_d(1),Cd(md(n,"float32"))));return vd(e,t)}}}},_v={kernelName:Ia,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=bd(Cd(n),Cd(s));let i=Ad(e,vd(s,t));const a=Wd(n.shape,r);return a.length>0&&(i=wm(i,a)),mf(i,n.shape)},b:()=>{const t=bd(Cd(n),Cd(s));let i=Um(Ad(e,vd(n,t)));const a=Wd(s.shape,r);return a.length>0&&(i=wm(i,a)),mf(i,s.shape)}}}},Ev={kernelName:_a,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,bd(Cd(md(n,"float32")),1))}}},Iv={kernelName:Ea,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,zd(_d(1),Cd(md(n,"float32"))))}}};const Tv=Jc({avgPool3dGrad_:function(e,t,n,s,r,i){const a=Zc(e,"dy","avgPool3dGrad"),o=Zc(t,"input","avgPool3dGrad");let l=a,u=o,c=!1;4===o.rank&&(c=!0,l=mf(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),u=mf(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),Ni(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),Ni(5===u.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`)),ff("avgPool3dGrad",r,i);const h={dy:l,input:u},d={filterSize:n,strides:s,pad:r,dimRoundingMode:i},p=Wc.runKernel(Ra,h,d);return c?mf(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),Nv={kernelName:Oa,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a,dimRoundingMode:o}=n;return{x:()=>Tv(e,s,r,i,a,o)}}};const Ov=Jc({avgPoolGrad_:function(e,t,n,s,r){const i=Zc(e,"dy","avgPoolGrad"),a=Zc(t,"input","avgPoolGrad");Ni(a.rank===i.rank,(()=>`Rank of input (${a.rank}) does not match rank of dy (${i.rank})`));let o=a,l=i,u=!1;3===a.rank&&(u=!0,o=mf(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=mf(i,[1,i.shape[0],i.shape[1],i.shape[2]])),Ni(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),Ni(4===o.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`));const c={dy:l,input:o},h={filterSize:n,strides:s,pad:r},d=Wc.runKernel(Na,c,h);return u?mf(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),Rv={kernelName:Ta,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a}=n;return{x:()=>Ov(e,s,r,i,a)}}},Dv={kernelName:Da,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[s,r]=t,{transposeA:i,transposeB:a}=n;return i||a?!i&&a?{a:()=>wf(e,r,!1,!1),b:()=>wf(e,s,!0,!1)}:i&&!a?{a:()=>wf(r,e,!1,!0),b:()=>wf(s,e,!1,!1)}:{a:()=>wf(r,e,!0,!0),b:()=>wf(e,s,!0,!0)}:{a:()=>wf(e,r,!1,!0),b:()=>wf(s,e,!0,!1)}}},Mv={kernelName:Ma,gradFunc:(e,t,n)=>{const{blockShape:s,crops:r}=n;return{x:()=>Cg(e,s,r)}}},Fv={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const s=n,r=s.inputShape,i=s.shape,a=Array.from(i);for(let e=r.length-1;e>=0;e--)if(r[e]===i[e])a[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${i}].`);const o=[];for(let e=0;e1&&o.push(e);return{x:()=>wm(e,o,!0)}}},Bv={kernelName:La,gradFunc:e=>({x:()=>e.clone()})},zv={kernelName:Pa,gradFunc:e=>({x:()=>kd(e)})},Lv={kernelName:Va,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{clipValueMin:r,clipValueMax:i}=n;return{x:()=>nm(Km(Om(s,r),Lm(s,i)),e,kd(e))}}},Pv={kernelName:Ga,inputsToSave:["x"],gradFunc:yv.gradFunc},Vv={kernelName:Ua,saveAllInputs:!0,gradFunc:(e,t,n)=>{const s=t.map((e=>e.shape)),{axis:r}=n,i=Vi(r,t[0].shape)[0],a=s.map((e=>e[i]));return dy(e,a,i).map((e=>()=>e))}},Wv={kernelName:qa,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{dilations:i,strides:a,pad:o,dataFormat:l}=n;return Ni(cf(i),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`)),{x:()=>Wf(s.shape,e,r,a,o,l),filter:()=>Ky(s,e,r.shape,a,o,l)}}},Gv={kernelName:Ha,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{strides:i,pad:a,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>Pf(e,r,i,a,o,1,l),filter:()=>Ky(e,s,r.shape,i,a,o,l)}}};const Uv=Jc({conv3DBackpropFilter_:function(e,t,n,s,r){let i=e;4===e.rank&&(i=mf(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let a=t;4===a.rank&&(a=mf(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),Ni(5===i.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${i.shape}.`)),Ni(5===a.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${a.shape}.`)),Ni(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),Ni(i.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${i.shape[4]}) must match input depth in filter (${n[3]}.`)),Ni(a.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${a.shape[4]}) must match output depth for filter (${n[4]}).`));const o={x:i,dy:a},l={strides:s,pad:r,filterShape:n};return Wc.runKernel(Ka,o,l)}}),qv={kernelName:$a,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i}=n;Ni(cf(s),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`));const[a,o]=t;return{x:()=>qf(a.shape,e,o,r,i),filter:()=>Uv(a,e,o.shape,r,i)}}},jv={kernelName:Za,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(Um(ny(md(n,"float32"))),e)}}},Hv={kernelName:Ya,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(sy(md(n,"float32")),e)}}},$v={kernelName:Ja,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r,exclusive:i,reverse:a}=n;return{x:()=>{const t=fm([r],s.rank);let n=Xf(e,r,i,!a);return null!=t&&(n=Py(n,t)),n}}}},Kv={kernelName:so,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i,dimRoundingMode:a}=n,o=null==s?[1,1]:s;Ni(cf(o),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`));const[l,u]=t;return Ni(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),Ni(4===u.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`)),Ni(l.shape[3]===u.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`)),Ni(hf(r,o),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`)),ff("depthwiseConv2d",i,a),{x:()=>tb(l.shape,e,u,r,i,o,a),filter:()=>eb(l,e,u.shape,r,i,o,a)}}},Xv={kernelName:oo,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,i={x:s,filter:r,dy:e},a={x:s,filter:r,dy:e};return{x:()=>Wc.runKernel(lo,i,n),filter:()=>Wc.runKernel(uo,a,n)}}},Zv={kernelName:fo,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,s={dy:e,y:n};return{x:()=>Wc.runKernel(mo,s)}}},Yv={kernelName:go,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Ad(Cm(Um(Cd(n))),2/Math.sqrt(Math.PI));return{x:()=>Ad(e,s)}}},Qv={kernelName:bo,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,n)}}},Jv={kernelName:wo,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>mf(e,n.shape)}}},eA={kernelName:vo,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,Cm(n))}}},tA={kernelName:ko,gradFunc:e=>({x:()=>kd(e)})},nA={kernelName:So,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=vd(e,md(s,"float32")),i=Wd(n.shape,r);return i.length>0?mf(wm(t,i),n.shape):t},b:()=>{let t=Ad(e,md(n,"float32"));const i=Wd(s.shape,r);i.length>0&&(t=mf(wm(t,i),s.shape));const a=Cd(s);return Um(vd(t,md(a,"float32")))}}}},sA={kernelName:_o,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:s}=n,[r,i,a,o]=t,l=null==o?_d(1):o,u=Wd(i.shape,r.shape),c=[];if(1===i.rank){for(let e=0;e1===i.rank?mf(Ad(Ad(e,_m(mf(p,[1,1,1,i.shape[0]]),c)),l),r.shape):mf(Ad(Ad(e,p),l),r.shape),mean:()=>{let e=Ad(Ad(p,_d(-1)),d);return 1===i.rank&&(e=wm(e,u)),mf(e,i.shape)},variance:()=>{let e=Ad(Ad(f,h),d);return 1===i.rank&&(e=wm(e,u)),mf(e,i.shape)},scale:()=>{const t=Ad(h,p);let n=Ad(e,t);return 1===i.rank&&(n=wm(n,u)),mf(n,i.shape)},offset:()=>{let t=e;return 1===i.rank&&(t=wm(t,u)),mf(t,i.shape)}}}},rA={kernelName:Eo,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[s,r]=t,{axis:i,batchDims:a}=n,o=Vi(i,s.shape)[0],l=(e,t,n)=>()=>{const s=e.shape,r=t.size,a=s.slice(0,o),l=a.length,u=s.slice(i,s.length).slice(1),c=u.length,h=iA(0,l),d=iA(l+1,l+1+c),p=aA([a,[r],u]),f=mf(n,p),m=mf(t,[r]),g=aA([[l],h,d]),y=Py(f,g);let b=Ry(y,m,e.shape[o]);const w=mm(g);return b=Py(b,w),b};if(1===a){const t=s.shape[0],n=s.split(t,0);return{x:()=>{const t=gy(n.map(((t,n)=>l(t,r.slice(n,1),e.slice(n,1))())));return t.reshape(s.shape)},indices:()=>r}}return{x:l(s,r,e),indices:()=>r}}};function iA(e,t){const n=[];for(let s=e;s{const[n,s]=t;return{a:()=>kd(n),b:()=>kd(s)}}},lA={kernelName:Oo,gradFunc:e=>({x:()=>md(e,"float32")})},uA={kernelName:Mo,gradFunc:e=>({x:()=>kd(e)})},cA={kernelName:Fo,gradFunc:e=>({x:()=>kd(e)})},hA={kernelName:Bo,gradFunc:e=>({x:()=>kd(e)})},dA={kernelName:zo,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{alpha:r}=n,i=Nm(s,0);return{x:()=>nm(i,e,Ad(e,r))}}},pA={kernelName:Go,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,bd(n,1))}}},fA={kernelName:Wo,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,md(n,"float32"))}}},mA={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;return{logits:()=>{const t=Cm(s);return zd(e,Ad(wm(e,r,!0),t))}}}};const gA=Jc({localResponseNormalizationBackprop_:function(e,t,n,s=5,r=1,i=1,a=.5){const o={x:e,y:t,dy:n},l={depthRadius:s,bias:r,alpha:i,beta:a};return Wc.runKernel($o,o,l)}}),yA={kernelName:Ho,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{depthRadius:i,bias:a,alpha:o,beta:l}=n;return{x:()=>gA(s,r,e,i,a,o,l)}}};function bA(e,t,n,s){return t.rankAd(e,md(tm(n,t),e.dtype))}}const wA={kernelName:Ko,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{reductionIndices:r}=s,i=t[0],a=bA(e,t[1],i,Vi(r,i.shape));return{x:()=>a.x()}}},vA={kernelName:Xo,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Ad(e,md(Om(n,s),"float32")),b:()=>Ad(e,md(zm(n,s),"float32"))}}};const AA=Jc({maxPool3dGrad_:function(e,t,n,s,r,i,a){const o=Zc(e,"dy","maxPool3dGrad"),l=Zc(t,"input","maxPool3dGrad"),u=Zc(n,"output","maxPool3dGrad");let c=o,h=l,d=u,p=!1;4===l.rank&&(p=!0,c=mf(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=mf(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=mf(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),Ni(5===c.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${c.rank}.`)),Ni(5===h.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`)),Ni(5===d.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`)),ff("maxPool3dGrad",i,a);const f={dy:c,input:h,output:d},m={filterSize:s,strides:r,pad:i,dimRoundingMode:a},g=Wc.runKernel(Jo,f,m);return p?mf(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),xA={kernelName:Qo,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=n;return{x:()=>AA(e,s,r,i,a,o,l)}}};const CA=Jc({maxPoolGrad_:function(e,t,n,s,r,i,a){const o=Zc(e,"dy","maxPoolGrad"),l=Zc(t,"input","maxPoolGrad"),u=Zc(n,"output","maxPoolGrad");Ni(l.rank===o.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`)),Ni(4===o.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`)),Ni(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),ff("maxPoolGrad",i,a);const c={dy:o,input:l,output:u},h={filterSize:s,strides:r,pad:i,dimRoundingMode:a};return Wc.runKernel(Yo,c,h)}}),kA={kernelName:Zo,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o}=n;return{x:()=>CA(e,s,r,i,a,o)}}},SA={kernelName:rl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Af(e,i,s.shape)}}},_A={kernelName:ml,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:s}=n;return Dy(e,s).map((e=>()=>e))}},EA={kernelName:gl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Af(e,i,s.shape)}}},IA={kernelName:yl,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,s,r]=t,i=n,a=s,o=Gd(i.shape,a.shape);return{a:()=>{const t=md(a,"float32");let n=Ad(e,Ad(t,Bd(i,zd(t,_d(1)))));const s=Wd(i.shape,o);return s.length>0&&(n=wm(n,s)),mf(n,i.shape)},b:()=>{const t=Nm(i,0),n=nm(t,Wm(i),kd(i));let s=Ad(e,Ad(r,n));const l=Wd(a.shape,o);return l.length>0&&(s=wm(s,l)),mf(s,a.shape)}}}};function TA(e,t,n){const s=e.shape.length,r=s-n.length,i=fm(n,s);let a=e;null!=i&&(a=Py(e,i));const o=a.shape.slice(),l=o.splice(s-n.length,n.length).reduce(((e,t)=>e*t),1);o.push(l);let u=function(e,t,n){const s=e.shape.slice();s[n]=1;const r=mf(t,s),i=Kf(e,n,!0,!1),a=Kf(e,n,!0,!0),o=Ad(i,a);return Ad(r,o)}(a.reshape(o),t,r);if(u=u.reshape(a.shape),null!=i){const e=mm(i);u=Py(u,e)}return u}const NA={kernelName:Vl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Nm(n,_d(0)),s=_d(Ew),r=_d(Iw),i=Ad(e,r),a=Ad(Ad(e,s),Cm(md(n,"float32")));return nm(t,i,a)}}}},OA={kernelName:Xl,gradFunc:(e,t,n)=>{const{blockShape:s,paddings:r}=n;return{x:()=>kf(e,s,r)}}},RA={kernelName:Zl,gradFunc:(e,t,n)=>{const{axis:s}=n;return{x:()=>bf(e,s)}}},DA={kernelName:pu,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{reps:r}=n;return{x:()=>{let t=kd(s);if(1===s.rank)for(let n=0;n{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=vd(e,md(s,"float32")),i=Wd(n.shape,r);return i.length>0?mf(wm(t,i),n.shape):t},b:()=>{let t=Ad(e,md(n,"float32"));const i=Wd(s.shape,r);i.length>0&&(t=mf(wm(t,i),s.shape));const a=Cd(s);return Um(vd(t,md(a,"float32")))}}}},Zv,Yv,Qv,Jv,eA,nA,tA,sA,rA,oA,lA,uA,cA,hA,dA,pA,fA,mA,yA,wA,wA,vA,xA,kA,{kernelName:tl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n,i=Vi(r,s.shape),a=Di(hm(s.shape,i)[1]);return{x:()=>{const t=s.shape.slice();i.forEach((e=>{t[e]=1}));const n=mf(e,t);return vd(Ad(n,ag(s.shape,"float32")),a)}}}},{kernelName:nl,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{axis:r}=s,[i,a]=t,o=bA(e,a,i,Vi(r,i.shape));return{x:()=>o.x()}}},{kernelName:sl,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Ad(e,md(Lm(n,s),"float32")),b:()=>Ad(e,md(Nm(n,s),"float32"))}}},SA,{kernelName:il,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=Wd(n.shape,r);return t.length>0?mf(wm(e,t),n.shape):e},b:()=>{const t=Ad(e,Um(Im(vd(n,s)))),i=Wd(s.shape,r);return i.length>0?mf(wm(t,i),s.shape):t}}}},{kernelName:ol,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{const t=Ad(e,md(s,"float32")),i=Wd(n.shape,r);return i.length>0?mf(wm(t,i),n.shape):t},b:()=>{const t=Ad(e,md(n,"float32")),i=Wd(s.shape,r);return i.length>0?mf(wm(t,i),s.shape):t}}}},{kernelName:ll,gradFunc:e=>({x:()=>Um(e)})},{kernelName:fl,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>ig(n.shape,"float32")}}},{kernelName:pl,gradFunc:e=>({x:()=>kd(e)})},_A,EA,EA,IA,{kernelName:bl,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,s]=t,r=Nm(n,0);return{x:()=>nm(r,e,Ad(e,s)),alpha:()=>{let t=nm(r,kd(e),Ad(e,n));const i=Wd(s.shape,e.shape);return i.length>0&&(t=wm(t,i)),mf(t,s.shape)}}}},{kernelName:wl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;let i=[];return i=null==r?s.shape.map(((e,t)=>t)):"number"==typeof r?[r]:r,{x:()=>TA(s,e,i)}}},{kernelName:Sl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,Um(Cd(n)))}}},{kernelName:Rl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Ad(Lm(n,6),yy(n));return{x:()=>Ad(e,md(s,"float32"))}}},{kernelName:_l,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,md(yy(n),"float32"))}}},{kernelName:El,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>mf(e,n.shape)}}},{kernelName:Nl,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>Wc.runKernel(Ol,r,n)}}},{kernelName:Il,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>Wc.runKernel(Tl,r,n)}}},{kernelName:Dl,gradFunc:(e,t,n)=>{const{dims:s}=n,r=Vi(s,e.shape);return{x:()=>jg(e,r)}}},{kernelName:Ml,gradFunc:e=>({x:()=>kd(e)})},{kernelName:Fl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Um(vd(e,Ad(Bd(n,1.5),2)))}}},{kernelName:Pl,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>md(kd(n),"float32"),t:()=>Ad(e,md(n,e.dtype)),e:()=>Ad(e,md(Xm(n),e.dtype))}}},NA,{kernelName:jl,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,Ad(n,zd(_d(1),n)))}}},{kernelName:ql,gradFunc:e=>({x:()=>kd(e)})},{kernelName:Gl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(Hf(md(n,"float32")),e)}}},{kernelName:Ul,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad($f(md(n,"float32")),e)}}},{kernelName:Wl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{begin:r,size:i}=n,a=s.shape,[o,l]=Lp(s,r,i),u=[];for(let t=0;tbg(e,u)}}},{kernelName:Yl,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{dim:r}=n,i=Ad(e,s);return{logits:()=>zd(i,Ad(wm(i,[r],true),s))}}},{kernelName:Hl,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,vf(n))}}},OA,OA,RA,RA,{kernelName:$l,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,Ad(xd(md(n,"float32")),2))}}},{kernelName:su,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=_d(2);return{a:()=>Ad(e,Ad(r,zd(n,s))),b:()=>Ad(e,Ad(r,zd(s,n)))}}},{kernelName:ru,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(e,Ad(md(n,"float32"),2))}}},{kernelName:Au,gradFunc:e=>({x:()=>kd(e)})},{kernelName:cu,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Gd(n.shape,s.shape);return{a:()=>{let t=e;const s=Wd(n.shape,r);return s.length>0&&(t=wm(t,s)),mf(t,n.shape)},b:()=>{let t=e;const n=Wd(s.shape,r);return n.length>0&&(t=wm(t,n)),mf(Um(t),s.shape)}}}},{kernelName:Kl,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,r=s.shape.slice(),{axis:i}=n;Vi(i,s.shape).forEach((e=>{r[e]=1}));const a=mf(e,r),o=Ad(a,ag(s.shape,"float32"));return{x:()=>o}}},{kernelName:hu,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>vd(e,Cd(Hf(n)))}}},{kernelName:du,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Ad(zd(_d(1),Cd(n)),e)}}},DA,{kernelName:gu,gradFunc:(e,t,n)=>{const s=n,{perm:r}=s,i=mm(r);return{x:()=>Py(e,i)}}},{kernelName:bu,gradFunc:(e,t,n)=>{const s=n,{axis:r}=s;return{value:()=>gy(e,r)}}},{kernelName:wu,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=Ud(t,kd(t)),s=Tm(e,n);let r=Om(t,_d(0,"int32"));const i=s.rank-r.rank;for(let e=0;e({x:()=>kd(e)})}];for(const e of MA)Fu(e);Ac().prototype.abs=function(){return this.throwIfDisposed(),Pd(this)},Ac().prototype.acos=function(){return this.throwIfDisposed(),Wp(this)},Ac().prototype.acosh=function(){return this.throwIfDisposed(),Gp(this)},Ac().prototype.add=function(e){return this.throwIfDisposed(),bd(this,e)},Ac().prototype.all=function(e,t){return this.throwIfDisposed(),qp(this,e,t)},Ac().prototype.any=function(e,t){return this.throwIfDisposed(),jp(this,e,t)},Ac().prototype.argMax=function(e){return this.throwIfDisposed(),Hp(this,e)},Ac().prototype.argMin=function(e){return this.throwIfDisposed(),$p(this,e)},Ac().prototype.asScalar=function(){return this.throwIfDisposed(),Ni(1===this.size,(()=>"The array must have only 1 element.")),mf(this,[])},Ac().prototype.asType=function(e){return this.throwIfDisposed(),md(this,e)},Ac().prototype.as1D=function(){return this.throwIfDisposed(),mf(this,[this.size])},Ac().prototype.as2D=function(e,t){return this.throwIfDisposed(),mf(this,[e,t])},Ac().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),mf(this,[e,t,n])},Ac().prototype.as4D=function(e,t,n,s){return this.throwIfDisposed(),mf(this,[e,t,n,s])},Ac().prototype.as5D=function(e,t,n,s,r){return this.throwIfDisposed(),mf(this,[e,t,n,s,r])},Ac().prototype.asin=function(){return this.throwIfDisposed(),Kp(this)},Ac().prototype.asinh=function(){return this.throwIfDisposed(),Xp(this)},Ac().prototype.atan=function(){return this.throwIfDisposed(),Zp(this)},Ac().prototype.atan2=function(e){return this.throwIfDisposed(),Yp(this,e)},Ac().prototype.atanh=function(){return this.throwIfDisposed(),Qp(this)},Ac().prototype.avgPool=function(e,t,n,s){return this.throwIfDisposed(),gf(this,e,t,n,s)},Ac().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),kf(this,e,t)},Ac().prototype.batchNorm=function(e,t,n,s,r){return this.throwIfDisposed(),Sf(this,e,t,n,s,r)},Ac().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Rf(this,e)},Ac().prototype.cast=function(e){return this.throwIfDisposed(),md(this,e)},Ac().prototype.ceil=function(){return this.throwIfDisposed(),Df(this)},Ac().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Mf(this,e,t)},Ac().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof vc&&(e=[e]),bf([this,...e],t)},Ac().prototype.conv1d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Vf(this,e,t,n,s,r,i)},Ac().prototype.conv2dTranspose=function(e,t,n,s,r){return this.throwIfDisposed(),Gf(this,e,t,n,s,r)},Ac().prototype.conv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Pf(this,e,t,n,s,r,i)},Ac().prototype.cos=function(){return this.throwIfDisposed(),Hf(this)},Ac().prototype.cosh=function(){return this.throwIfDisposed(),$f(this)},Ac().prototype.cumprod=function(e,t,n){return this.throwIfDisposed(),Kf(this,e,t,n)},Ac().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),Xf(this,e,t,n)},Ac().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),Yf(this,e,t)},Ac().prototype.depthwiseConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Qf(this,e,t,n,s,r,i)},Ac().prototype.dilation2d=function(e,t,n,s,r){return this.throwIfDisposed(),em(this,e,t,n,s,r)},Ac().prototype.divNoNan=function(e){return this.throwIfDisposed(),sm(this,e)},Ac().prototype.div=function(e){return this.throwIfDisposed(),vd(this,e)},Ac().prototype.dot=function(e){return this.throwIfDisposed(),rm(this,e)},Ac().prototype.elu=function(){return this.throwIfDisposed(),am(this)},Ac().prototype.equal=function(e){return this.throwIfDisposed(),tm(this,e)},Ac().prototype.erf=function(){return this.throwIfDisposed(),lm(this)},Ac().prototype.euclideanNorm=function(e,t){return this.throwIfDisposed(),xm(this,e,t)},Ac().prototype.exp=function(){return this.throwIfDisposed(),Cm(this)},Ac().prototype.expandDims=function(e){return this.throwIfDisposed(),km(this,e)},Ac().prototype.expm1=function(){return this.throwIfDisposed(),Sm(this)},Ac().prototype.fft=function(){return this.throwIfDisposed(),uy(this)},Ac().prototype.flatten=function(){return this.throwIfDisposed(),mf(this,[this.size])},Ac().prototype.floor=function(){return this.throwIfDisposed(),Im(this)},Ac().prototype.floorDiv=function(e){return this.throwIfDisposed(),wd(this,e)},Ac().prototype.gather=function(e,t,n){return this.throwIfDisposed(),Tm(this,e,t,n)},Ac().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Om(this,e)},Ac().prototype.greater=function(e){return this.throwIfDisposed(),Nm(this,e)},Ac().prototype.ifft=function(){return this.throwIfDisposed(),cy(this)},Ac().prototype.irfft=function(){return this.throwIfDisposed(),hy(this)},Ac().prototype.isFinite=function(){return this.throwIfDisposed(),Dm(this)},Ac().prototype.isInf=function(){return this.throwIfDisposed(),Mm(this)},Ac().prototype.isNaN=function(){return this.throwIfDisposed(),Fm(this)},Ac().prototype.leakyRelu=function(e){return this.throwIfDisposed(),Bm(this,e)},Ac().prototype.lessEqual=function(e){return this.throwIfDisposed(),Lm(this,e)},Ac().prototype.less=function(e){return this.throwIfDisposed(),zm(this,e)},Ac().prototype.localResponseNormalization=function(e,t,n,s){return this.throwIfDisposed(),Vm(this,e,t,n,s)},Ac().prototype.logSigmoid=function(){return this.throwIfDisposed(),jm(this)},Ac().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Hm(this,e)},Ac().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),$m(this,e,t)},Ac().prototype.log=function(){return this.throwIfDisposed(),Wm(this)},Ac().prototype.log1p=function(){return this.throwIfDisposed(),Gm(this)},Ac().prototype.logicalAnd=function(e){return this.throwIfDisposed(),Km(this,e)},Ac().prototype.logicalNot=function(){return this.throwIfDisposed(),Xm(this)},Ac().prototype.logicalOr=function(e){return this.throwIfDisposed(),Zm(this,e)},Ac().prototype.logicalXor=function(e){return this.throwIfDisposed(),Ym(this,e)},Ac().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),wf(this,e,t,n)},Ac().prototype.maxPool=function(e,t,n,s){return this.throwIfDisposed(),tg(this,e,t,n,s)},Ac().prototype.max=function(e,t){return this.throwIfDisposed(),ym(this,e,t)},Ac().prototype.maximum=function(e){return this.throwIfDisposed(),Ud(this,e)},Ac().prototype.mean=function(e,t){return this.throwIfDisposed(),rg(this,e,t)},Ac().prototype.min=function(e,t){return this.throwIfDisposed(),bm(this,e,t)},Ac().prototype.minimum=function(e){return this.throwIfDisposed(),lg(this,e)},Ac().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),ug(this,e,t)},Ac().prototype.mod=function(e){return this.throwIfDisposed(),cg(this,e)},Ac().prototype.mul=function(e){return this.throwIfDisposed(),Ad(this,e)},Ac().prototype.neg=function(){return this.throwIfDisposed(),Um(this)},Ac().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Am(this,e,t,n)},Ac().prototype.notEqual=function(e){return this.throwIfDisposed(),fg(this,e)},Ac().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),mg(this,e,t,n)},Ac().prototype.onesLike=function(){return this.throwIfDisposed(),gg(this)},Ac().prototype.pad=function(e,t){return this.throwIfDisposed(),bg(this,e,t)},Ac().prototype.pool=function(e,t,n,s,r,i){return this.throwIfDisposed(),kg(this,e,t,n,s,r,i)},Ac().prototype.pow=function(e){return this.throwIfDisposed(),Bd(this,e)},Ac().prototype.prelu=function(e){return this.throwIfDisposed(),Sg(this,e)},Ac().prototype.prod=function(e,t){return this.throwIfDisposed(),_g(this,e,t)},Ac().prototype.reciprocal=function(){return this.throwIfDisposed(),Gg(this)},Ac().prototype.relu=function(){return this.throwIfDisposed(),Ug(this)},Ac().prototype.relu6=function(){return this.throwIfDisposed(),qg(this)},Ac().prototype.reshapeAs=function(e){return this.throwIfDisposed(),mf(this,e.shape)},Ac().prototype.reshape=function(e){return this.throwIfDisposed(),mf(this,e)},Ac().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),Tb(this,e,t,n)},Ac().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),Nb(this,e,t,n)},Ac().prototype.reverse=function(e){return this.throwIfDisposed(),jg(this,e)},Ac().prototype.rfft=function(){return this.throwIfDisposed(),py(this)},Ac().prototype.round=function(){return this.throwIfDisposed(),Zg(this)},Ac().prototype.rsqrt=function(){return this.throwIfDisposed(),Yg(this)},Ac().prototype.selu=function(){return this.throwIfDisposed(),Qg(this)},Ac().prototype.separableConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),Jg(this,e,t,n,s,r,i)},Ac().prototype.sigmoid=function(){return this.throwIfDisposed(),vf(this)},Ac().prototype.sign=function(){return this.throwIfDisposed(),ty(this)},Ac().prototype.sin=function(){return this.throwIfDisposed(),ny(this)},Ac().prototype.sinh=function(){return this.throwIfDisposed(),sy(this)},Ac().prototype.slice=function(e,t){return this.throwIfDisposed(),Af(this,e,t)},Ac().prototype.softmax=function(e){return this.throwIfDisposed(),ly(this,e)},Ac().prototype.softplus=function(){return this.throwIfDisposed(),qm(this)},Ac().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Cg(this,e,t)},Ac().prototype.split=function(e,t){return this.throwIfDisposed(),dy(this,e,t)},Ac().prototype.sqrt=function(){return this.throwIfDisposed(),xd(this)},Ac().prototype.square=function(){return this.throwIfDisposed(),Cd(this)},Ac().prototype.squaredDifference=function(e){return this.throwIfDisposed(),fy(this,e)},Ac().prototype.squeeze=function(e){return this.throwIfDisposed(),my(this,e)},Ac().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof vc?[this,e]:[this,...e];return gy(n,t)},Ac().prototype.step=function(e){return this.throwIfDisposed(),yy(this,e)},Ac().prototype.stridedSlice=function(e,t,n,s,r,i,a,o){return this.throwIfDisposed(),by(this,e,t,n,s,r,i,a,o)},Ac().prototype.sub=function(e){return this.throwIfDisposed(),zd(this,e)},Ac().prototype.sum=function(e,t){return this.throwIfDisposed(),wm(this,e,t)},Ac().prototype.tan=function(){return this.throwIfDisposed(),wy(this)},Ac().prototype.tanh=function(){return this.throwIfDisposed(),xf(this)},Ac().prototype.tile=function(e){return this.throwIfDisposed(),_m(this,e)},Ac().prototype.toBool=function(){return this.throwIfDisposed(),md(this,"bool")},Ac().prototype.toFloat=function(){return this.throwIfDisposed(),md(this,"float32")},Ac().prototype.toInt=function(){return this.throwIfDisposed(),md(this,"int32")},Ac().prototype.topk=function(e,t){return this.throwIfDisposed(),Ty(this,e,t)},Ac().prototype.transpose=function(e){return this.throwIfDisposed(),Py(this,e)},Ac().prototype.unique=function(e){return this.throwIfDisposed(),Oy(this,e)},Ac().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Ry(this,e,t)},Ac().prototype.unstack=function(e){return this.throwIfDisposed(),Dy(this,e)},Ac().prototype.where=function(e,t){return this.throwIfDisposed(),nm(e,this,t)},Ac().prototype.zerosLike=function(){return this.throwIfDisposed(),kd(this)};class FA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,FA.prototype)}}class BA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,BA.prototype)}}class zA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,zA.prototype)}}class LA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,LA.prototype)}}class PA extends Error{constructor(e){super(e),Object.setPrototypeOf(this,PA.prototype)}}Error;class VA{constructor(e){this.maxEntries=e||100,this.cache=new Map}get(e){let t;return this.cache.has(e)&&(t=this.cache.get(e),this.cache.delete(e),this.cache.set(e,t)),t}put(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxEntries){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,t)}getMaxEntries(){return this.maxEntries}setMaxEntries(e){if(e<0)throw new Error(`The maxEntries of LRU caches must be at least 0, but got ${e}.`);if(this.maxEntries>e)for(let t=0;tt.toUpperCase()))}let KA={};function XA(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function ZA(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e=>ZA(e)));else{const t=Object.keys(e);for(const n of t){const t=e[n];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?ZA(t):e[n]=t.value)}}}function YA(e,t={},n={},s="object",r=!1){if("string"==typeof e){const r=e;let i;if(r in n)i=n[r];else if(r in KA)i=KA[r];else if(i=t[r],null==i)throw new zA(`Unknown ${s}: ${e}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return i}{const i=e;if(null==i.className||null==i.config)throw new zA(`${s}: Improper config format: ${JSON.stringify(i)}.\n'className' and 'config' must set.`);const a=i.className;let o,l;if(a in n?[o,l]=n[a]:a in KA?[o,l]=KA.className:a in t&&([o,l]=t[a]),null==o)throw new zA(`Unknown ${s}: ${a}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(KA))e[t]=KA[t];for(const t of Object.keys(n))e[t]=n[t];i.config.customObjects=e;const t=Object.assign({},KA);for(const e of Object.keys(n))KA[e]=n[e];ZA(i.config);const s=l(o,i.config,n,r);return KA=Object.assign({},t),s}{const e=Object.assign({},KA);for(const e of Object.keys(n))KA[e]=n[e];const t=new o(i.config);return KA=Object.assign({},e),t}}}function QA(e,t){return-1*function(e,t){return et?1:0}(e,t)}function JA(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function ex(e){if(null==e)throw new zA(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function tx(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new zA(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function nx(e,t,n=0,s=1/0){return GA(n>=0),GA(s>=n),Array.isArray(e)&&e.length>=n&&e.length<=s&&e.every((e=>typeof e===t))}function sx(e,t){Array.isArray(e)?(Ni(e.length>0,(()=>`${t} is unexpectedly an empty array.`)),e.forEach(((e,n)=>sx(e,`element ${n+1} of ${t}`)))):Ni(Number.isInteger(e)&&e>0,(()=>`Expected ${t} to be a positive integer, but got ${rx(e)}.`))}function rx(e){return null===e?"null":Array.isArray(e)?"["+e.map((e=>rx(e))).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function ix(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}let ax=0;function ox(){return ax++}const lx={};function ux(e=""){return e in lx||(lx[e]=0),lx[e]+=1,e+lx[e].toString()}const cx=["channelsFirst","channelsLast"],hx=["nearest","bilinear"],dx=["valid","same","causal"],px=["max","avg"],fx=["sum","mul","concat","ave"],mx=new Map;function gx(e){tx(cx,"DataFormat",e)}function yx(e){tx(dx,"PaddingMode",e)}function bx(e){tx(px,"PoolMode",e)}const wx=[],vx="/";function Ax(e,t){wx.push(e);try{const e=t();return wx.pop(),e}catch(e){throw wx.pop(),e}}function xx(e){if(!Sx(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===wx.length?"":wx.join(vx)+vx)+e}function Cx(e){if(!Sx(e))throw new Error("Not a valid tensor name: '"+e+"'");mx.has(e)||mx.set(e,0);const t=mx.get(e);if(mx.set(e,mx.get(e)+1),t>0){const n=`${e}_${t}`;return mx.set(n,1),n}return e}const kx=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Sx(e){return!!e.match(kx)}function _x(e,t,n){null==t&&(t=0),null==n&&(n=e.length);let s=1;for(let r=t;rt&&(t=s)}return t}function Tx(e,t){if(t{switch(e.rank){case 1:return ry(e,t,n);case 2:return iy(e,[t,0],[n,e.shape[1]]);case 3:return ay(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return oy(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Af(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Af(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new zA(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Fx(e,t,n){return oh((()=>{switch(e.rank){case 1:return ry(e,t,n);case 2:return iy(e,[0,t],[e.shape[0],n]);case 3:return ay(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return oy(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new zA(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Bx(e,t,n,s){return oh((()=>{switch(e.rank){case 1:return ry(e,t,n);case 2:switch(s){case 1:return Mx(e,t,n);case 2:return Fx(e,t,n);default:throw new zA(`The axis is not within the rank of the tensor ${s}`)}case 3:switch(s){case 1:return Mx(e,t,n);case 2:return ay(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return Fx(e,t,n);default:throw new zA(`The axis is not within the rank of the tensor ${s}`)}case 4:switch(s){case 1:return Mx(e,t,n);case 2:return oy(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return oy(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return Fx(e,t,n);default:throw new zA(`The axis is not within the rank of the tensor ${s}`)}default:throw new zA(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function zx(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),bf(e,t)}function Lx(e,t){switch(e.rank){case 1:return Ff([e,t]);case 2:return Bf([e,t],0);case 3:return zf([e,t],0);case 4:return Lf([e,t],0);default:throw new zA(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function Px(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new zA(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return _m(e,t)}function Vx(e,t=0,n=1,s,r){return Bg(e,t,n,s,r)}function Wx(e,t,n,s){if(e.rank<2||t.rank<2)throw new LA(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){if(e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new LA(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(2===e.rank&&2===t.rank){return sb({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?qx(e.rank,s,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),i=r.pop();e=mf(e,[-1,i]);const a=t.shape.slice(),o=a.pop(),l=a.pop(),u=[...a,o],c=Array.from({length:t.rank},((e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n));t=mf(Py(t,c),[l,-1]);const h=[...r,...u];return mf(sb({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?qx(e.rank,s,"channelsLast"):null,activation:n}),h)}}function Gx(e,t,n){return oh((()=>(t=Array.isArray(t)?vy(t,"int32"):md(t,"int32"),Tm(e,t,n))))}function Ux(e){return Ad(e,e)}function qx(e,t,n){const s=t.shape;if(1!==t.rank&&t.rank!==e)throw new zA(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===s.length?mf(t,[1,s[0],1,1,1]):mf(t,[1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?mf(t,[1,1,1,1,s[0]]):mf(t,[1].concat(s))}else if(4===e){if("channelsFirst"===n)return 1===s.length?mf(t,[1,s[0],1,1]):mf(t,[1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?mf(t,[1,1,1,s[0]]):mf(t,[1].concat(s))}else if(3===e){if("channelsFirst"===n)return 1===s.length?mf(t,[1,s[0],1]):mf(t,[1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?mf(t,[1,1,s[0]]):mf(t,[1].concat(s))}else if(e<3)return t;throw new zA(`Unsupported input rank by biasAdd: ${t.rank}`)}function jx(e,t,n){return oh((()=>(null==n&&(n="channelsLast"),gx(n),bd(e,qx(e.rank,t,n)))))}function Hx(e,t,n,s){return oh((()=>qy(e,t,n,s)))}function $x(e,t,n=!1){return n?e():t()}const Kx=["fanIn","fanOut","fanAvg"],Xx=["normal","uniform","truncatedNormal"];class Zx extends Td{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class Yx extends Zx{apply(e,t){return ig(e,t)}}Yx.className="Zeros",Od(Yx);class Qx extends Zx{apply(e,t){return ag(e,t)}}Qx.className="Ones",Od(Qx);class Jx extends Zx{constructor(e){if(super(),"object"!=typeof e)throw new zA(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new zA(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return oh((()=>Ad(_d(this.value),ag(e,t))))}getConfig(){return{value:this.value}}}Jx.className="Constant",Od(Jx);class eC extends Zx{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return Lg(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}eC.className="RandomUniform",Od(eC);class tC extends Zx{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new LA(`randomNormal does not support dType ${t}.`);return Vx(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}tC.className="RandomNormal",Od(tC);class nC extends Zx{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new LA(`truncatedNormal does not support dType ${t}.`);return Ny(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}nC.className="TruncatedNormal",Od(nC);class sC extends Zx{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return oh((()=>{if(2!==e.length||e[0]!==e[1])throw new zA("Identity matrix initializer can only be used for 2D square matrices.");return Ad(this.gain,Em(e[0]))}))}getConfig(){return{gain:this.gain}}}sC.className="Identity",Od(sC);class rC extends Zx{constructor(e){if(super(),e.scale<0)throw new zA(`scale must be a positive float. Got: ${e.scale}`);var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,tx(Kx,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){tx(Xx,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,s;if(gx(t),2===e.length)n=e[0],s=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=_x(e,2);n=e[1]*t,s=e[0]*t}else if("channelsLast"===t){const t=_x(e,0,e.length-2);n=e[e.length-2]*t,s=e[e.length-1]*t}}else{const t=_x(e);n=Math.sqrt(t),s=Math.sqrt(t)}return[n,s]}(e),s=n[0],r=n[1];let i=this.scale;if("fanIn"===this.mode?i/=Math.max(1,s):"fanOut"===this.mode?i/=Math.max(1,r):i/=Math.max(1,(s+r)/2),"normal"===this.distribution){const n=Math.sqrt(i);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new LA(`${this.getClassName()} does not support dType ${t}.`);return Ny(e,0,n,t,this.seed)}{const n=Math.sqrt(3*i);return Lg(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}rC.className="VarianceScaling",Od(rC);class iC extends rC{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return rC.className}}iC.className="GlorotUniform",Od(iC);class aC extends rC{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return rC.className}}aC.className="GlorotNormal",Od(aC);class oC extends rC{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return rC.className}}oC.className="HeNormal",Od(oC);class lC extends rC{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return rC.className}}lC.className="HeUniform",Od(lC);class uC extends rC{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return rC.className}}uC.className="LeCunNormal",Od(uC);class cC extends rC{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return rC.className}}cC.className="LeCunUniform",Od(cC);class hC extends Zx{constructor(e){super(),this.DEFAULT_GAIN=1,this.ELEMENTS_WARN_SLOW=2e3,this.gain=null==e.gain?this.DEFAULT_GAIN:e.gain,this.seed=e.seed}apply(e,t){return oh((()=>{if(e.length<2)throw new LA("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=Di(e.slice(0,-1)),s=e[e.length-1];this.ELEMENTS_WARN_SLOW;const r=Vx([Math.max(s,n),Math.min(s,n)],0,1,t,this.seed),i=rw.qr(r,!1);let a=i[0];const o=i[1].flatten().stridedSlice([0],[Math.min(s,n)*Math.min(s,n)],[Math.min(s,n)+1]);return a=Ad(a,o.sign()),ne*t));return t}const AC="Variable";class xC{constructor(e,t="float32",n=AC,s=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=ox(),n=null==n?AC:n,this.originalName=xx(n),this.name=Cx(this.originalName),this.trainable_=s,this.constraint=r,this.val=Fy(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function CC(e){return e.map((e=>e.read()))}function kC(e){e.forEach((e=>{e[0].write(e[1])}))}class SC{constructor(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class _C{constructor(e,t,n,s,r,i,a){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=s,this.callArgs=r,this.outputTensorIndex=a,this.id=ox(),null!=i&&(this.originalName=xx(i),this.name=Cx(this.originalName)),this.rank=t.length}}let EC=0;class IC{constructor(e,t){this.callArgs=t,this.id=EC++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(const t of e.inboundLayers)null!=t&&t.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const t of this.inboundLayers)null!=t?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let TC=0;class NC extends Td{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=TC++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){const e=this.getClassName();t=HA(e)+"_"+ux(e)}if(this.name=t,this.trainable_=null==e.trainable||e.trainable,null!=e.inputShape||null!=e.batchInputShape){let t;if(null!=e.batchInputShape)t=e.batchInputShape;else if(null!=e.inputShape){let n=null;null!=e.batchSize&&(n=e.batchSize),t=[n].concat(e.inputShape)}this.batchInputShape=t;let n=e.dtype;null==n&&(n=e.inputDType),null==n&&(n="float32"),this.dtype=n}null!=e.weights?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(0===this.inboundNodes.length)throw new BA(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new zA(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return qA(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return qA(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new FA(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new FA(`Layer ${this.name} is not connected, no input to return.`);return qA(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new FA(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new FA(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return qA(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map((e=>e()))}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach((t=>t.trainable=e)),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter((e=>e.trainable)):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter((e=>!e.trainable)).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){const t=jA(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=jA(this.inputSpec);if(t.length!==n.length)throw new zA(`Layer ${this.name} expects ${n.length} inputs, but it received ${t.length} input tensors. Input received: ${e}`);for(let e=0;er.maxNDim)throw new zA(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${i}`);if(null!=r.minNDim&&i=0?t[s]:t[t.length+s];if(null!=i&&-1===[i,null].indexOf(a))throw new zA(`Input ${e} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${i} but got shape ${t}.`)}}if(null!=r.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of jA(e))t.push(n.shape);this.build(qA(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t);this.supportsMasking&&this.setMaskMetadata(e,s);const r=jA(s),i=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),i.push(e);if(s=qA(i),null!=this.activityRegularizer)throw new LA("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(e){e=jA(e);const t=[];for(const n of e)t.push(n.shape);return qA(t)}(e),s=this.computeOutputShape(n);let r;const i="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),r=null!=s&&s.length>0&&Array.isArray(s[0])?s.map(((n,s)=>new _C(i,n,this,jA(e),t,this.name,s))):new _C(i,s,this,jA(e),t,this.name),this.addInboundNode(e,r,null,null,n,s,t),this._refCount++,null!=this.activityRegularizer)throw new LA("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return r}}))}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length);else{let t=!1;this.batchInputShape.forEach(((n,s)=>{null!=n&&null!=e[s]&&e[s]!==n&&(t=!0)}))}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new FA(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const n=JSON.stringify(t.outputShapes);-1===e.indexOf(n)&&e.push(n)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new FA(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new BA(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return vC(this.weights)}build(e){this.built=!0}getWeights(e=!1){return CC(e?this.trainableWeights:this.weights)}setWeights(e){oh((()=>{const t=this.weights;if(t.length!==e.length)throw new zA(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(0===t.length)return;const n=[],s=CC(t);for(let r=0;rr.apply(u.read()))),null==i&&(i=!0),i?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=jA(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach((e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)}))}return null}return t}setMaskMetadata(e,t,n){if(!this.supportsMasking)return;const s=this.computeMask(e,n),r=jA(t),i=jA(s);if(r.length!==i.length)throw new Error(`${this.name} outputs ${r.length} tensors but ${r.length} masks for those tensors`);for(let e=0;ee.dispose())),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0==--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function OC(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[n];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let n=0;ne.name)),l=[],u=t.names();for(const e of o)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=s&&(s.maxNumTensors=-1/0,s.minNumTensors=1/0);const c=o.join(",")+"|"+t.names().sort().join(",");let h,d=MC.get(c);if(null==d){const e=function(e,t){Ni(null!=e&&e.length>0,(()=>"Expected at least one fetch, got none"));let n=[],s={};if(1===e.length){const r=LC(e[0],t);n=r.sorted,s=r.recipientMap}else{const r=new Set;for(const i of e){const{sorted:e,recipientMap:a}=LC(i,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in a)null==s[e]&&(s[e]=new Set),a[e].forEach((t=>s[e].add(t)))}}return{sorted:n,recipientCounts:zC(s)}}(a,t);d=e.sorted,h=e.recipientCounts,MC.put(c,d),FC.put(c,h)}h={},r||Object.assign(h,FC.get(c));const p=new DC(t);for(let e=0;es.maxNumTensors&&(s.maxNumTensors=e),e0;){const e=i[i.length-1];if(n.has(e.name)){i.pop();continue}const t=a[a.length-1]===i.length-1;if(0===e.inputs.length||t)i.pop(),s.push(e),n.add(e.name),t&&a.pop();else{a.push(i.length-1);for(const t of e.inputs)null==r[t.name]&&(r[t.name]=new Set),r[t.name].add(e.name),n.has(t.name)||i.push(t)}}return{sorted:s,recipientMap:r}}function PC(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;txd(wm(Ad(e,e),t,!0))))}ca().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",(()=>100),(function(e){null!=MC&&MC.setMaxEntries(e),null!=FC&&FC.setMaxEntries(e)}));class WC extends Td{getConfig(){return{}}}class GC extends WC{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return oh((()=>{const t=VC(e,this.axis),n=Mf(t,0,this.maxValue);return Ad(e,vd(n,bd(Ox(),t)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}GC.className="MaxNorm",Od(GC);class UC extends WC{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return oh((()=>vd(e,bd(Ox(),VC(e,this.axis)))))}getConfig(){return{axis:this.axis}}}UC.className="UnitNorm",Od(UC);class qC extends WC{apply(e){return Ug(e)}}qC.className="NonNeg",Od(qC);class jC extends WC{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return oh((()=>{const t=VC(e,this.axis),n=bd(Ad(this.rate,Mf(t,this.minValue,this.maxValue)),Ad(1-this.rate,t));return Ad(e,vd(n,bd(Ox(),t)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}jC.className="MinMaxNorm",Od(jC);const HC={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function $C(e){return XA(e)}function KC(e,t={}){return YA(e,Nd.getMap().classNameMap,t,"constraint")}function XC(e){if(null==e)return null;if("string"==typeof e){return KC({className:e in HC?HC[e]:e,config:{}})}return e instanceof WC?e:KC(e)}async function ZC(e){if(null==e)return;const t=[],n=[],s=[];for(const r in e){const i=e[r];if("number"!=typeof i){const e=i;t.push(e.data()),n.push(r),s.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;tbd(this.totals[e],Ad(s,n))));this.totals[e]=r,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:oh((()=>{const n=Ad(vd(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),uh(t[e])})))}}class nk extends JC{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],n=[];for(const s in this.history){const r=this.history[s];for(let i=0;i{const a=null!=n?n():ec();return a-rnew sk(e,t)))}class ik{constructor(){}static registerCallbackConstructor(e,t){Ni(e>=0&&Number.isInteger(e),(()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`)),ik.checkForDuplicate(t),null==ik.constructors[e]&&(ik.constructors[e]=[]),ik.constructors[e].push(t)}static checkForDuplicate(e){for(const t in ik.constructors){ik.constructors[+t].forEach((t=>{if(t===e)throw new zA("Duplicate callback constructor.")}))}}static clear(){ik.constructors={}}static createCallbacks(e){const t=[];for(const n in ik.constructors){const s=+n;e>=s&&t.push(...ik.constructors[s])}return t.map((e=>new e))}}function ak(e,t,n,s,r,i,a,o,l){const u=new nk,c=[new tk,...ik.createCallbacks(t)];null!=e&&c.push(...e),c.push(u);const h=new ek(c);return h.setParams({epochs:n,initialEpoch:s,samples:r,steps:i,batchSize:a,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:u}}function ok(e,t={},n=!1){return YA(e,Nd.getMap().classNameMap,t,"layer",n)}function lk(e,t){return oh((()=>{"float32"!==e.dtype&&(e=md(e,"float32"));const n=wm(Ux(e),t,!0),s=Md(n.shape,Ox()),r=xd(Ud(n,s));return vd(e,r)}))}function uk(e,t){return oh((()=>rg(Ux(zd(t,e)),-1)))}function ck(e,t){return oh((()=>rg(Pd(zd(t,e)),-1)))}function hk(e,t){return oh((()=>{const n=zd(e,t),s=Mf(Pd(e),Ox(),Number.MAX_VALUE),r=Pd(vd(n,s));return Ad(100,rg(r,-1))}))}function dk(e,t){return oh((()=>{const n=Mf(t,Ox(),Number.MAX_VALUE),s=Wm(bd(1,n)),r=Mf(e,Ox(),Number.MAX_VALUE),i=Wm(bd(1,r));return rg(Ux(zd(s,i)),-1)}))}function pk(e,t,n=!1){return oh((()=>{if(n)t=ly(t);else{const e=wm(t,t.shape.length-1,!0);t=vd(t,e)}return t=Mf(t,Ox(),1-Ox()),Um(wm(Ad(md(e,"float32"),Wm(t)),t.shape.length-1))}))}function fk(e,t,n=!1){return oh((()=>{const s=md(Im(function(e){const t=[_x(e.shape)];return mf(e,t)}(e)),"int32"),r=(t=Mf(t,Ox(),1-Ox())).shape;return pk(mf(mg(s,r[r.length-1]),r),t,n)}))}function mk(e,t){return oh((()=>{let n;return n=Mf(t,Ox(),1-Ox()),n=Wm(vd(n,zd(1,n))),rg(function(e,t){if(!Mi(e.shape,t.shape))throw new zA(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return oh((()=>{const n=Ug(t),s=Um(Pd(t));return bd(zd(n,Ad(t,e)),Gm(Cm(s)))}))}(e,n),-1)}))}function gk(e,t){return oh((()=>{const n=Mf(e,Ox(),1),s=Mf(t,Ox(),1);return wm(Ad(e,Wm(vd(n,s))),-1)}))}function yk(e,t){return oh((()=>{const n=lk(e,-1),s=lk(t,-1),r=Ad(n,s);return Um(wm(r,-1))}))}ik.constructors={};const bk={meanSquaredError:uk,meanAbsoluteError:ck,meanAbsolutePercentageError:hk,meanSquaredLogarithmicError:dk,squaredHinge:function(e,t){return oh((()=>{const n=Ud(0,zd(1,Ad(e,t)));return rg(Ux(n),-1)}))},hinge:function(e,t){return oh((()=>{const n=Ud(0,zd(1,Ad(e,t)));return rg(n,-1)}))},categoricalHinge:function(e,t){return oh((()=>{const n=wm(Ad(e,t),-1),s=ym(Ad(zd(1,e),t),-1);return Ud(0,bd(1,zd(s,n)))}))},logcosh:function(e,t){return oh((()=>{const n=Math.log(2),s=zd(t,e),r=zd(bd(s,qm(Ad(-2,s))),n);return rg(r,-1)}))},categoricalCrossentropy:pk,sparseCategoricalCrossentropy:fk,binaryCrossentropy:mk,kullbackLeiblerDivergence:gk,poisson:function(e,t){return oh((()=>{const n=Wm(bd(Ox(),t));return rg(zd(t,Ad(e,n)),-1)}))},cosineProximity:yk};function wk(e){if("string"==typeof e){if(e in bk)return bk[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new zA(t)}return e}function vk(e,t){return oh((()=>{const n=Ad(.5,gg(t)),s=Rx(Nm(t,n),e.dtype);return rg(tm(e,s),-1)}))}function Ak(e,t){return oh((()=>Rx(tm(Hp(e,-1),Hp(t,-1)),"float32")))}function xk(e,t){return oh((()=>md(wm(Km(tm(e,1),tm(t,1))),"float32")))}function Ck(e,t){return mk(e,t)}function kk(e,t){return e.rank===t.rank&&(e=my(e,[e.rank-1])),(t=Hp(t,-1)).dtype!==e.dtype&&(t=md(t,e.dtype)),md(tm(e,t),"float32")}const Sk=pk,_k=fk,Ek={binaryAccuracy:vk,categoricalAccuracy:Ak,precision:function(e,t){return oh((()=>{const n=xk(e,t),s=function(e,t){return oh((()=>md(wm(Km(tm(e,0),tm(t,1))),"float32")))}(e,t),r=bd(n,s);return md(nm(Nm(r,0),vd(n,r),0),"float32")}))},categoricalCrossentropy:Sk,sparseCategoricalCrossentropy:_k,mse:uk,MSE:uk,mae:ck,MAE:ck,mape:hk,MAPE:hk,cosine:yk};function Ik(e){if("string"==typeof e&&e in Ek)return Ek[e];if("string"!=typeof e&&null!=e)return e;throw new zA(`Unknown metric ${e}`)}function Tk(e){if(GA(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(bk))if(bk[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(Ek))if(Ek[n]===e){t=n;break}return void 0!==t?t:e.name}}function Nk(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Ok(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){JSON.stringify(e).length}}function Ok(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const n of t){if("string"!=typeof n)return!1;if(!Ok(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Ok(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function Rk(e,t,n,s=console.log){const r=function(e){let t=!0;const n=[],s=[];for(const t in e.nodesByDepth)n.push(e.nodesByDepth[t]);for(const e of n){if(e.length>1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}s.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const r of n.inboundNodes)if(-1!==s.indexOf(r)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),i=["Layer (type)","Input Shape","Output shape","Param #"];let a;if(r?(t=t||90,n=n||[.32,.61,.89,1]):(t=t||115,n=n||[.24,.48,.7,.8,1]),n[n.length-1]<=1&&(n=n.map((e=>Math.floor(t*e)))),!r){i.push("Receives inputs"),a=[];for(const t in e.nodesByDepth)a.push(...e.nodesByDepth[t])}s("_".repeat(t)),Dk(i,n,s),s("=".repeat(t));const o=e.layers;for(let e=0;e0&&(s=s.slice(0,s.length-1)+" "),s+=e[n],s=s.slice(0,t[n]),s+=" ".repeat(t[n]-s.length);n(s)}function Mk(e,t,n){let s,r;try{r=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){r="multiple"}try{s=JSON.stringify(e.outputShape)}catch(e){s="multiple"}Dk([`${e.name} (${e.getClassName()})`,r,s,e.countParams().toString()],t,n)}function Fk(e,t,n,s){let r,i;try{i=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){i="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const a=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;ee.name))}`);JA(this.outputs).length,this.outputs.length,this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(s)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;GA(0===n,"input layer has >1 nodes"),GA(0===s,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(s)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;te.shape)),this.internalOutputShapes=this.outputs.map((e=>e.shape));const t={},n={},s={},r={},i={},a=[],o=(e,t,n,s,r,l)=>{null!=s&&null!=r&&null!=l||(s=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const u=s.inboundNodes[r];if(-1!==n.indexOf(u))throw new BA(`The tensor ${e.name} at layer "${s.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(Vk.nodeKey(s,r)),s.id in i||(i[s.id]=Object.keys(i).length),-1===n.indexOf(u)&&n.push(u);const c=u.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(u),1);a.push(u)},l=[],u=[];for(const e of this.outputs)o(e,l,u);const c=a.slice().reverse();for(const e of c){n[e.id]=e,e.id in t||(t[e.id]=0);let i=t[e.id];const a=null==s[e.outboundLayer.id]?0:s[e.outboundLayer.id];i=Math.max(i,a),s[e.outboundLayer.id]=i,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=i;for(let s=0;sparseInt(e,10))).sort(QA);this.layers=[];for(const e of p){const t=d[e];t.sort(((e,t)=>{const n=i[e.id],s=i[t.id];return ns?1:0}));for(const e of t)e instanceof Vk&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=d,p=Object.keys(h).map((e=>parseInt(e,10))).sort(QA);const f=this.inputs.slice(),m=[];for(const e of p)for(const t of h[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new BA(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${e.name}". The following previous layers were accessed without issue: ${m}`);for(const e of t.outputTensors)f.push(e);m.push(e.name)}}this.nodesByDepth=h;const g=this.layers.map((e=>e.name));for(const e of g){const t=g.filter((t=>t===e)).length;if(1!==t)throw new BA(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new IC({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map((e=>null)),outputMasks:this.outputs.map((e=>null)),inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs.map((e=>e.shape))}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach((t=>{t._trainableWeights.forEach((t=>t.trainable=e))})),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new zA("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const n={};let s=0;const r=(e=>{const t=Object.keys(e);if(0===t.length)return!1;const n=t[0].split("/");return!isNaN(parseInt(n[n.length-1],10))})(e);r&&this.parseWeights(e);for(const e of this.layers)for(const[t,i]of e.weights.entries()){const e=r?`${i.name.split("/").slice(0,-1).join("/")+"/"}${t}`:i.originalName;if(null!=n[e])throw new zA(`Duplicate weight name: ${e}`);n[e]=i,s++}const i=[];for(const s in e){let r=s;if(null==n[s]){const e=s.split("/");r=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[r])i.push([n[r],e[s]]);else if(t)throw new zA(`Provided weight data has no target variable: ${s}`);delete n[r]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new zA(`${e.length} of ${s} weights are not set: ${e}`)}kC(i)}parseWeights(e){for(const t in Object.keys(e)){const n=t.split("/"),s=["vars","layer_checkpoint_dependencies"],r=n.map((e=>e.startsWith("_")?e.slice(1):e)).filter((e=>!s.includes(e))).join("/");r!==t&&(e[r]=e[t],delete e[t])}}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${Pk}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=Lk(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return oh((()=>{e=jA(e);const n=new DC;for(let t=0;t{let n;return e=jA(e),n=null==t?WA(null,e.length):jA(t),this.runInternalGraph(e,n)[1]}))}computeOutputShape(e){const t=yC(e);if(t.length!==this.inputLayers.length)throw new zA(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10))).sort(QA);if(s.length>1)for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map((e=>e.id)).indexOf(t.id))continue;const s=[];for(let t=0;tparseInt(e,10))).sort(QA);for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,s=e.inputTensors,r=e.outputTensors,i=new Array;for(const e of s)e.id in n&&i.push(n[e.id]);if(i.length===s.length){let s,a,o,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===i.length){const[e,n]=i[0];null==u.mask&&(u.mask=n),o=jA(t.call(e,u)),l=jA(t.computeMask(e,n)),s=[e],a=[n]}else s=i.map((e=>e[0])),a=i.map((e=>e[1])),null==u.mask&&(u.mask=a),o=jA(t.call(s,u)),l=jA(t.computeMask(s,a));if(t.activityRegularizer)throw new LA("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e{const e=[];for(const t of this.layers)for(let n=0;n0){const e=[];for(let n=0;n0&&e.apply(qA(n),s)}function l(e){const n=e.name,i=ok(e,null!=t.customObjects?t.customObjects:{});i.setFastWeightInitDuringBuild(s),r[n]=i;e.inboundNodes.forEach((e=>{if(!(e instanceof Array))throw new zA(`Corrupted configuration, expected array for nodeData: ${e}`);a(i,e)}))}const u=t.name,c=t.layers;for(const e of c)l(e);for(;!ex(i);)for(const e of c){const t=r[e.name];if(t.name in i){const e=i[t.name];delete i[t.name];for(const n of e)o(t,n)}}const h=[],d=[],p=t.inputLayers;for(const e of p){const t=e[0],n=e[1],s=e[2];GA(t in r);const i=r[t].inboundNodes[n].outputTensors;h.push(i[s])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],s=e[2];GA(t in r);const i=r[t].inboundNodes[n].outputTensors;d.push(i[s])}return new e({inputs:h,outputs:d,name:u})}get stateful(){if(this._stateful)throw new zA("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){oh((()=>{this.layers.forEach((e=>{e.stateful&&e.resetStates()}))}))}}function Wk(e,t,n){const s=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>null));if(1===s)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==s)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${s} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const n=[];return t.forEach((t=>{t in e?n.push(e[t]):n.push(null)})),n}throw new Error(`The model has multiple (${s}) outputs, so ${n} must be either an array with ${s} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function Gk(e,t){return Wk(e,t,"classWeight")}async function Uk(e,t,n,s){if(null!=t||null!=s)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=oh((()=>{if(1===e.shape.length)return gd(e);if(2===e.shape.length){if(e.shape[1]>1){return Hp(e,1)}if(1===e.shape[1])return mf(e,[e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)})),s=Array.from(await t.data());lh(t);const r=[];return s.forEach((e=>{if(null==n[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);r.push(n[e])})),vy(r,"float32")}return null}function qk(e,t){return Ad(e,t)}function jk(e,t){let n,s;const r=t;n=r.xs,s=r.ys,Ni(null!=n&&null!=s,(()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`));const i=Hk("input",e.inputNames,n),a=Hk("output",e.outputNames,s),o=i[0].shape[0];Ni(i.length===e.inputs.length,(()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${i.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`)),Ni(a.length===e.outputs.length,(()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${a.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`));for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${i[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${a[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));return{xs:i,ys:a}}function Hk(e,t,n){if(n instanceof vc)return[n];if(Array.isArray(n))return Ni(n.length===t.length,(()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`)),n;{const s=[];for(const r of t){if(null==n[r])throw new zA(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);s.push(n[r])}return s}}async function $k(e,t,n){const s=null!=n.batchesPerEpoch;if(Ni(null!=e.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),Ni(null!=n,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),Ni(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),(()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`)),Ni(!s||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),(()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`)),Ni(null==n.validationSplit,(()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead.")),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{const r=null!=n.validationData;let i,a;if(r)if(Kk(n.validationData))Ni(null==n.validationBatches||n.validationBatches>0&&Number.isInteger(n.validationBatches),(()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`));else{const e=function(e){if(3===e.length)throw new LA("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);i=e.xs,a=e.ys}const o=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=r?l.slice().concat(l.map((e=>"val_"+e))):l.slice();const c=rk(n.callbacks,n.yieldEvery),h=null==n.verbose?1:n.verbose,{callbackList:d,history:p}=ak(c,h,n.epochs,null,null,function(e,t){let n=null;null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size);return n}(t,n),null,r,u);d.setModel(e),e.history=p,await d.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,m=await t.iterator();for(;f=n.batchesPerEpoch:t.done){if(r){let t;t=Kk(n.validationData)?jA(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):jA(e.evaluate(i,a,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;n0&&Number.isInteger(e),(()=>`batchSize is required to be a positive integer, but got ${e}`))}function Zk(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((e=>Mx(e,t,n-t))):Mx(e,t,n-t)}function Yk(e,t){return oh((()=>null==e?null:Array.isArray(e)?e.map((e=>Yk(e,t))):Gx(e,"int32"===t.dtype?t:md(t,"int32"))))}function Qk(e,t){const n=[];let s=0,r=null;for(;s=e&&(r=e),n.push([s,r]),s=r;return n}function Jk(e){const t=[];e instanceof vc&&(e=[e]);for(let n=0;nn.push(e.id)));else if(null!=t)for(const e in t){const s=t[e];n.push(s.id)}const s=[];if(e instanceof vc)-1===n.indexOf(e.id)&&s.push(e);else if(Array.isArray(e))e.forEach((e=>{-1===n.indexOf(e.id)&&s.push(e)}));else if(null!=e)for(const t in e){const r=e[t];-1===n.indexOf(r.id)&&s.push(r)}s.forEach((e=>{e.isDisposed||e.dispose()}))}function tS(e){return Array.isArray(e)}function nS(e){return!function(e){return e instanceof vc}(e)&&!tS(e)}function sS(e,t,n,s=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(tS(e)&&e.length>0)t=!0;else if(nS(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new zA(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map((e=>null));let i;if(nS(e)){i=[];for(const n of t){if(null==e[n])throw new zA(`No data provided for "${n}". Need data for each key in: ${t}`);i.push(e[n])}}else if(tS(e)){if(e.length!==t.length)throw new zA(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);i=e}else{if(t.length>1)throw new zA(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);i=[e]}if(i=Jk(i),null!=n)for(let e=0;e=0&&i!==o)throw new zA(`${r} expected a batch of elements where each example has shape [${n[e].slice(1,n[e].length)}] (i.e.,tensor shape [*,${n[e].slice(1,n[e].length)}]) but the ${r} received an input with ${a.shape[0]} examples, each with shape [${a.shape.slice(1,a.shape.length)}] (tensor shape [${a.shape}])`)}}return i}function rS(e,t,n,s=!0,r=""){let i;if(Array.isArray(e)){if(e.length!==t.length)throw new zA(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);i=e}else{if(t.length>1)throw new zA(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);i=[e]}if(null!=n)for(let e=0;elw.adagrad(.01),Adadelta:()=>lw.adadelta(1,.95,Ox()),Adam:()=>lw.adam(.001,.9,.999,Ox()),Adamax:()=>lw.adamax(.002,.9,.999,Ox(),0),RMSProp:()=>lw.rmsprop(.001,.9,0,Ox()),SGD:()=>lw.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new zA(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof Rd))throw new zA("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new zA(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);const n=e.loss;t=n.map((e=>wk(e)))}else{const n=wk(e.loss);this.outputs.forEach((e=>{t.push(n)}))}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new zA(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)e.loss[n],t.push(wk(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e{for(let e=0;e1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}}));const s=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>[]));let n;if("string"==typeof e||"function"==typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);n=e}if(Array.isArray(n))return t.map((e=>n));{const e=[];for(const s of t){let t=n.hasOwnProperty(s)?n[s]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),r=(e,t,n)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([n,e])};Ax("metric",(()=>{for(let e=0;e{let n,s,i;for(const a of t){if("string"==typeof a&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(a)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===mk?-1!==["accuracy","acc"].indexOf(a)?s=vk:-1!==["crossentropy","ce"].indexOf(a)&&(s=Ck):this.lossFunctions[e]===fk?-1!==["accuracy","acc"].indexOf(a)?s=kk:-1!==["crossentropy","ce"].indexOf(a)&&(s=_k):-1!==["accuracy","acc"].indexOf(a)?s=Ak:-1!==["crossentropy","ce"].indexOf(a)&&(s=Sk),-1!==["accuracy","acc"].indexOf(a)?r="acc":-1!==["crossentropy","ce"].indexOf(a)&&(r="ce"),i=s,n=""+r}else{const e=Ik(a);i=e,n=""+Tk(a)}let t;Ax(n,(()=>{t=i})),r(e,n,t)}})(s[e])}})),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&(this.trainableWeights.length,this.collectedTrainableWeights.length)}evaluate(e,t,n={}){const s=null==n.batchSize?32:n.batchSize;Xk(s);const r=this.standardizeUserDataXY(e,t,!0,s);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return qA(this.testLoop(t,e,s,n.verbose,n.steps))}finally{eS(r[0],e),eS(r[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const s=null!=(n=n||{}).batches,r=e.testFunction;let i=[];if(n.verbose>0)throw new LA("Verbose mode is not implemented yet.");Ni(!s||n.batches>0&&Number.isInteger(n.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`));const a="function"==typeof t.next?t:await t.iterator();let o=0,l=0;for(;!s||l{if(t.value){const{xs:n,ys:s}=jk(e,t.value),a=n.concat(s),u=oh((()=>r(a)));if(lh(a),0===l)for(let e=0;ebd(i[e],Ad(c,t)))),l>0&&lh(n)}lh(u),o+=c,++l}return i})),t.done)break}for(let e=0;ee.name));for(let s=0;s0){const n=[];throw t.forEach(((t,s)=>{null==t&&n.push(e[s])})),new zA(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return oh((()=>{const s=this.checkNumSamples(e);if(n)throw new LA("Verbose predictLoop() is not implemented yet.");const r=Qk(s,t),i=this.outputs.map((e=>[]));for(let t=0;t{const n=r[t][0],s=r[t][1],i=Zk(e,n,s),a=[];if(Array.isArray(i))for(let e=0;ei[t].push(e)))}return qA(i.map((e=>bf(e,0))))}))}predict(e,t={}){const n=Jk(e);rS(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return Xk(e),this.predictLoop(n,e)}finally{eS(n,e)}}predictOnBatch(e){rS(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,s){if(null==this.optimizer_)throw new BA("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let e=0;ee.shape[0])));s.sort();const r=JA(t.map((e=>e.shape[0])));if(r.sort(),s.length>1)throw new zA(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map((e=>e.shape)))}`);if(r.length>1)throw new zA(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map((e=>e.shape)))}`);if(s.length>0&&r.length>0&&!Mi(s,r))throw new zA(`Input Tensors should have the same number of samples as target Tensors. Found ${s[0]} input sample(s) and ${r[0]} target sample(s).`)}(e=sS(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=sS(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const s=[uk,mk,pk];for(let r=0;r0&&e[0].shape[0]%s!=0)throw new zA(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${s}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,s,r=!0,i){const[a,o]=this.standardizeUserDataXY(e,t,r,i);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const e=Gk(s,this.outputNames);l=[];for(let t=0;t{const i=this.checkNumSamples(t,n,r,"steps"),a=[];if(s>0)throw new LA("Verbose mode is not implemented yet.");if(null!=r)throw new LA("steps mode in testLoop() is not implemented yet");{const s=Qk(i,n),r=vy(Tx(0,i));for(let n=0;n1){r+=`_${UA(e.slice(0,n),s)}`}t.push(r)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),s=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),i=[],a=this.collectedTrainableWeights.map((e=>e.read()));return[this.optimizer_.minimize((()=>{const e=[];for(let t=0;t1&&e{l=bd(l,e)})),l}),!0,a)].concat(i)}}makeTestFunction(){this.testFunction=e=>oh((()=>{const t=[];let n;const s=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),i=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new LA("validationData including sample weights is not supported yet."):new zA(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);o=n.validationData[0],l=n.validationData[1];const e=!0,t=await this.standardizeUserData(o,l,null,null,e,d);u=t[0],c=t[1],m=u.concat(c)}else if(null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1){g=!0;const e=Math.floor(s[0].shape[0]*(1-n.validationSplit)),t=s[0].shape[0];u=Zk(s,e,t),i=s,s=Zk(s,0,e),c=Zk(r,e,t),a=r,r=Zk(r,0,e),m=u.concat(c)}else null!=n.validationSteps&&(g=!0);const y=s.concat(r).concat(h);this.checkTrainableWeightsConsistency();const b=this.makeTrainFunction(),w=this.getDedupedMetricsNames();let v,A;g?(this.makeTestFunction(),v=this.testFunction,A=w.slice().concat(w.map((e=>"val_"+e)))):(v=null,m=[],A=w.slice());const x=rk(n.callbacks,n.yieldEvery);return await this.fitLoop(b,y,w,d,n.epochs,n.verbose,x,v,m,n.shuffle,A,n.initialEpoch,null,null)}finally{this.isTraining=!1,eS(s,e),eS(r,t),eS(i,e),eS(a,t),eS(u,o),eS(c,l),null!=h&&lh(h)}}async fitLoop(e,t,n,s,r,i,a,o,l,u,c,h,d,p){null==s&&(s=32),null==r&&(r=1),null==u&&(u=!0),null==h&&(h=0);let f=!1;if(null!=o&&null!=l&&(f=!0),null!=p&&(f=!0,null==d))throw new zA("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const m=this.checkNumSamples(t,s,d,"steps_per_epoch");let g;null!=m&&(g=Tx(0,m)),null==i&&(i=1);const{callbackList:y,history:b}=ak(a,i,r,h,m,d,s,f,c);y.setModel(this),this.history=b,await y.onTrainBegin(),this.stopTraining_=!1;for(let i=h;i{const h=a[u][0],d=a[u][1],p=Mx(i,h,d-h);c.batch=u,c.size=d-h;const m=Yk(t,p),g=e(m);for(let e=0;eHA(e)))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const s of t){if("string"!=typeof n[s])throw new Error("Serialization of non-string loss is not supported.");e[s]=HA(n[s])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[HA(Tk(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((e=>HA(Tk(e))));{const e={};for(const t in this.metrics)e[t]=HA(Tk(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=ok(zk(e.optimizer_config));let n,s;if("string"==typeof e.loss)n=$A(e.loss);else if(Array.isArray(e.loss))n=e.loss.map((e=>$A(e)));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=$A(e.loss[t])}if(Array.isArray(e.metrics))s=e.metrics.map((e=>$A(e)));else if(null!=e.metrics){s={};for(const t in e.metrics)s[t]=$A(e.metrics[t])}this.compile({loss:n,metrics:s,optimizer:t})}async save(e,t){if("string"==typeof e){const t=Dh(e);if(0===t.length)throw new zA(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new zA(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new zA("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await ph(this.getNamedWeights(t)),s={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${Pk}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){s.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await ph(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=Ch([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;Nk(this.userDefinedMetadata,this.name,e),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){Nk(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}iS.className="Model",Od(iS);class aS extends iS{}aS.className="Functional",Od(aS);class oS extends iS{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:ux("sequential_"),null!=e.layers)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some((e=>e<0)))throw new zA(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof oS||e instanceof iS;let n;if(t){if(n=e,1!==n.outputs.length)throw new zA("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new zA("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new zA("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=function(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if(null!=e.batchShape&&null!=e.shape)throw new zA("Please provide either a `shape` or `batchShape` argument to Input, but not both.");let t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));let n=e.dtype;return null==n&&(n="float32"),new RC({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new zA(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(1!==e.inboundNodes[0].outputTensors.length)throw new zA("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=OC(this.outputs[0])}this.inboundNodes=[],new IC({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:WA(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return null==this.model&&this.build(),this.model.call(e,t)}build(e){if(wC(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new iS({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new BA("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},s=!1){let r,i={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new zA("Legacy serialization format not supported yet.");r=t}else Ni(null!=t.layers,(()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.")),r=t.layers,delete t.layers,i=t;const a=new e(i);if(!(a instanceof oS))throw new LA(`Sequential.fromConfig called on non-Sequential input: ${a}`);for(const e of r){const t=ok(e,void 0,s);s&&t.setFastWeightInitDuringBuild(!0),a.add(t)}return a}set stopTraining(e){if(null==this.model)throw new zA("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new zA("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}}oS.className="Sequential",Od(oS);class lS extends Td{getConfig(){return{}}}class uS extends lS{apply(e,t=1){return function(e,t=1){if(1!==t)throw new LA(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return am(e)}(e,t)}}uS.className="elu",Od(uS);class cS extends lS{apply(e){return Qg(e)}}cS.className="selu",Od(cS);class hS extends lS{apply(e){return Ug(e)}}hS.className="relu",Od(hS);class dS extends lS{apply(e){return oh((()=>lg(6,Ug(e))))}}dS.className="relu6",Od(dS);class pS extends lS{apply(e){return e}}pS.className="linear",Od(pS);class fS extends lS{apply(e){return vf(e)}}fS.className="sigmoid",Od(fS);class mS extends lS{apply(e){return function(e){return oh((()=>{const t=bd(.5,Ad(.2,e));return Mf(t,0,1)}))}(e)}}mS.className="hardSigmoid",Od(mS);class gS extends lS{apply(e){return qm(e)}}gS.className="softplus",Od(gS);class yS extends lS{apply(e){return function(e){return oh((()=>vd(e,bd(Pd(e),1))))}(e)}}yS.className="softsign",Od(yS);class bS extends lS{apply(e){return xf(e)}}bS.className="tanh",Od(bS);class wS extends lS{apply(e,t=-1){return ly(e,t)}}wS.className="softmax",Od(wS);class vS extends lS{apply(e,t=-1){return Hm(e,t)}}vS.className="logSoftmax",Od(vS);class AS extends lS{apply(e){return oh((()=>oh((()=>{const t=Math.sqrt(2),n=Ad(.5,bd(1,lm(vd(e,t))));return Ad(e,n)}))))}}AS.className="gelu",Od(AS);class xS extends lS{apply(e){return oh((()=>Ad(.5,Ad(e,bd(1,xf(Ad(xd(vd(2,Math.PI)),bd(e,Ad(.044715,Bd(e,3))))))))))}}xS.className="gelu_new",Od(xS);class CS extends lS{apply(e){return oh((()=>Ad(e,xf(qm(e)))))}}CS.className="mish",Od(CS);class kS extends lS{apply(e,t=1){return oh((()=>Ad(vf(Ad(e,t)),e)))}}function SS(e){return e.getClassName()}function _S(e,t={}){return YA(e,Nd.getMap().classNameMap,t,"activation")}function ES(e){if(null==e){const e={className:"linear",config:{}};return _S(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},_S(t)}return e instanceof lS?e:_S(e)}function IS(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}kS.className="swish",Od(kS);class TS extends Td{}class NS extends TS{constructor(e){super(),IS(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return oh((()=>{let t=ig([1]);return this.hasL1&&(t=bd(t,wm(Ad(this.l1,Pd(e))))),this.hasL2&&(t=bd(t,wm(Ad(this.l2,Ux(e))))),mf(t,[])}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}NS.className="L1L2",Od(NS);const OS={l1l2:"L1L2"};function RS(e){return XA(e)}function DS(e,t={}){return YA(e,Nd.getMap().classNameMap,t,"regularizer")}function MS(e){if(null==e)return null;if("string"==typeof e){return DS({className:e in OS?OS[e]:e,config:{}})}return e instanceof TS?e:DS(e)}class FS extends NC{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=bC(e);let n=Ug(e);return null!=this.maxValue&&(n=Mf(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}FS.className="ReLU",Od(FS);class BS extends NC{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=bC(e);return Bm(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}BS.className="LeakyReLU",Od(BS);class zS extends NC{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=mC(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=MS(e.alphaRegularizer),this.alphaConstraint=XC(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new zA(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=wC(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let t=1;t{let n=bC(e);const s=t.mask;if(null!=s){const e=Ad(zd(ag(n.shape),md(s,n.dtype)),_d(-1e9));n=bd(n,e)}return this.axis instanceof Array?this.axis.length>1?Cm(zd(n,$m(n,this.axis,!0))):this.softmax(n,this.axis[0]):this.softmax(n,this.axis)}))}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function WS(e,t,n){if("number"==typeof e)return WA(e,t);if(e.length!==t)throw new zA(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let r=0;r(gx(t),"channelsFirst"===t?Py(e,[0,2,3,1]):e)))}function jS(e,t){return oh((()=>(gx(t),"channelsFirst"===t?Py(e,[0,2,3,4,1]):e)))}function HS(e,t,n,s=1,r="valid",i,a=1){return oh((()=>{if(null==i&&(i="channelsLast"),gx(i),3!==e.shape.length)throw new zA(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new zA(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new zA(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===i&&(e=Py(e,[0,2,1])),"causal"===r)throw new LA("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=Vf(e,t,s,"same"===r?"same":"valid","NWC",a);return null!=n&&(o=jx(o,n)),o}))}function $S(e,t,n,s=[1,1],r="valid",i,a,o=null){return oh((()=>{if(null==i&&(i="channelsLast"),gx(i),3!==e.rank&&4!==e.rank)throw new zA(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new zA(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=qS(e,i);if("causal"===r)throw new LA("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=Jy({x:l,filter:t,strides:s,pad:"same"===r?"same":"valid",dilations:a,dataFormat:"NHWC",bias:n,activation:o}),"channelsFirst"===i&&(l=Py(l,[0,3,1,2])),l}))}function KS(e,t,n,s=[1,1,1],r="valid",i,a){return oh((()=>{if(null==i&&(i="channelsLast"),gx(i),4!==e.rank&&5!==e.rank)throw new zA(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new zA(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=jS(e,i);if("causal"===r)throw new LA("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=Uf(o,t,s,"same"===r?"same":"valid","NDHWC",a),null!=n&&(o=jx(o,n)),"channelsFirst"===i&&(o=Py(o,[0,4,1,2,3])),o}))}VS.className="Softmax",Od(VS);class XS extends NC{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",XS.verifyArgs(t),this.rank=e,sx(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new LA(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=WS(t.kernelSize,e,"kernelSize"),this.strides=WS(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,yx(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,gx(this.dataFormat),this.activation=ES(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=mC(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=XC(t.biasConstraint),this.biasRegularizer=MS(t.biasRegularizer),this.activityRegularizer=MS(t.activityRegularizer),this.dilationRate=WS(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new zA(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new zA(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new zA(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(GA("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!nx(e.kernelSize,"number",1,3))throw new zA(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:SS(this.activation),useBias:this.useBias,biasInitializer:fC(this.biasInitializer),biasRegularizer:RS(this.biasRegularizer),activityRegularizer:RS(this.activityRegularizer),biasConstraint:$C(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class ZS extends XS{constructor(e,t){super(e,t),this.kernel=null,ZS.verifyArgs(t),this.filters=t.filters,sx(this.filters,"filters"),this.kernelInitializer=mC(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=XC(t.kernelConstraint),this.kernelRegularizer=MS(t.kernelRegularizer)}build(e){e=wC(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new zA(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],s=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return oh((()=>{let t;e=bC(e);const n=null==this.bias?null:this.bias.read(),s=ix(this.activation.getClassName());if(null!=s&&2===this.rank)t=$S(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,s);else{if(1===this.rank)t=HS(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=$S(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new LA("convolutions greater than 3D are not implemented yet.");t=KS(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t}))}computeOutputShape(e){e=wC(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e 0 but got ${JSON.stringify(e.filters)}`)}}class YS extends ZS{constructor(e){super(2,e),YS.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!nx(e.kernelSize,"number",1,2))throw new zA(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}YS.className="Conv2D",Od(YS);class QS extends ZS{constructor(e){super(3,e),QS.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new zA(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}QS.className="Conv3D",Od(QS);class JS extends YS{constructor(e){if(super(e),this.inputSpec=[new SC({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new zA(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=wC(e)).length)throw new zA("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new zA("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new SC({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return oh((()=>{let t=bC(e);if(4!==t.shape.length)throw new zA(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,i;"channelsFirst"===this.dataFormat?(r=2,i=3):(r=1,i=2);const a=n[r],o=n[i],l=this.kernelSize[0],u=this.kernelSize[1],c=this.strides[0],h=this.strides[1],d=[s,US(a,c,l,this.padding),US(o,h,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Py(t,[0,2,3,1]));let p=Gf(t,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=Py(p,[0,3,1,2])),null!=this.bias&&(p=jx(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p}))}computeOutputShape(e){const t=(e=wC(e)).slice();let n,s,r;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3):(n=3,s=1,r=2);const i=this.kernelSize[0],a=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[s]=US(t[s],o,i,this.padding),t[r]=US(t[r],l,a,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}JS.className="Conv2DTranspose",Od(JS);class e_ extends QS{constructor(e){if(super(e),this.inputSpec=[new SC({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new zA(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=wC(e)).length)throw new zA("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new zA("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new SC({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return oh((()=>{let t=bC(e);if(5!==t.shape.length)throw new zA(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,i,a;"channelsFirst"===this.dataFormat?(a=2,r=3,i=4):(a=1,r=2,i=3);const o=n[a],l=n[r],u=n[i],c=this.kernelSize[0],h=this.kernelSize[1],d=this.kernelSize[2],p=this.strides[0],f=this.strides[1],m=this.strides[2],g=[s,US(o,p,c,this.padding),US(l,f,h,this.padding),US(u,m,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Py(t,[0,2,3,4,1]));let y=jf(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=Py(y,[0,4,1,2,3])),null!==this.bias&&(y=jx(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(e){const t=(e=wC(e)).slice();let n,s,r,i;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3,i=4):(n=4,s=1,r=2,i=3);const a=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],c=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[s]=US(t[s],u,a,this.padding),t[r]=US(t[r],c,o,this.padding),t[i]=US(t[i],h,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}e_.className="Conv3DTranspose",Od(e_);class t_ extends ZS{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new zA("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new zA("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new zA(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=mC(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=MS(t.depthwiseRegularizer),this.depthwiseConstraint=XC(t.depthwiseConstraint),this.pointwiseInitializer=mC(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=MS(t.pointwiseRegularizer),this.pointwiseConstraint=XC(t.pointwiseConstraint)}build(e){if((e=wC(e)).length{let t;if(e=bC(e),1===this.rank)throw new LA("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=Py(e,[0,2,3,1])),t=Jg(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=jx(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=Py(t,[0,3,1,2])),t}))}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=fC(this.depthwiseInitializer),e.pointwiseInitializer=fC(this.pointwiseInitializer),e.depthwiseRegularizer=RS(this.depthwiseRegularizer),e.pointwiseRegularizer=RS(this.pointwiseRegularizer),e.depthwiseConstraint=$C(this.depthwiseConstraint),e.pointwiseConstraint=$C(this.pointwiseConstraint),e}}t_.className="SeparableConv";class n_ extends t_{constructor(e){super(2,e)}}n_.className="SeparableConv2D",Od(n_);class s_ extends ZS{constructor(e){super(1,e),s_.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!nx(e.kernelSize,"number",1,1))throw new zA(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}s_.className="Conv1D",Od(s_);class r_ extends NC{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return oh((()=>{if(e=bC(e),"channelsLast"===this.dataFormat){const t=Bx(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Bx(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=Bx(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Bx(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}}))}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}r_.className="Cropping2D",Od(r_);class i_ extends NC{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,tx(hx,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}{const t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return oh((()=>{let t=bC(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=Py(t,[0,2,3,1]);const e=this.size[0]*n[2],s=this.size[1]*n[3],r="nearest"===this.interpolation?sw.resizeNearestNeighbor(t,[e,s]):sw.resizeBilinear(t,[e,s]);return Py(r,[0,3,1,2])}{const e=this.size[0]*n[1],s=this.size[1]*n[2];return"nearest"===this.interpolation?sw.resizeNearestNeighbor(t,[e,s]):sw.resizeBilinear(t,[e,s])}}))}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}}i_.className="UpSampling2D",Od(i_);class a_ extends XS{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=mC(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=XC(e.depthwiseConstraint),this.depthwiseRegularizer=MS(e.depthwiseRegularizer)}build(e){if((e=wC(e)).length<4)throw new zA(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new zA(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],s=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",s,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return oh((()=>{let t=function(e,t,n=[1,1],s="valid",r,i){return oh((()=>{null==r&&(r="channelsLast"),gx(r);let a=qS(e,r);if(4!==e.rank)throw new zA(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new zA(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return a=Qf(a,t,n,"same"===s?"same":"valid","NHWC",i),"channelsFirst"===r&&(a=Py(a,[0,3,1,2])),a}))}(e=bC(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=jx(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t}))}computeOutputShape(e){e=wC(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=GS(t,this.kernelSize[0],this.padding,this.strides[0]),i=GS(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],s,r,i]:[e[0],r,i,s]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=fC(this.depthwiseInitializer),e.depthwiseRegularizer=RS(this.depthwiseRegularizer),e.depthwiseConstraint=$C(this.depthwiseRegularizer),e}}function o_(e,t,n,s){if(Array.isArray(e)){if(null!=t||null!=n)throw new zA("When inputs is an array, neither initialState or constants should be provided");null!=s&&(n=e.slice(e.length-s,e.length),e=e.slice(0,e.length-s)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=r(t),constants:n=r(n)}}function l_(e,t,n,s=!1,r,i,a=!1,o=!1){return oh((()=>{const a=t.shape.length;if(a<3)throw new zA(`Input should be at least 3D, but is ${a}D.`);const l=[1,0].concat(Tx(2,a));if(t=Py(t,l),null!=i)throw new LA("The rnn() functoin of the deeplearn.js backend does not support constants yet.");null!=r&&((r=md(md(r,"bool"),"float32")).rank===a-1&&(r=km(r,-1)),r=Py(r,l)),s&&(t=jg(t,0),null!=r&&(r=jg(r,0)));const u=[];let c,h=n;const d=t.shape[0],p=Dy(t);let f,m;null!=r&&(f=Dy(r));for(let t=0;te(n,h)));if(null==r)c=s[0],h=s[1];else{const e=oh((()=>{const e=f[t],n=zd(gg(e),e);return{output:bd(Ad(s[0],e),Ad(h[0],n)),newStates:h.map(((t,r)=>bd(Ad(s[1][r],e),Ad(t,n))))}}));c=e.output,h=e.newStates}o&&u.push(c)}if(o){m=gy(u,1)}return[c,m,h]}))}a_.className="DepthwiseConv2D",Od(a_);class u_ extends NC{constructor(e){let t;if(super(e),null==e.cell)throw new zA("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new y_({cells:e.cell}):e.cell,null==t.stateSize)throw new zA("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new SC({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return Tx(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((e=>null))}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){gC(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let s;if(s=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const s of t)n.push([e[0],s]);return[s].concat(n)}return s}computeMask(e,t){return oh((()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map((e=>null));return[e].concat(t)}return e}))}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ne.shape[e.shape.length-1])),r))throw new zA(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map((e=>new SC({shape:[null,e]})));this.stateful&&this.resetStates()}resetStates(e,t=!1){oh((()=>{if(!this.stateful)throw new FA("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new zA("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>ig([n,e]))):this.states_=[ig([n,this.cell.stateSize])];else if(null==e)lh(this.states_),null!=this.keptStates&&(lh(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>ig([n,e]))):this.states_[0]=ig([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new zA(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):lh(this.states_);for(let t=0;tuh(e.clone())))}))}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=o_(e,n,s,this.numConstants);e=r.inputs,n=r.initialState,s=r.constants;let i=[],a=[];if(null!=n){t.initialState=n,i=i.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new SC({shape:e.shape}));a=a.concat(this.stateSpec)}null!=s&&(t.constants=s,i=i.concat(s),this.numConstants=s.length);if(i[0]instanceof _C){const n=[e].concat(i),s=this.inputSpec.concat(a),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return oh((()=>{const n=null==t?null:t.mask,s=null==t?null:t.training;let r=null==t?null:t.initialState;e=bC(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const i=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==i)throw new zA(`RNN Layer has ${i} state(s) but was passed ${r.length} initial state(s).`);this.unroll;const a={training:s},o=l_(((e,t)=>{const n=this.cell.call([e].concat(t),a);return[n[0],n.slice(1)]}),e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],u=o[1],c=o[2];this.stateful&&this.resetStates(c,s);const h=this.returnSequences?u:l;return this.returnState?[h].concat(c):h}))}getInitialState(e){return oh((()=>{let t=ig(e.shape);return t=wm(t,[1,2]),t=Dx(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((e=>e>1?Px(t,[1,e]):t)):this.cell.stateSize>1?[Px(t,[1,this.cell.stateSize])]:[t]}))}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===u_.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign(Object.assign(Object.assign({},n),e),t)}static fromConfig(e,t,n={}){const s=ok(t.cell,n);return new e(Object.assign(t,{cell:s}))}}u_.className="RNN",Od(u_);class c_ extends NC{}class h_ extends c_{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,sx(this.units,"units"),this.activation=ES(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=mC(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=MS(e.kernelRegularizer),this.recurrentRegularizer=MS(e.recurrentRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.kernelConstraint=XC(e.kernelConstraint),this.recurrentConstraint=XC(e.recurrentConstraint),this.biasConstraint=XC(e.biasConstraint),this.dropout=Ex([1,Ix([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ex([1,Ix([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=wC(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return oh((()=>{if(2!==e.length)throw new zA(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const s=null!=t.training&&t.training;let r;0gg(e),rate:this.dropout,training:s,dropoutFunc:this.dropoutFunc})),0gg(n),rate:this.recurrentDropout,training:s,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;r=Wx(null!=i?Ad(e,i):e,this.kernel.read()),null!=this.bias&&(r=jx(r,this.bias.read())),null!=a&&(n=Ad(n,a));let o=bd(r,Wx(n,this.recurrentKernel.read()));return null!=this.activation&&(o=this.activation.apply(o)),[o,o]}))}getConfig(){const e=super.getConfig(),t={units:this.units,activation:SS(this.activation),useBias:this.useBias,kernelInitializer:fC(this.kernelInitializer),recurrentInitializer:fC(this.recurrentInitializer),biasInitializer:fC(this.biasInitializer),kernelRegularizer:RS(this.kernelRegularizer),recurrentRegularizer:RS(this.recurrentRegularizer),biasRegularizer:RS(this.biasRegularizer),activityRegularizer:RS(this.activityRegularizer),kernelConstraint:$C(this.kernelConstraint),recurrentConstraint:$C(this.recurrentConstraint),biasConstraint:$C(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}h_.className="SimpleRNNCell",Od(h_);class d_ extends u_{constructor(e){e.cell=new h_(e),super(e)}call(e,t){return oh((()=>{null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return new e(t)}}d_.className="SimpleRNN",Od(d_);class p_ extends c_{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new zA("GRUCell does not support reset_after parameter set to true.");this.units=e.units,sx(this.units,"units"),this.activation=ES(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ES(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=mC(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=MS(e.kernelRegularizer),this.recurrentRegularizer=MS(e.recurrentRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.kernelConstraint=XC(e.kernelConstraint),this.recurrentConstraint=XC(e.recurrentConstraint),this.biasConstraint=XC(e.biasConstraint),this.dropout=Ex([1,Ix([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ex([1,Ix([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=wC(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return oh((()=>{if(2!==e.length)throw new zA(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let s=e[1];e=e[0],0gg(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0gg(s),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,i=this.recurrentDropoutMask;let a,o,l;0{null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}f_.className="GRU",Od(f_);class m_ extends c_{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,sx(this.units,"units"),this.activation=ES(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ES(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=mC(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=MS(e.kernelRegularizer),this.recurrentRegularizer=MS(e.recurrentRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.kernelConstraint=XC(e.kernelConstraint),this.recurrentConstraint=XC(e.recurrentConstraint),this.biasConstraint=XC(e.biasConstraint),this.dropout=Ex([1,Ix([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ex([1,Ix([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const n=(e=wC(e))[e.length-1];let s;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,n=this.units;s=new((t=class extends Zx{apply(t,s){const r=e.apply([n]),i=(new Qx).apply([n]),a=e.apply([2*n]);return Lx(Lx(r,i),a)}}).className="CustomInit",t)}else s=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,s,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return oh((()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new zA(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let s=e[1];const r=e[2];e=e[0],0gg(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0gg(s),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;let o,l,u,c;0{null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}g_.className="LSTM",Od(g_);class y_ extends c_{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return oh((()=>{let n=e.slice(1);const s=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?s.push(n.splice(0,e.stateSize.length)):s.push(n.splice(0,1));s.reverse();const r=[];let i;for(let a=0;a{Ax(`RNNCell_${s}`,(()=>{n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]}))})),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map((e=>({className:e.getClassName(),config:e.getConfig()})))};return Object.assign(Object.assign({},e),t)}static fromConfig(e,t,n={}){const s=[];for(const e of t.cells)s.push(ok(e,n));return new e({cells:s})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return CC(e)}setWeights(e){const t=[];for(const n of this.cells){const s=n.weights.length,r=e.splice(s);for(let e=0;enull!=i?i(t(),n):Hx(t(),n),o=()=>$x(a,t,s);if(!r||r<=1)return uh(o().clone());return Array(r).fill(void 0).map(o).map((e=>uh(e.clone())))}y_.className="StackedRNNCells",Od(y_);var w_=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r{if(null!=this.cell.dropoutMask&&(lh(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(lh(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new zA("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return oh((()=>{const{stateSize:t}=this.cell,n=e.shape,s=this.computeSingleOutputShape(n),r=ig([s[0],...s.slice(2)]);return Array.isArray(t)?Array(t.length).fill(r):[r]}))}resetStates(e,t=!1){oh((()=>{if(!this.stateful)throw new FA("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,s=this.computeSingleOutputShape(n),r=[s[0],...s.slice(2)];if(null==n[0])throw new zA("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>ig(r))):this.states_=[ig(r)];else if(null==e)lh(this.states_),null!=this.keptStates&&(lh(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>ig(r))):this.states_[0]=ig(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new zA(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):lh(this.states_);for(let t=0;tuh(e.clone())))}))}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:s,padding:r,strides:i,dilationRate:a}=this.cell,o="channelsFirst"===t,l=e[o?3:2],u=e[o?4:3],c=GS(l,s[0],r,i[0],a[0]),h=GS(u,s[1],r,i[1],a[1]);return[...e.slice(0,2),...o?[n,c,h]:[c,h,n]]}}v_.className="ConvRNN2D";class A_ extends m_{constructor(e){const{filters:t,kernelSize:n,strides:s,padding:r,dataFormat:i,dilationRate:a}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,sx(this.filters,"filters"),this.kernelSize=WS(n,2,"kernelSize"),this.kernelSize.forEach((e=>sx(e,"kernelSize"))),this.strides=WS(s||1,2,"strides"),this.strides.forEach((e=>sx(e,"strides"))),this.padding=r||"valid",yx(this.padding),this.dataFormat=i||"channelsLast",gx(this.dataFormat),this.dilationRate=WS(a||1,2,"dilationRate"),this.dilationRate.forEach((e=>sx(e,"dilationRate")))}build(e){var t;e=wC(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new zA(`The channel dimension of the input should be defined. Found ${e[n]}`);const s=e[n],r=this.kernelSize.concat([s,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const i=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,s=this.filters;e=new((t=class extends Zx{apply(e,t){return zx([n.apply([s]),ag([s]),n.apply([2*s])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return oh((()=>{if(3!==e.length)throw new zA(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,s=e[0],r=e[1],i=e[2];0gg(s),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,o=(e,t,n)=>t&&t[n]?Ad(t[n],e):e;let l=o(s,a,0),u=o(s,a,1),c=o(s,a,2),h=o(s,a,3);0gg(r),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const d=this.recurrentDropoutMask;let p=o(r,d,0),f=o(r,d,1),m=o(r,d,2),g=o(r,d,3);const[y,b,w,v]=dy(this.kernel.read(),4,3),[A,x,C,k]=this.useBias?dy(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,A,this.padding),u=this.inputConv(u,b,x,this.padding),c=this.inputConv(c,w,C,this.padding),h=this.inputConv(h,v,k,this.padding);const[S,_,E,I]=dy(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,S),f=this.recurrentConv(f,_),m=this.recurrentConv(m,E),g=this.recurrentConv(g,I);const T=this.recurrentActivation.apply(bd(l,p)),N=this.recurrentActivation.apply(bd(u,f)),O=bd(Ad(N,i),Ad(T,this.activation.apply(bd(c,m)))),R=Ad(this.recurrentActivation.apply(bd(h,g)),this.activation.apply(O));return[R,R,O]}))}getConfig(){const e=super.getConfig(),{units:t}=e,n=w_(e,["units"]),s={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},n),s)}inputConv(e,t,n,s){const r=Pf(e,t,this.strides,s||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?jx(r,n,this.dataFormat):r}recurrentConv(e,t){return Pf(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}A_.className="ConvLSTM2DCell",Od(A_);class x_ extends v_{constructor(e){const t=new A_(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}x_.className="ConvLSTM2D",Od(x_);class C_ extends NC{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(null==this.noiseShape)return this.noiseShape;const t=e.shape,n=[];for(let e=0;e{this.invokeCallHook(e,t);const n=bC(e);if(0Hx(n,this.rate,s,this.seed)),(()=>n),e)}return e}))}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}C_.className="Dropout",Od(C_);class k_ extends C_{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}k_.className="SpatialDropout1D",Od(k_);class S_ extends NC{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,sx(this.units,"units"),this.activation=ES(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=mC(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=mC(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=XC(e.kernelConstraint),this.biasConstraint=XC(e.biasConstraint),this.kernelRegularizer=MS(e.kernelRegularizer),this.biasRegularizer=MS(e.biasRegularizer),this.activityRegularizer=MS(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=wC(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){const t=(e=wC(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e),s=ix(this.activation.getClassName());let r;return null!=s?r=Wx(n,this.kernel.read(),s,this.bias?this.bias.read():null):(r=Wx(n,this.kernel.read()),null!=this.bias&&(r=jx(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r}))}getConfig(){const e={units:this.units,activation:SS(this.activation),useBias:this.useBias,kernelInitializer:fC(this.kernelInitializer),biasInitializer:fC(this.biasInitializer),kernelRegularizer:RS(this.kernelRegularizer),biasRegularizer:RS(this.biasRegularizer),activityRegularizer:RS(this.activityRegularizer),kernelConstraint:$C(this.kernelConstraint),biasConstraint:$C(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}S_.className="Dense",Od(S_);class __ extends NC{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=wC(e);for(const t of e.slice(1))if(null==t)throw new zA(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],_x(e,1)]}call(e,t){return oh((()=>{this.invokeCallHook(e,t);let n=bC(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=bC(e);return this.activation.apply(n)}))}getConfig(){const e={activation:SS(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}E_.className="Activation",Od(E_);class I_ extends NC{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return oh((()=>{return e=bC(e),t=e,n=this.n,oh((()=>{if(2!==t.shape.length)throw new zA(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return Px(Dx(t,1),[1,n,1])}));var t,n}))}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}I_.className="RepeatVector",Od(I_);class T_ extends NC{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=bC(e),s=n.shape,r=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return mf(n,r)}))}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}T_.className="Reshape",Od(T_);class N_ extends NC{constructor(e){if(super(e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const t=Tx(1,e.dims.length+1);if(!Mi(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new SC({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=wC(e)).slice();return this.dims.forEach(((n,s)=>{t[s+1]=e[n]})),t}call(e,t){return Py(bC(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}N_.className="Permute",Od(N_);class O_ extends NC{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const n=bC(e);return jp(fg(n,this.maskValue),-1)}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e),s=jp(fg(n,this.maskValue),-1,!0);return Ad(n,md(s,n.dtype))}))}}O_.className="Masking",Od(O_);class R_ extends NC{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(jA(e.inputLength))}this.inputDim=e.inputDim,sx(this.inputDim,"inputDim"),this.outputDim=e.outputDim,sx(this.outputDim,"outputDim"),this.embeddingsInitializer=mC(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=MS(e.embeddingsRegularizer),this.activityRegularizer=MS(e.activityRegularizer),this.embeddingsConstraint=XC(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return oh((()=>this.maskZero?(e=bC(e),fg(e,kd(e))):null))}computeOutputShape(e){if(e=wC(e),null==this.inputLength)return[...e,this.outputDim];const t=jA(this.inputLength);if(t.length!==e.length-1)throw new zA(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let s=0;s{this.invokeCallHook(e,t);let n=bC(e);"int32"!==n.dtype&&(n=Rx(n,"int32"));const s=Gx(this.embeddings.read(),mf(n,[n.size]));return mf(s,wC(this.computeOutputShape(n.shape)))}))}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:fC(this.embeddingsInitializer),embeddingsRegularizer:RS(this.embeddingsRegularizer),activityRegularizer:RS(this.activityRegularizer),embeddingsConstraint:$C(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}R_.className="Embedding",Od(R_);class D_ extends NC{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new LA}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new zA(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=null==e[0]?null:e[0].slice(1);for(let t=1;te.length));-1===e.indexOf(null)&&1===JA(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return oh((()=>{if(this.reshapeRequired){const t=[],n=e.map((e=>e.rank));if(-1===n.indexOf(null)){const s=Ix(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=Tx(1,e).concat([0]);t.push(Py(s,r)),n=!0}else t.push(s)}let s=this.mergeFunction(t);const r=s.rank;if(n)if(null==r){const e=s.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));s=mf(Py(mf(s,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(Tx(0,r-1));s=Py(s,e)}return s}}return this.mergeFunction(e)}))}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n{if(null==t)return null;if(!Array.isArray(t))throw new zA("`mask` should be an Array");if(!Array.isArray(e))throw new zA("`inputs` should be an Array");if(t.length!==e.length)throw new zA(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every((e=>null==e)))return null;let n=(t=t.map((e=>null==e?e:km(e,0))))[0];for(let e=1;e{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new zA("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return oh((()=>zx(e,this.axis)))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new zA("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),s=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[s]||null==e[s]){n[s]=null;break}n[s]+=e[s]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new zA("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new zA("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new zA(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return oh((()=>{let n=!0;if(t.forEach((e=>{null==e||(n=!1)})),n)return null;const s=[];for(let n=0;n"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0],n=e[1];if(t.length>3||n.length>3)throw new LA("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);if(t[s[0]]!==n[s[1]])throw new zA(`Dimension incompatibility: ${t[s[0]]} !== ${n[s[1]]}`)}mergeFunction(e){if(2!==e.length)throw new zA(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],s=e[1];return t=Array.isArray(this.axes)?this.axes.map(((t,n)=>V_(t,e[n].shape.length))):[V_(this.axes,n.shape.length),V_(this.axes,s.shape.length)],this.normalize&&(n=lk(n,t[0]),s=lk(s,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new LA("batchDot is not implemented for tensors of 4D or higher rank yet");if(Ni(e.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`)),Ni(e.shape.length>=2,(()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`)),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new LA("batchDot is not implemented for complex64-type Tensors yet.");const s=e.shape.length,r=t.shape.length;null==n&&(n=[s-1,r-2]);const i=n;return oh((()=>{let n,a;if(s>r){n=s-r;const e=[];for(let t=0;ts){n=r-s;const t=[];for(let e=0;e0){let e;e=s>r?s+r-3:s-1;const t=[];for(let s=e;s"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new LA("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);t.splice(s[0],1),n.splice(s[1],1),n.splice(0,1);const r=t.concat(n);return 1===r.length&&r.push(1),r}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}W_.className="Dot",Od(W_);class G_ extends NC{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e);return $x((()=>bd(Vx(n.shape,0,this.stddev),n)),(()=>n),t.training||!1)}))}}G_.className="GaussianNoise",Od(G_);class U_ extends NC{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return oh((()=>{this.invokeCallHook(e,t);const n=bC(e);if(this.rate>0&&this.rate<1){return $x((()=>{const e=Math.sqrt(this.rate/(1-this.rate));return Ad(n,Vx(n.shape,1,e))}),(()=>n),t.training||!1)}return n}))}}U_.className="GaussianDropout",Od(U_);class q_ extends NC{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||bC(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return oh((()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e),s=()=>{const t=bC(e),s=-1.7580993408473766;let r=Om(Lg(n),this.rate);r=Rx(r,"float32");const i=((1-this.rate)*(1+this.rate*s**2))**-.5,a=-i*s*this.rate,o=bd(Ad(t,r),Ad(bd(r,-1),s));return bd(Ad(o,i),a)};return $x(s,(()=>bC(e)),t.training||!1)}return e}))}}function j_(e,t,n,s,r,i=.001){let a;if(2===e.rank)a=_f(e,t,n,s,r,i);else if(3===e.rank)a=Ef(e,t,n,s,r,i);else{if(4!==e.rank)throw new LA(`batchNormalization is not implemented for array of rank ${e.rank} yet`);a=If(e,t,n,s,r,i)}return a}function H_(e,t,n,s,r=.001){return Mi(s.slice().sort(),Tx(0,e.rank-1))?function(e,t,n,s,r=.001){return oh((()=>{const i=hg(e,s),a=i.mean,o=i.variance;return[j_(e,a,o,n,t,r),a,o]}))}(e,t,n,s,r):function(e,t,n,s,r=.001){return oh((()=>{const i=hg(e,s),a=i.mean,o=i.variance,l=[];for(const t of Tx(0,e.rank))-1!==s.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=mf(a,l),c=mf(o,l),h=null==t?null:mf(t,l),d=null==n?null:mf(n,l);return[j_(e,u,c,d,h,r),a,o]}))}(e,t,n,s,r)}q_.className="AlphaDropout",Od(q_);class $_ extends NC{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=mC(e.betaInitializer||"zeros"),this.gammaInitializer=mC(e.gammaInitializer||"ones"),this.movingMeanInitializer=mC(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=mC(e.movingVarianceInitializer||"ones"),this.betaConstraint=XC(e.betaConstraint),this.gammaConstraint=XC(e.gammaConstraint),this.betaRegularizer=MS(e.betaRegularizer),this.gammaRegularizer=MS(e.gammaRegularizer)}build(e){e=wC(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new zA(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new SC({ndim:e.length,axes:{[t]:n}})];const s=[n];this.scale&&(this.gamma=this.addWeight("gamma",s,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",s,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",s,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",s,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return oh((()=>{const n=null!=t.training&&t.training,s=bC(e),r=s.shape,i=r.length,a=Tx(0,i),o=this.axis>=0?this.axis:this.axis+i;a.splice(o,1);const l=WA(1,i);l[o]=r[o];const u=a.slice();u.sort();const c=!Mi(u,Tx(0,i).slice(0,i-1));if(!n)return(()=>{if(c){const e=mf(this.movingMean.read(),l),t=mf(this.movingVariance.read(),l),n=this.center?mf(this.beta.read(),l):null,r=this.scale?mf(this.gamma.read(),l):null;return j_(s,e,t,n,r,this.epsilon)}return j_(s,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[h,d,p]=H_(s,this.gamma.read(),this.beta.read(),a,this.epsilon),f=(e,t,n)=>{oh((()=>{const s=1-n,r=e.read(),i=Ad(zd(r,t),s);e.write(zd(r,i))}))};return(()=>{f(this.movingMean,d,this.momentum),f(this.movingVariance,p,this.momentum)})(),h}))}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:fC(this.betaInitializer),gammaInitializer:fC(this.gammaInitializer),movingMeanInitializer:fC(this.movingMeanInitializer),movingVarianceInitializer:fC(this.movingVarianceInitializer),betaRegularizer:RS(this.betaRegularizer),gammaRegularizer:RS(this.gammaRegularizer),betaConstraint:$C(this.betaConstraint),gammaConstraint:$C(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}$_.className="BatchNormalization",Od($_);class K_ extends NC{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=mC(e.betaInitializer||"zeros"),this.gammaInitializer=mC(e.gammaInitializer||"ones"),this.betaRegularizer=MS(e.betaRegularizer),this.gammaRegularizer=MS(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=wC(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==JA(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map((t=>e[t])),s=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,s):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,s):this.beta=null,this.built=!0}call(e,t){const n=bC(e),s=n.shape,r=s.length;return oh((()=>{let{mean:e,variance:t}=hg(n,this.axis,!0);const i=WA(1,r);for(const e of this.axis)i[e]=s[e];const a=e=>null!=e&&e.shape.length!==r?mf(e,i):e;let o=this.scale?a(this.gamma.read()):null,l=this.center?a(this.beta.read()):null;const u=[],c=[];for(let e=0;e=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}call(e,t){return oh((()=>{return t=bC(e),n=this.padding,s=this.dataFormat,oh((()=>{if(4!==t.rank)throw new zA(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new zA("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==s&&(s="channelsLast"),"channelsLast"!==s&&"channelsFirst"!==s)throw new zA(`Unknown data format: ${s}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===s?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],bg(t,e)}));var t,n,s}))}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}function Z_(e,t,n,s,r,i){return oh((()=>{let a;gx(r),bx(i),yx(s),null==n&&(n=[1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=qS(e,r);const o="same"===s?"same":"valid";return a="max"===i?tg(e,t,n,o):gf(e,t,n,o),"channelsFirst"===r&&(a=Py(a,[0,3,1,2])),a}))}function Y_(e,t,n,s,r,i){return oh((()=>{let a;gx(r),bx(i),yx(s),null==n&&(n=[1,1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=jS(e,r);const o="same"===s?"same":"valid";return a="max"===i?ng(e,t,n,o):yf(e,t,n,o),"channelsFirst"===r&&(a=Py(a,[0,4,1,2,3])),a}))}X_.className="ZeroPadding2D",Od(X_);class Q_ extends NC{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new zA(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if(sx(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new zA(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}sx(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,yx(this.padding),this.inputSpec=[new SC({ndim:3})]}computeOutputShape(e){const t=GS((e=wC(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return oh((()=>{this.invokeCallHook(e,t),e=Dx(bC(e),2);const n=this.poolingFunction(bC(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return my(n,[2])}))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class J_ extends Q_{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"max")}}J_.className="MaxPooling1D",Od(J_);class eE extends Q_{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"avg")}}eE.className="AveragePooling1D",Od(eE);class tE extends NC{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new zA(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];sx(this.poolSize,"poolSize"),sx(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),yx(this.padding),this.inputSpec=[new SC({ndim:4})]}computeOutputShape(e){e=wC(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=GS(t,this.poolSize[0],this.padding,this.strides[0]),n=GS(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return oh((()=>(this.invokeCallHook(e,t),this.poolingFunction(bC(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class nE extends tE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"max")}}nE.className="MaxPooling2D",Od(nE);class sE extends tE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Z_(e,t,n,s,r,"avg")}}sE.className="AveragePooling2D",Od(sE);class rE extends NC{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new zA(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];sx(this.poolSize,"poolSize"),sx(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),yx(this.padding),this.inputSpec=[new SC({ndim:5})]}computeOutputShape(e){e=wC(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[4]:e[3];return t=GS(t,this.poolSize[0],this.padding,this.strides[0]),n=GS(n,this.poolSize[1],this.padding,this.strides[1]),s=GS(s,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,s]:[e[0],t,n,s,e[4]]}call(e,t){return oh((()=>(this.invokeCallHook(e,t),this.poolingFunction(bC(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class iE extends rE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Y_(e,t,n,s,r,"max")}}iE.className="MaxPooling3D",Od(iE);class aE extends rE{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return gx(r),yx(s),Y_(e,t,n,s,r,"avg")}}aE.className="AveragePooling3D",Od(aE);class oE extends NC{constructor(e){super(e),this.inputSpec=[new SC({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new LA}}class lE extends oE{constructor(e){super(e||{})}call(e,t){return oh((()=>{const t=bC(e);return rg(t,1)}))}}lE.className="GlobalAveragePooling1D",Od(lE);class uE extends oE{constructor(e){super(e||{})}call(e,t){return oh((()=>{const t=bC(e);return ym(t,1)}))}}uE.className="GlobalMaxPooling1D",Od(uE);class cE extends NC{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,gx(this.dataFormat),this.inputSpec=[new SC({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new LA}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class hE extends cE{call(e,t){return oh((()=>{const t=bC(e);return"channelsLast"===this.dataFormat?rg(t,[1,2]):rg(t,[2,3])}))}}hE.className="GlobalAveragePooling2D",Od(hE);class dE extends cE{call(e,t){return oh((()=>{const t=bC(e);return"channelsLast"===this.dataFormat?ym(t,[1,2]):ym(t,[2,3])}))}}dE.className="GlobalMaxPooling2D",Od(dE);class pE extends NC{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){const s=ok(t.layer,n);delete t.layer;const r={layer:s};return Object.assign(r,t),new e(r)}}class fE extends pE{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=wC(e)).length<3)throw new zA(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=wC(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),s=e[1];return[n[0],s].concat(n.slice(1))}call(e,t){return oh((()=>l_(((e,n)=>[bC(this.layer.call(e,t)),[]]),e=bC(e),[],!1,null,null,!1,!0)[1]))}}fE.className="TimeDistributed",Od(fE);class mE extends pE{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=ok(n),t.goBackwards=!0!==t.goBackwards;const s={};var r;if(s.className=e.layer.getClassName(),s.config=t,this.backwardLayer=ok(s),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,r=this.mergeMode,tx(fx,"BidirectionalMergeMode",r),e.weights)throw new LA("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t,n,s,r=this.forwardLayer.computeOutputShape(e);return Array.isArray(r)&&Array.isArray(r[0])||(r=[r]),this.returnState?(s=r.slice(1),t=r[0]):t=r[0],"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(s).concat(s.slice()):[t].concat(s).concat(s.slice()):qA(n)}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=o_(e,n,s,this.numConstants);if(e=r.inputs,n=r.initialState,s=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==s)return super.apply(e,t);const i=[],a=[];if(null!=n){const e=n.length;if(e%2>0)throw new zA("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,i.push(...n);const s=n.map((e=>new SC({shape:e.shape})));this.forwardLayer.stateSpec=s.slice(0,e/2),this.backwardLayer.stateSpec=s.slice(e/2),a.push(...s)}if(null!=s)throw new LA("Support for constants in Bidirectional layers is not implemented yet.");const o=i[0]instanceof _C;for(const e of i)if(e instanceof _C!==o)throw new zA("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){const n=[e].concat(i),s=this.inputSpec.concat(a),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return oh((()=>{const n=t.initialState;let s,r,i,a;if(null==n)s=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const i=n.slice(0,n.length/2),a=n.slice(n.length/2);s=this.forwardLayer.call(e,Object.assign(t,{initialState:i})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:a}))}return this.returnState&&(Array.isArray(s)&&(i=s.slice(1).concat(r.slice(1))),s=s[0],r=r[0]),this.returnSequences&&(r=jg(r,1)),"concat"===this.mergeMode?a=zx([s,r]):"sum"===this.mergeMode?a=bd(s,r):"ave"===this.mergeMode?a=Ad(.5,bd(s,r)):"mul"===this.mergeMode?a=Ad(s,r):null==this.mergeMode&&(a=[s,r]),this.returnState?null==this.mergeMode?a.concat(i):[a].concat(i):a}))}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ax(this.forwardLayer.name,(()=>{this.forwardLayer.build(e)})),Ax(this.backwardLayer.name,(()=>{this.backwardLayer.build(e)})),this.built=!0}computeMask(e,t){let n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map((e=>null));return Array.isArray(n)?n.concat(e).concat(e):[n].concat(e).concat(e)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const n=ok(t.layer);if(delete t.layer,null!=t.numConstants)throw new LA("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=t;return s.layer=n,new e(s)}}mE.className="Bidirectional",Od(mE);class gE extends NC{constructor(e){super(e),this.scale=e.scale,e.offset?this.offset=e.offset:this.offset=0}getConfig(){const e={scale:this.scale,offset:this.offset},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return oh((()=>("float32"!==(e=bC(e)).dtype&&(e=Rx(e,"float32")),bd(Ad(e,this.scale),this.offset))))}}gE.className="Rescaling",Od(gE);const{resizeBilinear:yE,cropAndResize:bE}=sw;class wE extends NC{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,s,r,i,a,o){return oh((()=>{let l,u=!1;const c=[t/i,n/a,(s+t)/i,(r+n)/a],h=[];3===e.rank?(u=!0,l=gy([e])):l=e;for(let e=0;eRx(yE(e,[t,n]),s)))}call(e,t){return oh((()=>{const t=bC(e),n=t.dtype,s=t.shape,r=s[s.length-3],i=s[s.length-2];let a=0;r!==this.height&&(a=Math.floor((r-this.height)/2));let o=0;return i!==this.width&&(o=Math.floor((i-this.width)/2),0===o&&(o=1)),a>=0&&o>=0?this.centerCrop(t,a,o,this.height,this.width,r,i,n):this.upsize(e,this.height,this.width,n)}))}getConfig(){const e={height:this.height,width:this.width},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){const t=(e=wC(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}wE.className="CenterCrop",Od(wE);class vE extends NC{constructor(e){super(e),this.numTokens=e.numTokens,e.outputMode?this.outputMode=e.outputMode:this.outputMode="multiHot"}getConfig(){const e={numTokens:this.numTokens,outputMode:this.outputMode},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){return null==(e=wC(e))?[this.numTokens]:"oneHot"===this.outputMode&&1!==e[e.length-1]?(e.push(this.numTokens),e):(e[e.length-1]=this.numTokens,e)}call(e,t){return oh((()=>{let n;if("int32"!==(e=bC(e)).dtype&&(e=Rx(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new zA(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=bC(t.countWeights)}const s=ym(e),r=bm(e),i=Nm(this.numTokens,s).bufferSync().get(0),a=Om(r,0).bufferSync().get(0);if(!i||!a)throw new zA(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);return function(e,t,n,s){let r=bC(e);if("int32"!==r.dtype&&(r=Rx(r,"int32")),"int"===t)return r;const i=r.shape;if(0===r.rank&&(r=km(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=km(r,-1)),r.rank>2)throw new zA(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${i} which would result in output rank ${r.rank}.`);const a=["multiHot","oneHot"].includes(t),o=r;let l;if(l=Zf(o,void 0!==s&&"count"===t?s:[],n,a),"tfIdf"!==t)return l;if(s)return Ad(l,s);throw new zA("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)}))}}vE.className="CategoryEncoding",Od(vE);const AE=new Set(["bilinear","nearest"]);class xE extends NC{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!AE.has(e.interpolation))throw new zA(`Invalid interpolation parameter: ${e.interpolation} is not implemented`);this.interpolation=e.interpolation}else this.interpolation="bilinear";this.cropToAspectRatio=Boolean(e.cropToAspectRatio)}computeOutputShape(e){const t=(e=wC(e))[2];return[this.height,this.width,t]}getConfig(){const e={height:this.height,width:this.width,interpolation:this.interpolation,cropToAspectRatio:this.cropToAspectRatio},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return oh((()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return sw.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return sw.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...AE]} are supported`)}))}}xE.className="Resizing",Od(xE);class CE{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}CE.className="RandomSeed";class kE extends NC{constructor(e){super(e),this.randomGenerator=new CE(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}kE.className="BaseRandomLayer";const SE=new Set(["bilinear","nearest"]);class _E extends kE{constructor(e){super(e);const{factor:t,interpolation:n="bilinear"}=e;if(this.factor=t,Array.isArray(this.factor)&&2===this.factor.length)this.widthLower=this.factor[0],this.widthUpper=this.factor[1];else{if(Array.isArray(this.factor)||!(this.factor>0))throw new zA(`Invalid factor: ${this.factor}. Must be positive number or tuple of 2 numbers`);this.widthLower=-this.factor,this.widthUpper=this.factor}if(this.widthLower<-1||this.widthUpper<-1)throw new zA(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=bC(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=Lg([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let s=this.widthFactor.dataSync()[0]*n;s=Math.round(s);const r=[this.imgHeight,s];switch(this.interpolation){case"bilinear":return sw.resizeBilinear(e,r);case"nearest":return sw.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...SE]} are supported`)}}))}}_E.className="RandomWidth",Od(_E);var EE,IE;ca().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(EE||(EE={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(IE||(IE={}));const TE={};function NE(e){return TE[e]}function OE(e,t,n,s,r){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,a=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd,o=e<0?t.inputNames.length+e:e;if("tensor"===i.type)return RE(t.inputNames[o],n,s,r);if("tensors"===i.type){const i=t.inputs.slice(e,a);return t.inputNames.slice(e,a).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=i[t])||void 0===n?void 0:n.op)})).map((e=>RE(e,n,s,r)))}const l=RE(t.inputNames[o],n,s,r),u=l.dataSync();return"number"===i.type?u[0]:Ji(l.shape,u)}const a=t.attrParams[e];return a&&a.value}function RE(e,t,n,s){const[r,i]=BE(e,n);if(null!=s){const e=s.getHashTableHandleByName(r);if(null!=e)return e}const a=n.currentContextIds.find((e=>!!t[FE(r,e)]));return void 0!==a?t[FE(r,a)][i]:void 0}function DE(e,t,n){return t[FE(e,n.currentContextId)]}function ME(e,t){const[n,s,r]=BE(e,t);return[FE(n,t&&t.currentContextId),s,r]}function FE(e,t){return t?`${e}-${t}`:e}function BE(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const s=e.split(":");let r;if(1===s.length)r=[e,0,void 0];else{const e=s[0],t=3===s.length?s[1]:void 0;r=[e,Number(s[s.length-1]),t]}return n&&t.parseNodeNameCache.set(e,r),r}function zE(e,t,n){let s=OE("pad",e,t,n);if("explicit"===s){s=OE("explicitPaddings",e,t,n);const r=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)r[e][0]=s[2*e],r[e][1]=s[2*e+1];return r}return s}function LE(e){return e.kept?e:gd(e)}const PE=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],VE=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],WE=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],GE=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],UE=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],qE=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],jE=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],HE=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],$E=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],KE=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],XE=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],ZE=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],YE=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],QE=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],JE=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],eI=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],tI=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],nI=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],sI=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class rI{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[i,a,o,l,u,c,h,d,p,f,m,g,y,b,w,v,A,x,C].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,s=[],r=[],i=[],a=n.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?s.push(e[t.name]):"Const"===t.op?r.push(e[t.name]):null!=t.input&&0!==t.input.length||i.push(e[t.name]),e)),{});let o=[];const l=[];let u={},c={};null!=t&&(u=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const h=Object.keys(a);h.forEach((e=>{const t=a[e];t.inputNames.forEach(((e,n)=>{const[s,,r]=ME(e),i=a[s];if(null!=i.outputs){const e=i.outputs.indexOf(r);if(-1!==e){const r=`${s}:${e}`;t.inputNames[n]=r}}t.inputs.push(i),i.children.push(t)}))})),0===Object.keys(c).length?h.forEach((e=>{const t=a[e];0===t.children.length&&l.push(t)})):Object.keys(c).forEach((e=>{const[t]=ME(e),n=a[t];null!=n&&(n.signatureKey=c[e],l.push(n))})),Object.keys(u).length>0?Object.keys(u).forEach((e=>{const[t]=ME(e),n=a[t];n&&(n.signatureKey=u[e],o.push(n))})):o=s;let d={};null!=e.library&&null!=e.library.function&&(d=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const p={nodes:a,inputs:o,outputs:l,weights:r,placeholders:s,signature:t,functions:d};return i.length>0&&(p.initNodes=i),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=NE(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.slice(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(((t,n)=>{const s=n.type;let r;switch(n.type){case"string":r=aI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=aI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=gI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=gI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=lI(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=lI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=mI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=mI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=oI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=oI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=bI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=bI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=fI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=fI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=yI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=yI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=hI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=hI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=dI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=dI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=cI(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=cI(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:r,type:s},t}),{})),n}mapFunction(e){const t=e.nodeDef,n=[];let s={};null!=t&&(s=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e)),{}));const r=[],i=[];e.signature.inputArg.forEach((e=>{const[t]=ME(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:uI(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,r.push(n),s[t]=n}));Object.keys(s).forEach((e=>{const t=s[e];t.inputNames.forEach(((e,n)=>{const[r,,i]=ME(e),a=s[r];if(null!=a.outputs){const e=a.outputs.indexOf(i);if(-1!==e){const s=`${r}:${e}`;t.inputNames[n]=s}}t.inputs.push(a),a.children.push(t)}))}));const a=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=ME(a[e.name]),r=s[t];null!=r&&(r.defaultOutput=n,i.push(r))}));const o=this.mapArgsToSignature(e);return{nodes:s,inputs:r,outputs:i,weights:n,placeholders:[],signature:o}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function iI(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=ca().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function aI(e,t,n,s=!1){const r=e[t];return null!=r?iI(r.s,s):n}function oI(e,t,n){const s=e[t];return s?s.b:n}function lI(e,t,n){const s=e[t]||{},r=null!=s.i?s.i:null!=s.f?s.f:n;return"number"==typeof r?r:parseInt(r,10)}function uI(e){switch("string"==typeof e&&(e=EE[e]),e){case EE.DT_FLOAT:case EE.DT_HALF:return"float32";case EE.DT_INT32:case EE.DT_INT64:case EE.DT_INT8:case EE.DT_UINT8:return"int32";case EE.DT_BOOL:return"bool";case EE.DT_DOUBLE:return"float32";case EE.DT_STRING:return"string";case EE.DT_COMPLEX64:case EE.DT_COMPLEX128:return"complex64";default:return null}}function cI(e,t,n){const s=e[t];return s&&s.func?s.func.name:n}function hI(e,t,n){const s=e[t];return s&&s.type?uI(s.type):n}function dI(e,t,n){const s=e[t];return s&&s.list&&s.list.type?s.list.type.map((e=>uI(e))):n}function pI(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function fI(e,t,n){const s=e[t];return s&&s.shape?pI(s.shape):n}function mI(e,t,n){const s=e[t];return s?((s.list.f&&s.list.f.length?s.list.f:s.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):n}function gI(e,t,n,s=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map((e=>iI(e,s))):n}function yI(e,t,n){const s=e[t];return s&&s.list&&s.list.shape?s.list.shape.map((e=>pI(e))):n}function bI(e,t,n){const s=e[t];return s&&s.list&&s.list.b?s.list.b:n}class wI{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return RE(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return RE(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return lI(this.node.rawAttrs,e,t);if(null!=n.s)return aI(this.node.rawAttrs,e,t);if(null!=n.b)return oI(this.node.rawAttrs,e,t);if(null!=n.shape)return fI(this.node.rawAttrs,e,t);if(null!=n.type)return hI(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return mI(this.node.rawAttrs,e,t);if(null!=n.list.s)return gI(this.node.rawAttrs,e,t);if(null!=n.list.shape)return yI(this.node.rawAttrs,e,t);if(null!=n.list.b)return bI(this.node.rawAttrs,e,t);if(null!=n.list.type)return dI(this.node.rawAttrs,e,t)}return t}}function vI(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){Ni(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let s=0;sn+` Shapes ${e} and ${t} must match`))}}}function AI(e){return"number"!=typeof e&&!e.some((e=>e<0))}function xI(e,t,n){let s=CI(e,n);const r=!AI(s);if(r&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${s}`);if(r&&t.forEach((e=>{s=CI(e.shape,s)})),!AI(s))throw new Error(`Non-fully-defined elementShape: ${s}`);return s}function CI(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let s=0;s=0&&i>=0&&r!==i)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[s]=r>=0?r:i}return n}class kI{constructor(e,t,n,s,r,i,a){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=s,this.identicalElementShapes=r,this.dynamicSize=i,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=_d(0),uh(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),vI(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,uh(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,n)=>this.write(e,t[n])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,Dy(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const s=e.map((e=>(n+=e,n)));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const r=0===n?0:t.size/n,i=[];oh((()=>{t=mf(t,[1,n,r]);for(let n=0;n{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);vI(t,e.shape,"TensorList shape mismatch: "),uh(e)})),this.idTensor=_d(0),this.maxNumElements=s,uh(this.idTensor)}copy(){return new SI([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);vI(e,this.elementShape,"TensorList shape mismatch: ");const s=xI(this.elementShape,this.tensors,e);return oh((()=>{const e=this.tensors.map((e=>mf(e,s)));return gy(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=xI(this.elementShape,this.tensors,e),s=this.tensors.pop();return s.kept=!1,vI(s.shape,e,"TensorList shape mismatch: "),mf(s,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(vI(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");uh(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new SI([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);vI(this.tensors[e].shape,t,"TensorList shape mismatch: ");const s=xI(this.elementShape,this.tensors,t);return mf(this.tensors[e],s)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);vI(this.elementShape,t.shape,"TensorList shape mismatch: "),uh(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);vI(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const s=xI(this.elementShape,this.tensors,n);return 0===e.length?nh([],[0].concat(s)):oh((()=>{const t=e.map((e=>mf(this.tensors[e],s)));return gy(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);vI(this.elementShape,t,"TensorList shape mismatch: ");const n=xI(this.elementShape,this.tensors,t);return 0===this.size()?nh([],[0].concat(n)):oh((()=>{const e=this.tensors.map((e=>mf(e,n)));return bf(e,0)}))}}const _I=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const s=OE("thenBranch",e,t,n),r=OE("elseBranch",e,t,n),i=OE("cond",e,t,n),a=OE("args",e,t,n);return(await i.data())[0]?n.functionMap[s].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const s=OE("body",e,t,n),r=OE("cond",e,t,n),i=OE("args",e,t,n),a=await n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap),o=i.map((e=>e.id));let l=await a[0].data();a.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||e.dispose()}));let u=i;for(;l[0];){const e=u;u=await n.functionMap[s].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map((e=>e.id));e.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const i=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await i[0].data(),i.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return u}case"LoopCond":return[LE(OE("pred",e,t,n))];case"Switch":{const s=OE("pred",e,t,n);let r=OE("data",e,t,n);return r.kept||(r=LE(r)),(await s.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const s=e.inputNames.find((e=>void 0!==RE(e,t,n)));if(s){return[LE(RE(s,t,n))]}return}case"Enter":{const s=OE("frameName",e,t,n),r=OE("tensor",e,t,n);return n.enterFrame(s),[LE(r)]}case"Exit":{const s=OE("tensor",e,t,n);return n.exitFrame(),[LE(s)]}case"NextIteration":{const s=OE("tensor",e,t,n);return n.nextIteration(),[LE(s)]}case"TensorArrayV3":{const s=OE("size",e,t,n),r=OE("dtype",e,t,n),i=OE("elementShape",e,t,n),a=OE("dynamicSize",e,t,n),o=OE("clearAfterRead",e,t,n),l=OE("identicalElementShapes",e,t,n),u=OE("name",e,t,n),c=new kI(u,r,s,i,l,a,o);return n.addTensorArray(c),[c.idTensor,_d(1)]}case"TensorArrayWriteV3":{const s=OE("tensorArrayId",e,t,n),r=OE("index",e,t,n),i=OE("tensor",e,t,n),a=n.getTensorArray(s.id);return a.write(r,i),[a.idTensor]}case"TensorArrayReadV3":{const s=OE("tensorArrayId",e,t,n),r=OE("index",e,t,n);return[n.getTensorArray(s.id).read(r)]}case"TensorArrayGatherV3":{const s=OE("tensorArrayId",e,t,n),r=OE("indices",e,t,n),i=OE("dtype",e,t,n);return[n.getTensorArray(s.id).gather(r,i)]}case"TensorArrayScatterV3":{const s=OE("tensorArrayId",e,t,n),r=OE("indices",e,t,n),i=OE("tensor",e,t,n),a=n.getTensorArray(s.id);return a.scatter(r,i),[a.idTensor]}case"TensorArrayConcatV3":{const s=OE("tensorArrayId",e,t,n),r=n.getTensorArray(s.id),i=OE("dtype",e,t,n);return[r.concat(i)]}case"TensorArraySplitV3":{const s=OE("tensorArrayId",e,t,n),r=OE("tensor",e,t,n),i=OE("lengths",e,t,n),a=n.getTensorArray(s.id);return a.split(i,r),[a.idTensor]}case"TensorArraySizeV3":{const s=OE("tensorArrayId",e,t,n);return[_d(n.getTensorArray(s.id).size(),"int32")]}case"TensorArrayCloseV3":{const s=OE("tensorArrayId",e,t,n),r=n.getTensorArray(s.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const s=OE("tensorListId",e,t,n),r=OE("index",e,t,n),i=OE("tensor",e,t,n),a=n.getTensorList(s.id);return a.setItem(r,i),[a.idTensor]}case"TensorListGetItem":{const s=OE("tensorListId",e,t,n),r=OE("index",e,t,n),i=OE("elementShape",e,t,n),a=OE("elementDType",e,t,n);return[n.getTensorList(s.id).getItem(r,i,a)]}case"TensorListScatterV2":case"TensorListScatter":{const s=OE("indices",e,t,n),r=function(e,t,n,s){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const r=Math.max(...t);if(null!=s&&-1!==s&&r>=s)throw new Error(`Max index must be < array size (${r} vs. ${s})`);const i=new SI([],n,e.dtype,s),a=Dy(e,0);return t.forEach(((e,t)=>{i.setItem(e,a[t])})),i}(OE("tensor",e,t,n),s,OE("elementShape",e,t,n),OE("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const s=OE("elementShape",e,t,n),r=OE("elementDType",e,t,n);let i;i="TensorListReserve"===e.op?"numElements":"maxNumElements";const a=OE(i,e,t,n),o=function(e,t,n,s){return new SI([],e,t,s)}(s,r,0,"TensorListReserve"===e.op?-1:a);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{const s=OE("tensorListId",e,t,n),r=OE("indices",e,t,n),i=OE("elementShape",e,t,n),a=OE("elementDType",e,t,n);return[n.getTensorList(s.id).gather(r,a,i)]}case"TensorListStack":{const s=OE("tensorListId",e,t,n),r=OE("elementShape",e,t,n),i=OE("elementDType",e,t,n),a=OE("numElements",e,t,n);return[n.getTensorList(s.id).stack(r,i,a)]}case"TensorListFromTensor":{const s=function(e,t,n){const s=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);vI(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=Dy(e);return new SI(r,t,s)}(OE("tensor",e,t,n),OE("elementShape",e,t,n),OE("elementDType",e,t,n));return n.addTensorList(s),[s.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const s=OE("tensorListId",e,t,n),r=n.getTensorList(s.id),i=OE("dtype",e,t,n),a=OE("elementShape",e,t,n);return[r.concat(i,a)]}case"TensorListPushBack":{const s=OE("tensorListId",e,t,n),r=OE("tensor",e,t,n),i=n.getTensorList(s.id);return i.pushBack(r),[i.idTensor]}case"TensorListPopBack":{const s=OE("tensorListId",e,t,n),r=OE("elementShape",e,t,n),i=OE("elementDType",e,t,n);return[n.getTensorList(s.id).popBack(r,i)]}case"TensorListSplit":{const s=OE("tensor",e,t,n),r=OE("elementShape",e,t,n),i=function(e,t,n){let s=0;const r=t.map((e=>(s+=e,s)));if(s!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${s}, and tensor's shape is: ${e.shape}`);const i=CI(e.shape.slice(1),n),a=0===s?0:e.size/s,o=oh((()=>{const n=[];e=mf(e,[1,s,a]);for(let s=0;se.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return _d(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),oh((()=>{const e=Dy(t),s=n.length,r=e.length;Ni(s===r,(()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${r} elements.`));for(let t=0;t{const e=[];for(let s=0;s{switch(e.category){case"arithmetic":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[s.add(OE("a",e,t,n),OE("b",e,t,n))];case"AddN":return[s.addN(OE("tensors",e,t,n))];case"FloorMod":case"Mod":return[s.mod(OE("a",e,t,n),OE("b",e,t,n))];case"Mul":return[s.mul(OE("a",e,t,n),OE("b",e,t,n))];case"RealDiv":case"Div":return[s.div(OE("a",e,t,n),OE("b",e,t,n))];case"DivNoNan":return[s.divNoNan(OE("a",e,t,n),OE("b",e,t,n))];case"FloorDiv":return[s.floorDiv(OE("a",e,t,n),OE("b",e,t,n))];case"Sub":return[s.sub(OE("a",e,t,n),OE("b",e,t,n))];case"Minimum":return[s.minimum(OE("a",e,t,n),OE("b",e,t,n))];case"Maximum":return[s.maximum(OE("a",e,t,n),OE("b",e,t,n))];case"Pow":return[s.pow(OE("a",e,t,n),OE("b",e,t,n))];case"SquaredDifference":return[s.squaredDifference(OE("a",e,t,n),OE("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"basic_math":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Abs":case"ComplexAbs":return[s.abs(OE("x",e,t,n))];case"Acos":return[s.acos(OE("x",e,t,n))];case"Acosh":return[s.acosh(OE("x",e,t,n))];case"Asin":return[s.asin(OE("x",e,t,n))];case"Asinh":return[s.asinh(OE("x",e,t,n))];case"Atan":return[s.atan(OE("x",e,t,n))];case"Atan2":return[s.atan2(OE("x",e,t,n),OE("y",e,t,n))];case"Atanh":return[s.atanh(OE("x",e,t,n))];case"Ceil":return[s.ceil(OE("x",e,t,n))];case"Complex":return[s.complex(OE("real",e,t,n),OE("imag",e,t,n))];case"Cos":return[s.cos(OE("x",e,t,n))];case"Cosh":return[s.cosh(OE("x",e,t,n))];case"Elu":return[s.elu(OE("x",e,t,n))];case"Erf":return[s.erf(OE("x",e,t,n))];case"Exp":return[s.exp(OE("x",e,t,n))];case"Expm1":return[s.expm1(OE("x",e,t,n))];case"Floor":return[s.floor(OE("x",e,t,n))];case"Log":return[s.log(OE("x",e,t,n))];case"Log1p":return[s.log1p(OE("x",e,t,n))];case"Imag":return[s.imag(OE("x",e,t,n))];case"Neg":return[s.neg(OE("x",e,t,n))];case"Reciprocal":return[s.reciprocal(OE("x",e,t,n))];case"Real":return[s.real(OE("x",e,t,n))];case"Relu":return[s.relu(OE("x",e,t,n))];case"Round":return[s.round(OE("x",e,t,n))];case"Selu":return[s.selu(OE("x",e,t,n))];case"Sigmoid":return[s.sigmoid(OE("x",e,t,n))];case"Sin":return[s.sin(OE("x",e,t,n))];case"Sign":return[s.sign(OE("x",e,t,n))];case"Sinh":return[s.sinh(OE("x",e,t,n))];case"Softplus":return[s.softplus(OE("x",e,t,n))];case"Sqrt":return[s.sqrt(OE("x",e,t,n))];case"Square":return[s.square(OE("x",e,t,n))];case"Tanh":return[s.tanh(OE("x",e,t,n))];case"Tan":return[s.tan(OE("x",e,t,n))];case"ClipByValue":return[s.clipByValue(OE("x",e,t,n),OE("clipValueMin",e,t,n),OE("clipValueMax",e,t,n))];case"Relu6":return[s.relu6(OE("x",e,t,n))];case"Rsqrt":return[s.rsqrt(RE(e.inputNames[0],t,n))];case"LeakyRelu":return[s.leakyRelu(OE("x",e,t,n),OE("alpha",e,t,n))];case"Prelu":return[s.prelu(OE("x",e,t,n),OE("alpha",e,t,n))];case"IsNan":return[s.isNaN(RE(e.inputNames[0],t,n))];case"IsInf":return[s.isInf(RE(e.inputNames[0],t,n))];case"IsFinite":return[s.isFinite(RE(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return _I(e,t,n);case"convolution":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Conv1D":{const r=OE("stride",e,t,n),i=OE("pad",e,t,n),a=OE("dataFormat",e,t,n).toUpperCase(),o=OE("dilation",e,t,n);return[s.conv1d(OE("x",e,t,n),OE("filter",e,t,n),r,i,a,o)]}case"Conv2D":{const r=OE("strides",e,t,n),i=zE(e,t,n),a=OE("dataFormat",e,t,n).toUpperCase(),o=OE("dilations",e,t,n);return[s.conv2d(OE("x",e,t,n),OE("filter",e,t,n),[r[1],r[2]],i,a,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=EI(e,t,n);return[s.fused.conv2d({x:OE("x",e,t,n),filter:OE("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=EI(e,t,n);return[s.fused.depthwiseConv2d({x:OE("x",e,t,n),filter:OE("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=OE("outputShape",e,t,n),i=OE("strides",e,t,n),a=zE(e,t,n);return[s.conv2dTranspose(OE("x",e,t,n),OE("filter",e,t,n),r,[i[1],i[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=OE("strides",e,t,n),i=zE(e,t,n),a=OE("dilations",e,t,n),o=OE("dataFormat",e,t,n).toUpperCase();return[s.depthwiseConv2d(OE("input",e,t,n),OE("filter",e,t,n),[r[1],r[2]],i,o,[a[1],a[2]])]}case"Conv3D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("dataFormat",e,t,n).toUpperCase(),o=OE("dilations",e,t,n);return[s.conv3d(OE("x",e,t,n),OE("filter",e,t,n),[r[1],r[2],r[3]],i,a,[o[1],o[2],o[3]])]}case"AvgPool":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.avgPool(OE("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPool":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.maxPool(OE("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPoolWithArgmax":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n),o=OE("includeBatchInIndex",e,t,n),{result:l,indexes:u}=s.maxPoolWithArgmax(OE("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i,o);return[l,u]}case"AvgPool3D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.avgPool3d(OE("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"MaxPool3D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("kernelSize",e,t,n);return[s.maxPool3d(OE("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"Dilation2D":{const r=OE("strides",e,t,n),i=OE("pad",e,t,n),a=OE("dilations",e,t,n),o=r[1],l=r[2],u=a[1],c=a[2];return[s.dilation2d(OE("x",e,t,n),OE("filter",e,t,n),[o,l],i,[u,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Fill":{const r=OE("shape",e,t,n),i=OE("dtype",e,t,n),a=OE("value",e,t,n);return[s.fill(r,a,i)]}case"LinSpace":{const r=OE("start",e,t,n),i=OE("stop",e,t,n),a=OE("num",e,t,n);return[s.linspace(r,i,a)]}case"Multinomial":{const r=OE("logits",e,t,n),i=OE("numSamples",e,t,n),a=OE("seed",e,t,n);return[s.multinomial(r,i,a)]}case"OneHot":{const r=OE("indices",e,t,n),i=OE("depth",e,t,n),a=OE("onValue",e,t,n),o=OE("offValue",e,t,n),l=OE("dtype",e,t,n);return[s.oneHot(r,i,a,o,l)]}case"Ones":return[s.ones(OE("shape",e,t,n),OE("dtype",e,t,n))];case"OnesLike":return[s.onesLike(OE("x",e,t,n))];case"RandomStandardNormal":return[s.randomStandardNormal(OE("shape",e,t,n),OE("dtype",e,t,n),OE("seed",e,t,n))];case"RandomUniform":return[s.randomUniform(OE("shape",e,t,n),OE("minval",e,t,n),OE("maxval",e,t,n),OE("dtype",e,t,n))];case"RandomUniformInt":return[s.randomUniformInt(OE("shape",e,t,n),OE("minval",e,t,n),OE("maxval",e,t,n),OE("seed",e,t,n))];case"Range":{const r=OE("start",e,t,n),i=OE("stop",e,t,n),a=OE("step",e,t,n);return[s.range(r,i,a,OE("dtype",e,t,n))]}case"TruncatedNormal":{const r=OE("shape",e,t,n),i=OE("mean",e,t,n),a=OE("stdDev",e,t,n),o=OE("seed",e,t,n);return[s.truncatedNormal(r,i,a,OE("dtype",e,t,n),o)]}case"Zeros":return[s.zeros(OE("shape",e,t,n),OE("dtype",e,t,n))];case"ZerosLike":return[s.zerosLike(OE("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"dynamic":return(async(e,t,n,s,r=k)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=II(e,t,n),c=await r.image.nonMaxSuppressionWithScoreAsync(s,i,a,o,l,u);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=II(e,t,n),u=OE("padToMaxOutputSize",e,t,n),c=await r.image.nonMaxSuppressionPaddedAsync(s,i,a,o,l,u);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=II(e,t,n);return[await r.image.nonMaxSuppressionAsync(s,i,a,o,l)]}case"Where":{const s=r.cast(OE("condition",e,t,n),"bool"),i=[await r.whereAsync(s)];return s.dispose(),i}case"ListDiff":return r.setdiff1dAsync(OE("x",e,t,n),OE("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"LowerBound":{const r=OE("sortedSequence",e,t,n),i=OE("values",e,t,n);return[s.lowerBound(r,i)]}case"TopKV2":{const r=OE("x",e,t,n),i=OE("k",e,t,n),a=OE("sorted",e,t,n),o=s.topk(r,i,a);return[o.values,o.indices]}case"UpperBound":{const r=OE("sortedSequence",e,t,n),i=OE("values",e,t,n);return[s.upperBound(r,i)]}case"Unique":{const r=OE("x",e,t,n),i=s.unique(r);return[i.values,i.indices]}case"UniqueV2":{const r=OE("x",e,t,n),i=OE("axis",e,t,n),a=s.unique(r,i);return[a.values,a.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ResizeBilinear":{const r=OE("images",e,t,n),i=OE("size",e,t,n),a=OE("alignCorners",e,t,n),o=OE("halfPixelCenters",e,t,n);return[s.image.resizeBilinear(r,[i[0],i[1]],a,o)]}case"ResizeNearestNeighbor":{const r=OE("images",e,t,n),i=OE("size",e,t,n),a=OE("alignCorners",e,t,n),o=OE("halfPixelCenters",e,t,n);return[s.image.resizeNearestNeighbor(r,[i[0],i[1]],a,o)]}case"CropAndResize":{const r=OE("image",e,t,n),i=OE("boxes",e,t,n),a=OE("boxInd",e,t,n),o=OE("cropSize",e,t,n),l=OE("method",e,t,n),u=OE("extrapolationValue",e,t,n);return[s.image.cropAndResize(r,i,a,o,l,u)]}case"ImageProjectiveTransformV3":{const r=OE("images",e,t,n),i=OE("transforms",e,t,n),a=OE("outputShape",e,t,n),o=OE("fillValue",e,t,n),l=OE("interpolation",e,t,n),u=OE("fillMode",e,t,n);return[s.image.transform(r,i,l.toLowerCase(),u.toLowerCase(),o,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=OE("default",e,t,n);return[RE(e.name,t,n)||r];case"Placeholder":return[RE(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[LE(OE("x",e,t,n))];case"IdentityN":return OE("x",e,t,n).map((e=>LE(e)));case"Shape":return[s.tensor1d(OE("x",e,t,n).shape,"int32")];case"ShapeN":return OE("x",e,t,n).map((e=>s.tensor1d(e.shape)));case"Size":return[s.scalar(OE("x",e,t,n).size,"int32")];case"Rank":return[s.scalar(OE("x",e,t,n).rank,"int32")];case"NoOp":return[s.scalar(1)];case"Print":const i=OE("x",e,t,n),a=OE("data",e,t,n);OE("message",e,t,n),OE("summarize",e,t,n);for(let e=0;e((e,t,n,s=k)=>{switch(e.op){case"Equal":return[s.equal(OE("a",e,t,n),OE("b",e,t,n))];case"NotEqual":return[s.notEqual(OE("a",e,t,n),OE("b",e,t,n))];case"Greater":return[s.greater(OE("a",e,t,n),OE("b",e,t,n))];case"GreaterEqual":return[s.greaterEqual(OE("a",e,t,n),OE("b",e,t,n))];case"Less":return[s.less(OE("a",e,t,n),OE("b",e,t,n))];case"LessEqual":return[s.lessEqual(OE("a",e,t,n),OE("b",e,t,n))];case"LogicalAnd":return[s.logicalAnd(OE("a",e,t,n),OE("b",e,t,n))];case"LogicalNot":return[s.logicalNot(OE("a",e,t,n))];case"LogicalOr":return[s.logicalOr(OE("a",e,t,n),OE("b",e,t,n))];case"Select":case"SelectV2":return[s.where(OE("condition",e,t,n),OE("a",e,t,n),OE("b",e,t,n))];case"BitwiseAnd":return[s.bitwiseAnd(OE("a",e,t,n),OE("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"matrices":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[s.matMul(OE("a",e,t,n),OE("b",e,t,n),OE("transposeA",e,t,n),OE("transposeB",e,t,n))];case"Einsum":return[s.einsum(OE("equation",e,t,n),...OE("tensors",e,t,n))];case"Transpose":return[s.transpose(OE("x",e,t,n),OE("perm",e,t,n))];case"_FusedMatMul":const[r,i]=OE("fusedOps",e,t,n),a="biasadd"===r,o="prelu"===i,l=OE("numArgs",e,t,n),u=OE("leakyreluAlpha",e,t,n);if(a){if(o&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,h]=OE("args",e,t,n);return[s.fused.matMul({a:OE("a",e,t,n),b:OE("b",e,t,n),transposeA:OE("transposeA",e,t,n),transposeB:OE("transposeB",e,t,n),bias:c,activation:i,preluActivationWeights:h,leakyreluAlpha:u})];case"MatrixBandPart":return[s.linalg.bandPart(OE("a",e,t,n),OE("numLower",e,t,n),OE("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"normalization":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"EuclideanNorm":return[s.euclideanNorm(OE("x",e,t,n),OE("axis",e,t,n),OE("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[s.batchNorm(OE("x",e,t,n),OE("mean",e,t,n),OE("variance",e,t,n),OE("offset",e,t,n),OE("scale",e,t,n),OE("epsilon",e,t,n))];case"LRN":return[s.localResponseNormalization(OE("x",e,t,n),OE("radius",e,t,n),OE("bias",e,t,n),OE("alpha",e,t,n),OE("beta",e,t,n))];case"Softmax":return[s.softmax(OE("x",e,t,n))];case"LogSoftmax":return[s.logSoftmax(OE("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"ragged":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:i}=s.raggedGather(OE("paramsNestedSplits",e,t,n),OE("paramsDenseValues",e,t,n),OE("indices",e,t,n),OE("outputRaggedRank",e,t,n));return r.concat(i)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:i}=s.raggedRange(OE("starts",e,t,n),OE("limits",e,t,n),OE("splits",e,t,n));return[r,i]}case"RaggedTensorToTensor":return[s.raggedTensorToTensor(OE("shape",e,t,n),OE("values",e,t,n),OE("defaultValue",e,t,n),OE("rowPartitionTensors",e,t,n),OE("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"reduction":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Max":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.max(OE("x",e,t,n),r,i)]}case"Mean":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.mean(OE("x",e,t,n),r,i)]}case"Min":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.min(OE("x",e,t,n),r,i)]}case"Sum":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.sum(OE("x",e,t,n),r,i)]}case"All":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.all(OE("x",e,t,n),r,i)]}case"Any":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.any(OE("x",e,t,n),r,i)]}case"ArgMax":{const r=OE("axis",e,t,n);return[s.argMax(OE("x",e,t,n),r)]}case"ArgMin":{const r=OE("axis",e,t,n);return[s.argMin(OE("x",e,t,n),r)]}case"Prod":{const r=OE("axis",e,t,n),i=OE("keepDims",e,t,n);return[s.prod(OE("x",e,t,n),r,i)]}case"Cumprod":{const r=OE("axis",e,t,n),i=OE("exclusive",e,t,n),a=OE("reverse",e,t,n);return[s.cumprod(OE("x",e,t,n),r,i,a)]}case"Cumsum":{const r=OE("axis",e,t,n),i=OE("exclusive",e,t,n),a=OE("reverse",e,t,n);return[s.cumsum(OE("x",e,t,n),r,i,a)]}case"Bincount":const r=OE("x",e,t,n),i=OE("weights",e,t,n),a=OE("size",e,t,n);return[s.bincount(r,i,a)];case"DenseBincount":{const r=OE("x",e,t,n),i=OE("weights",e,t,n),a=OE("size",e,t,n),o=OE("binaryOutput",e,t,n);return[s.denseBincount(r,i,a,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=OE("n",e,t,n),i=OE("axis",e,t,n);let a=OE("tensors",e,t,n);return a=a.slice(0,r),[s.concat(a,i)]}case"Gather":{const r=OE("x",e,t,n),i=OE("indices",e,t,n);return[s.gather(r,s.cast(i,"int32"),0)]}case"GatherV2":{const r=OE("axis",e,t,n),i=OE("batchDims",e,t,n),a=OE("x",e,t,n),o=OE("indices",e,t,n);return[s.gather(a,s.cast(o,"int32"),r,i)]}case"Reverse":{const r=OE("dims",e,t,n),i=[];for(let e=0;e{const r=OE("axis",e,t,n),i=OE("tensors",e,t,n),a=i[0].shape,o=s.squeeze(i[0]).shape,l=i.map((e=>{const t=Mi(e.shape,a);if(!t&&!Mi(s.squeeze(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:s.reshape(e,a)}));return[s.stack(l,r)]}));case"Unpack":{const r=OE("axis",e,t,n),i=OE("tensor",e,t,n);return s.unstack(i,r)}case"Tile":{const r=OE("reps",e,t,n);return[s.tile(OE("x",e,t,n),r)]}case"Split":case"SplitV":{const r=OE("axis",e,t,n),i=OE("numOrSizeSplits",e,t,n),a=OE("x",e,t,n);return s.split(a,i,r)}case"ScatterNd":{const r=OE("indices",e,t,n),i=OE("values",e,t,n),a=OE("shape",e,t,n);return[s.scatterND(r,i,a)]}case"GatherNd":{const r=OE("x",e,t,n),i=OE("indices",e,t,n);return[s.gatherND(r,i)]}case"SparseToDense":{const r=OE("sparseIndices",e,t,n),i=OE("outputShape",e,t,n),a=OE("sparseValues",e,t,n),o=OE("defaultValue",e,t,n);return[s.sparseToDense(r,a,i,a.dtype===o.dtype?o:s.cast(o,a.dtype))]}case"TensorScatterUpdate":{const r=OE("indices",e,t,n),i=OE("values",e,t,n),a=OE("tensor",e,t,n);return[s.tensorScatterUpdate(a,r,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:i,emptyRowIndicator:a,reverseIndexMap:o}=s.sparse.sparseFillEmptyRows(OE("indices",e,t,n),OE("values",e,t,n),OE("denseShape",e,t,n),OE("defaultValue",e,t,n));return[r,i,a,o]}case"SparseReshape":{const{outputIndices:r,outputShape:i}=s.sparse.sparseReshape(OE("inputIndices",e,t,n),OE("inputShape",e,t,n),OE("newShape",e,t,n));return[r,i]}case"SparseSegmentMean":return[s.sparse.sparseSegmentMean(OE("data",e,t,n),OE("indices",e,t,n),OE("segmentIds",e,t,n))];case"SparseSegmentSum":return[s.sparse.sparseSegmentSum(OE("data",e,t,n),OE("indices",e,t,n),OE("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"spectral":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"FFT":return[s.fft(OE("x",e,t,n))];case"IFFT":return[s.ifft(OE("x",e,t,n))];case"RFFT":return[s.rfft(OE("x",e,t,n))];case"IRFFT":return[s.irfft(OE("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"string":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"StaticRegexReplace":return[s.string.staticRegexReplace(OE("input",e,t,n),OE("pattern",e,t,n),OE("rewrite",e,t,n),OE("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:i}=s.string.stringNGrams(OE("data",e,t,n),OE("dataSplits",e,t,n),OE("separator",e,t,n),OE("nGramWidths",e,t,n),OE("leftPad",e,t,n),OE("rightPad",e,t,n),OE("padWidth",e,t,n),OE("preserveShortSequences",e,t,n));return[r,i]}case"StringSplit":{const{indices:r,values:i,shape:a}=s.string.stringSplit(OE("input",e,t,n),OE("delimiter",e,t,n),OE("skipEmpty",e,t,n));return[r,i,a]}case"StringToHashBucketFast":return[s.string.stringToHashBucketFast(OE("input",e,t,n),OE("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"transformation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Cast":return[s.cast(OE("x",e,t,n),OE("dtype",e,t,n))];case"ExpandDims":{const r=OE("axis",e,t,n);return[s.expandDims(OE("x",e,t,n),r)]}case"Squeeze":{const r=OE("axis",e,t,n);return[s.squeeze(OE("x",e,t,n),r)]}case"Reshape":return[s.reshape(OE("x",e,t,n),OE("shape",e,t,n))];case"EnsureShape":return[s.ensureShape(OE("x",e,t,n),OE("shape",e,t,n))];case"MirrorPad":return[s.mirrorPad(OE("x",e,t,n),OE("padding",e,t,n),OE("mode",e,t,n))];case"PadV2":case"Pad":return[s.pad(OE("x",e,t,n),OE("padding",e,t,n),OE("constantValue",e,t,n))];case"SpaceToBatchND":{const r=OE("blockShape",e,t,n),i=OE("paddings",e,t,n);return[s.spaceToBatchND(OE("x",e,t,n),r,i)]}case"BatchToSpaceND":{const r=OE("blockShape",e,t,n),i=OE("crops",e,t,n);return[s.batchToSpaceND(OE("x",e,t,n),r,i)]}case"DepthToSpace":{const r=OE("blockSize",e,t,n),i=OE("dataFormat",e,t,n).toUpperCase();return[s.depthToSpace(OE("x",e,t,n),r,i)]}case"BroadcastTo":return[s.broadcastTo(OE("x",e,t,n),OE("shape",e,t,n))];case"BroadcastArgs":return[s.broadcastArgs(OE("s0",e,t,n),OE("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"hash_table":return(async(e,t,n,s)=>{switch(e.op){case"HashTable":case"HashTableV2":{const r=s.getHashTableHandleByName(e.name);if(null!=r)return[r];{const r=OE("keyDType",e,t,n),i=OE("valueDType",e,t,n),a=new TI(r,i);return s.addHashTable(e.name,a),[a.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=OE("tableHandle",e,t,n,s),i=OE("keys",e,t,n),a=OE("values",e,t,n),o=s.getHashTableById(r.id);return[await o.import(i,a)]}case"LookupTableFind":case"LookupTableFindV2":{const r=OE("tableHandle",e,t,n,s),i=OE("keys",e,t,n),a=OE("defaultValue",e,t,n),o=s.getHashTableById(r.id);return[await o.find(i,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=OE("tableHandle",e,t,n,s);return[s.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,s);case"custom":const i=NE(e.op);if(i&&i.customExecutor)return i.customExecutor(new wI(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return aa(i)?i.then((e=>[].concat(e))):[].concat(i)}class OI{constructor(e={},t={},n={},s={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=s,this.parseNodeNameCache=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function RI(e,t,n,s){const r=new Set,i=[];let a=null,o=null;const l=new Set,u=new Set(Object.keys(e).map((e=>BE(e)[0])));s=s||[];const c=new Set(s.map((e=>BE(e.name)[0]))),h=[...t];for(;h.length>0;){const e=h.pop();(LI(e)||PI(e)||VI(e))&&null==a&&(a=e,o=a.children.map((e=>e.name)).filter((e=>r.has(e)))),r.add(e.name),null==n[e.name]&&(u.has(e.name)||c.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{l.has(e.name)||(l.add(e.name),h.push(e))})):i.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:i,dynamicNode:a,syncInputs:o}}function DI(e,t){const{usedNodes:n,inputs:s}=t,r=Object.keys(s).map((e=>BE(e)[0])).map((t=>e.nodes[t])),i=e.initNodes||[],a=e=>n.has("string"==typeof e?e:e.name);function o(e){return[...new Map(e.map((e=>[e.name,e]))).values()]}const l=o([...r,...e.weights,...i]).filter(a),u=o([...l,...Object.values(e.nodes)]).filter(a),c=new Map(u.map((e=>[e.name,e]))),h={};for(const e of u){h[e.name]=h[e.name]||0;for(const t of e.children)a(t)||(h[t.name]=Number.POSITIVE_INFINITY),h[t.name]=(h[t.name]||0)+1}const d=Object.entries(h).filter((([,e])=>0===e)).map((([e])=>e)),p=[...d];for(;d.length>0;){const e=d.pop(),t=c.get(e);for(const e of t.children.filter(a))0==--h[e.name]&&(p.push(e.name),d.push(e.name))}const f=function(e,t){const n=new Map(e.map((e=>[e.name,e]))),s=t.map((e=>e.name)),r=new Set(s);for(;s.length>0;){const e=s.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!r.has(e.name)&&(r.add(e.name),s.push(e.name))}const i=e.filter((e=>r.has(e.name)));return i}(p.map((e=>c.get(e))),l);return function(e,t){const n=new Map(e.map(((e,t)=>[e.name,t]))),s=new Set(t.map((e=>e.name))),r=e=>s.has("string"==typeof e?e:e.name),i=new Set(e.map((e=>e.name))),a=e=>i.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(a)){if(!n.has(e.name))throw new MI(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new MI(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!r(t))for(const e of t.inputs){if(!n.has(e.name))throw new MI(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new MI(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class MI extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const FI=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),BI=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),zI=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function LI(e){return FI.has(e.op)}function PI(e){return BI.has(e.op)}function VI(e){return zI.has(e.op)}class WI{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new WI(e.functions[t],this)}))}getCompilationKey(e,t){const n=e.map((e=>e.name)).sort(),s=t.map((e=>e.name)).sort();return n.join(this.SEPARATOR)+"--"+s.join(this.SEPARATOR)}compile(e,t){const n=RI(e,t,this.weightMap,this._initNodes),{missingInputs:s,dynamicNode:r,syncInputs:i}=n;if(null!=r)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${i}]`);if(s.length>0){const n=t.map((e=>e.name)),r=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${r}]. Missing the following inputs: [${s}]`)}const a=DI(this.graph,n),o=function(e){const t=new Map(e.map(((e,t)=>[e.name,t]))),n=Number.MAX_SAFE_INTEGER,s=e.map(((e,t)=>LI(e)?n:t)),r=e=>{const n=s[t.get(e.name)];return null==n?-1:n},i=e.map(((e,t)=>e.children.map(r).reduce(((e,t)=>Math.max(e,t)),s[t]))),a=new Map;for(let t=0;tthis.cloneAndKeepTensor(e)));return t}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.cloneTensorList(t)])))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const s=n.map((e=>this.graph.nodes[BE(e)[0]])),r=t.map((e=>BE(e)[0])),i=new Set(r);let a=r.map((e=>this.graph.nodes[e]));0===a.length&&(a=this._outputs);const o=this.getCompilationKey(s,a);let l=this.compiledMap.get(o);null==l&&(l=this.compile(e,a),this.compiledMap.set(o,l));try{this.keepIntermediateTensors=ca().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const u={},c={};return oh((()=>{const n=new OI(this.weightMap,u,c,this.functionExecutorMap,this.parseNodeNameCache),s=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,i]=BE(t,n),a=[];a[i]=e[t],s[r]=a,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(a))}));const r=this.getFrozenTensorIds(s),{orderedNodes:a,nodeLiveUntilMap:o}=l;for(const e of a){if(s[e.name])continue;const t=NI(e,s,n,this._resourceManager);if(aa(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);s[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,s,n,r,i,o.get(e.name))}return null==this.parent&&n.dispose(r),t.map((e=>RE(e,s,n)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,n,s,r,i,a){if(!LI(t)&&!i.has(e)){for(const s of n[e])null!=s&&(a[s.id]=(a[s.id]||0)+t.children.length);for(const e of t.inputs){if(LI(e))continue;const t=DE(e.name,n,s);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=a[e.id];1===t?(e.dispose(),delete a[e.id]):null!=t&&a[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,s,r,i){function a(e){return LI(e)||r.has(e.name)}if(!LI(e)&&null!=i)for(const e of i){if(a(e))continue;const r=DE(e.name,t,n);for(const e of r)!e||e.kept||s.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,s={},r={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=ca().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const i=new OI(this.weightMap,s,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const a=await this.executeWithControlFlow(e,i,t,n),o=t.map((e=>RE(e,a,i))),l=o.map((e=>e.id)),u=Object.keys(e).map((t=>e[t].id)),c=new Set([...l,...u,...this.weightIds]);return Object.values(a).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||c.has(e.id)||e.dispose()}))})),null==this.parent&&i.dispose(c),o}async executeFunctionAsync(e,t,n){const s=e.reduce(((e,t,n)=>(e[this.inputs[n].name]=t,e)),{});return this._executeAsync(s,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,s){const r=Object.keys(e),i=r.map((e=>this.graph.nodes[BE(e)[0]])),a=n.map((e=>BE(e)[0])),o=new Set(a);let l=a.map((e=>this.graph.nodes[e]));0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:h,syncInputs:d}=RI(e,l,this.weightMap,this._initNodes),p=[...i,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),f=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,s]=BE(t),r=[];r[s]=e[t],f[n]=r}));const m={},g=this.getFrozenTensorIds(f),y={};for(;p.length>0;){const e=this.processStack(i,p,t,f,y,g,o,m,u);await Promise.all(e)}const b=l.filter((e=>!LI(e)&&!RE(e.name,f,t))).map((e=>e.name));if(b.length>0){let e="";throw null!=h&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${b}] from the provided inputs [${r}]. Consider providing the following inputs: [${c}]. ${e}`)}return f}processStack(e,t,n,s,r,i,a,o,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&OE("isConstant",e.node,s,n)&&([c]=ME(e.node.name,n)),null==s[e.node.name]){const h=NI(e.node,s,n,this._resourceManager);c||([c]=ME(e.node.name,n));const d=n.currentContext;aa(h)?u.push(h.then((u=>(s[c]=u,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(u)),n.currentContext=d,this.checkTensorForDisposal(c,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l),u)))):(s[c]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(h)),this.checkTensorForDisposal(c,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l))}else this.processChildNodes(e.node,t,n,s,r,l)}return u}processChildNodes(e,t,n,s,r,i){e.children.forEach((e=>{const[a]=ME(e.name,n);!r[a]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!RE(e,s,n)))&&(r[a]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!RE(e,s,n)))&&(r[a]=!0,t.push({contexts:n.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const n=e[t],[s]=BE(t),r=this.graph.nodes[s];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value;Ni(e.length===n.shape.length&&n.shape.every(((t,n)=>-1===e[n]||e[n]===t)),(()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`))}r.attrParams.dtype&&r.attrParams.dtype.value&&Ni(n.dtype===r.attrParams.dtype.value,(()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(e){var t,n;const s={};for(const r in e){const i=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=i?s[i.name]=e[r]:s[r]=e[r]}return s}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=BE(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>{var t,n;const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=s?s.name:e}),{})}checkOutputs(e){e.forEach((e=>{const[t]=BE(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class GI{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}const UI="?tfjs-format=file",qI="model.json";class jI{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(t,n={},s=e){this.modelUrl=t,this.loadOptions=n,this.version="n/a",this.io=s,null==n&&(this.loadOptions={}),this.resourceManager=new GI}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return aa(e)?e.then((e=>null==e.getWeightStream?this.loadSync(e):this.loadStreaming(e))):this.loadSync(e)}loadSync(e){const t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(null==e.getWeightStream)throw new Error("Model artifacts missing streamWeights function");const t=await wh(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const n=this.artifacts.modelTopology;let s=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(s=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}if(this.signature=s,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new WI(rI.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=rI.Instance.transformGraph(e.modelInitializer);this.initializer=new WI(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t={};return(e instanceof vc?[e]:e).forEach(((e,n)=>t[this.structuredOutputKeys[n]]=e)),t}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof vc||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const s=n[t];null!=s.resourceId&&(e[t]=this.resourceIdToCapturedInput[s.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let s=0;return this.inputNodes.reduce(((t,n)=>{var r,i,a;const o=null===(a=null===(i=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===i?void 0:i[n])||void 0===a?void 0:a.resourceId;return t[n]=null!=o?this.resourceIdToCapturedInput[o]:e[s++],t}),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let s=0;s1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,n)=>(t[n]=[e[n]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&lh(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function HI(t,n={},s=e){if(null==t)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==n&&(n={}),n.fromTFHub&&"string"==typeof t&&(t=function(e){e.endsWith("/")||(e+="/");return`${e}${qI}${UI}`}(t));const r=new jI(t,n,s);return await r.load(),r}function $I(e,t,n=new Map,s=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(s.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse){if(YI(e)){const r=Array.isArray(e)?[]:{};s.add(e);for(const i in e){const a=$I(e[i],t,n,s);r[i]=a}return s.delete(e),e.__proto__&&(r.__proto__=e.__proto__),r}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return n.set(e,r.value),r.value}function KI(e,t=ZI){return XI(e,t)}function XI(e,t,n=new Set){const s=e[0];if(n.has(s))throw new Error("Circular references are not supported.");const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse){if(YI(s)){const r=Array.isArray(s)?[]:{};n.add(s);for(const i in s){const s=XI(e.map((e=>e[i])),t,n);r[i]=s}return n.delete(s),r}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return r.value}function ZI(e){return null===e?null:YI(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function YI(e){let t=!1;if(ca().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(7695);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof vc)&&!(e instanceof Promise)&&!t)}function QI(e){return function(e,t){return $I(e,t)}(e,JI)}function JI(e){return e instanceof vc?{value:e.clone(),recurse:!1}:YI(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class eT{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}}class tT extends eT{constructor(){super(tT.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){const e=2*this.capacity,t=new Array(e),n=this.length();for(let e=0;e!0===e))}rowMajorBatch(e,t=!0){return new cT(this,e,t)}columnMajorBatch(e,t=!0,n=ZI){return this.rowMajorBatch(e,t).map((e=>KI(e,n)))}concatenate(e,t){return new yT(new iT([this,e]),t)}take(e){return e<0||null==e?this:new uT(this,e)}skip(e){return e<0||null==e?this:new lT(this,e)}prefetch(e){return new wT(this,e)}shuffle(e,t){return new vT(this,e,t)}serial(){return new oT(this)}}class iT extends rT{constructor(e){super(),this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const e=this.items[this.trav];return this.trav++,{value:QI(e),done:!1}}}class aT extends rT{constructor(e){super(),this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}}class oT extends rT{constructor(e){super(),this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){return this.upstream.next()}}class lT extends rT{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class cT extends rT{constructor(e,t,n=!0){super(),this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){const e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class hT extends rT{constructor(e,t){super(),this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;lh(e.value)}}}class dT extends rT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Fc(e.value),n=this.transform(e.value),s=Fc(n);for(const e of t)Mc(e,s)||e.dispose();return{value:n,done:!1}}}class pT extends rT{constructor(e,t){super(),this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}}class fT extends rT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Fc(e.value),n=await this.transform(e.value),s=Fc(n);for(const e of t)Mc(e,s)||e.dispose();return{value:n,done:!1}}}class mT extends rT{constructor(){super(),this.outputQueue=new tT,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class gT extends mT{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=Fc(e.value),n=this.transform(e.value),s=Fc(n);this.outputQueue.pushAll(n);for(const e of t)Mc(e,s)||e.dispose();return!0}}class yT extends rT{constructor(e,t){super(),this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}var bT;!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(bT||(bT={}));class wT extends rT{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new eT(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class vT extends wT{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Og.alea(n||ec().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}}class AT{constructor(){this.size=null}batch(e,t=!0){const n=this;let s;return Ni(e>0,(()=>`batchSize needs to be positive, but it is\n ${e}`)),s=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),xT((async()=>(await n.iterator()).columnMajorBatch(e,t,CT)),s)}concatenate(e){const t=this;let n;return n=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,xT((async()=>(await t.iterator()).concatenate(await e.iterator())),n)}filter(e){const t=this;let n;return n=this.size===1/0?1/0:null,xT((async()=>(await t.iterator()).filter((t=>oh((()=>e(t)))))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return xT((async()=>(await t.iterator()).map((t=>oh((()=>e(t)))))),this.size)}mapAsync(e){const t=this;return xT((async()=>(await t.iterator()).mapAsync(e)),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return xT((async()=>(await t.iterator()).prefetch(e)),this.size)}repeat(e){const t=this;let n;return n=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,xT((async()=>sT(nT((async()=>({value:await t.iterator(),done:!1}))).take(e))),n)}skip(e){const t=this;let n;return n=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size(await t.iterator()).skip(e)),n)}shuffle(e,t,n=!0){if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const s=this,r=Og.alea(t||ec().toString());return xT((async()=>{let t=r.int32();return n&&(t+=r.int32()),(await s.iterator()).shuffle(e,t.toString())}),this.size)}take(e){const t=this;let n;return n=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,xT((async()=>(await t.iterator()).take(e)),n)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function xT(e,t=null){return new class extends AT{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function CT(e){if(null===e)return null;const t=e[0];if(null==(n=t)||null===(s=n)||"object"!=typeof s&&"function"!=typeof s||Array.isArray(n)||"object"==typeof n&&n instanceof vc||sc(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof vc?gy(e):nh(e)}(e),recurse:!1}}var n,s;return{value:null,recurse:!0}}AT.MAX_BUFFER_SIZE=1e4;Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote");function kT(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&Ni("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const ST=By;class _T extends ki{nextDataId(){return _T.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new Ci(this,ih())}write(e,t,n){this.firstUse&&(this.firstUse=!1,ca().get("IS_NODE")&&Eu());const s={id:this.nextDataId()};return this.data.set(s,{values:e,dtype:n,refCount:1}),s}makeTensorInfo(e,t,n){let s;if("string"===t&&null!=n&&n.length>0&&Hi(n[0])){const r=n.map((e=>tc(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return{dataId:s,shape:e,dtype:t}}refCount(e){if(this.data.has(e)){return this.data.get(e).refCount}return 0}incRef(e){this.data.get(e).refCount++}decRef(e){if(this.data.has(e)){this.data.get(e).refCount--}}move(e,t,n,s,r){this.data.set(e,{values:t,dtype:s,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);if("complex64"===t){return Fw(this.readSync(n.real.dataId),this.readSync(n.imag.dataId))}return function(e,t){if(Array.isArray(e))return e;if("float32"===t)return e instanceof Float32Array?e:new Float32Array(e);if("int32"===t)return e instanceof Int32Array?e:new Int32Array(e);if("bool"===t||"string"===t)return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}(this.data.get(e).values,t)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>nc(e)));return fd(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return fd(e.shape,e.dtype,t)}makeOutput(e,t,n){return ih().makeTensorFromTensorInfo(this.makeTensorInfo(t,n,e),this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=ec();e();return{kernelMs:ec()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){kT([e],"where");const t=this.readSync(e.dataId);return ST(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}_T.nextDataId=0;function ET(e){return(t,n,s)=>{const r=Ui(n,t.length);for(let n=0;n{const{x:a}=s;kT(a,e);const o=i,l=o.data.get(a.dataId).values;let u;if("string"===a.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=mv(l)}else u=l;const c=n||a.dtype,h=t(u,c,r);return o.makeTensorInfo(a.shape,c,h)}}ch("cpu",(()=>new _T),1);const NT=IT(fo,(e=>e>=0?e:Math.exp(e)-1)),OT={kernelName:fo,backendName:"cpu",kernelFunc:NT};function RT(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const DT={kernelName:Oo,backendName:"cpu",kernelFunc:RT};function MT(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s;kT([r],"leakyRelu");const a=Di(r.shape),o=n.data.get(r.dataId).values,l=Gi("float32",a);for(let e=0;e{const a=Gd(t,n),o=a.length,l=Yi(a),u=Gi(i,Di(a)),c=t.length,h=n.length,d=Yi(t),p=Yi(n),f=Vd(t,a),m=Vd(n,a);if(f.length+m.length===0)for(let t=0;ti[e]=0));const a=ra(i,c,d),g=n.slice(-h);m.forEach((e=>g[e]=0));const y=ra(g,h,p);u[t]=e(s[a],r[y])}return[u,a]}}const zT=BT(((e,t)=>e<0?t*e:e));function LT(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t;kT([s,r],"prelu");const i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,[o,l]=zT(s.shape,r.shape,i,a,"float32");return n.makeTensorInfo(l,"float32",o)}const PT={kernelName:bl,backendName:"cpu",kernelFunc:LT},VT=IT(_l,(e=>Math.max(0,e))),WT={kernelName:_l,backendName:"cpu",kernelFunc:VT},GT=IT(Rl,(e=>Math.min(Math.max(0,e),6))),UT={kernelName:Rl,backendName:"cpu",kernelFunc:GT},qT=ET((e=>1/(1+Math.exp(-e)))),jT=IT(jl,(e=>1/(1+Math.exp(-e)))),HT={kernelName:jl,backendName:"cpu",kernelFunc:jT};function $T(e,t,n,s,r){if("linear"===n)return RT({inputs:{x:t},backend:e});if("relu"===n)return VT({inputs:{x:t},backend:e});if("elu"===n)return NT({inputs:{x:t},backend:e});if("relu6"===n)return GT({inputs:{x:t},backend:e});if("prelu"===n)return LT({inputs:{x:t,alpha:s},backend:e});if("leakyrelu"===n)return MT({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return jT({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function KT(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,o=n.makeTensorInfo(s.shape,"complex64");return n.data.get(o.dataId).complexTensorInfos={real:n.makeTensorInfo(s.shape,"float32",i),imag:n.makeTensorInfo(r.shape,"float32",a)},o}const XT={kernelName:Wa,backendName:"cpu",kernelFunc:KT};function ZT(e,t,n="float32"){if("complex64"===n){return KT({inputs:{real:ZT(e,t,"float32"),imag:ZT(e,t,"float32")},backend:e})}const s=ta(Di(t),n);return e.makeTensorInfo(t,n,s)}function YT(e){const{inputs:t,backend:n}=e,{input:s}=t,r=n.data.get(s.dataId).complexTensorInfos.real,i=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,i)}const QT={kernelName:kl,backendName:"cpu",kernelFunc:YT};function JT(e,t,n,s){if("int32"===s){return[t,"int32",Int32Array.from(e)]}if("bool"===s){const s=Ju([0],n),[r,i]=BT(((e,t)=>e!==t?1:0))(t,[],e,s,"bool");return[i,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${s}`)}function eN(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dtype:i}=s;if("complex64"===i){if("complex64"===r.dtype)return RT({inputs:{x:r},backend:n});const e=ZT(n,r.shape,r.dtype),t=eN({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),s=KT({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),s}if("complex64"===r.dtype){const e=YT({inputs:{input:r},backend:n}),t=eN({inputs:{x:e},backend:n,attrs:{dtype:i}});return n.disposeIntermediateTensorInfo(e),t}if(!qi(r.dtype,i)){const e=RT({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:i}}const a=n.data.get(r.dataId).values,[o,l,u]=JT(a,r.shape,r.dtype,i);return n.makeTensorInfo(o,l,u)}const tN={kernelName:La,backendName:"cpu",kernelFunc:eN};function nN(e,t,n,s){return null==n?({inputs:n,backend:r})=>{const{a:i,b:a}=n,o=r;kT([i,a],e);const l=o.data.get(i.dataId).values,u=o.data.get(a.dataId).values,c="string"===i.dtype?mv(l):l,h="string"===i.dtype?mv(u):u,d=s||i.dtype,[p,f]=t(i.shape,a.shape,c,h,d);return o.makeTensorInfo(f,d,p)}:({inputs:e,backend:r})=>{const{a:i,b:a}=e,o=r;if("complex64"===i.dtype||"complex64"===a.dtype){const e=eN({inputs:{x:i},backend:o,attrs:{dtype:"complex64"}}),t=o.data.get(e.dataId),s=t.complexTensorInfos.real,r=t.complexTensorInfos.imag,l=o.data.get(s.dataId).values,u=o.data.get(r.dataId).values,c=eN({inputs:{x:a},backend:o,attrs:{dtype:"complex64"}}),h=o.data.get(c.dataId),d=h.complexTensorInfos.real,p=h.complexTensorInfos.imag,f=o.data.get(d.dataId).values,m=o.data.get(p.dataId).values,[g,y,b]=n(i.shape,a.shape,l,u,f,m),w=o.makeTensorInfo(b,"float32",g),v=o.makeTensorInfo(b,"float32",y),A=KT({inputs:{real:w,imag:v},backend:o});return o.disposeIntermediateTensorInfo(e),o.disposeIntermediateTensorInfo(c),o.disposeIntermediateTensorInfo(w),o.disposeIntermediateTensorInfo(v),A}{const e=o.data.get(i.dataId).values,n=o.data.get(a.dataId).values,r=s||i.dtype,[l,u]=t(i.shape,a.shape,e,n,r);return o.makeTensorInfo(u,r,l)}}}function sN(e){return(t,n,s,r,i,a)=>{const o=Gd(t,n),l=Di(o),u=o.length,c=Yi(o),h=Gi("float32",l),d=Gi("float32",l),p=Vd(t,o),f=Vd(n,o),m=Fw(s,r),g=Fw(i,a),y=t.length,b=Yi(t),w=n.length,v=Yi(n);if(p.length+f.length===0)for(let t=0;ts[e]=0));const r=ra(s,y,b),i=n.slice(-w);f.forEach((e=>i[e]=0));const a=ra(i,w,v),o=e(m[2*r],m[2*r+1],g[2*a],g[2*a+1]);h[t]=o.real,d[t]=o.imag}return[h,d,o]}}const rN=BT(((e,t)=>e+t)),iN=sN(((e,t,n,s)=>({real:e+n,imag:t+s}))),aN=nN(ba,rN,iN),oN={kernelName:ba,backendName:"cpu",kernelFunc:aN};function lN(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{shape:i}=s,a=Di(r.shape),o=Pi(i,a),l=Di(o);Ni(a===l,(()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`)),n.incRef(r.dataId);const u=n.data.get(r.dataId);if(null!=u.complexTensorInfos){const e=u.complexTensorInfos.real,t=u.complexTensorInfos.imag;e.shape=o,t.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}const uN={kernelName:El,backendName:"cpu",kernelFunc:lN};function cN(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;kT([r,i],"matMul");const l=r.shape.length,u=i.shape.length,c=a?r.shape[l-2]:r.shape[l-1],h=o?i.shape[u-1]:i.shape[u-2],d=a?r.shape[l-1]:r.shape[l-2],p=o?i.shape[u-2]:i.shape[u-1],f=r.shape.slice(0,-2),m=i.shape.slice(0,-2),g=Di(f),y=Di(m),b=Gd(r.shape.slice(0,-2),i.shape.slice(0,-2)).concat([d,p]);Ni(c===h,(()=>`Error in matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${r.shape} and ${i.shape} and transposeA=${a} and transposeB=${o} must match.`));const w=o?[y,p,h]:[y,h,p],v=lN({inputs:{x:r},backend:n,attrs:{shape:a?[g,c,d]:[g,d,c]}}),A=lN({inputs:{x:i},backend:n,attrs:{shape:w}}),x=a?v.shape[1]:v.shape[2],C=a?v.shape[2]:v.shape[1],k=o?A.shape[1]:A.shape[2],S=Math.max(g,y),_=n.data.get(v.dataId).values,E=n.data.get(A.dataId).values,I=Yi(v.shape),T=Yi(A.shape),[N,O,R]=a?[I[0],1,I[1]]:[I[0],I[1],1],[D,M,F]=o?[1,T[1],T[0]]:[T[1],1,T[0]],B=C*k,z=fd([S,C,k],v.dtype),L=z.values,P=n.blockSize;for(let e=0;e{const{x:t}=e.inputs,n=e.backend;kT(t,"abs");let s=new Float32Array(Di(t.shape));return s=pN(n.data.get(t.dataId).values),n.makeOutput(s,t.shape,t.dtype)}},mN=IT(ga,(e=>Math.acos(e))),gN={kernelName:ga,backendName:"cpu",kernelFunc:mN},yN=IT(ya,(e=>Math.acosh(e))),bN={kernelName:ya,backendName:"cpu",kernelFunc:yN};const wN={kernelName:wa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,s=t;kT(t,"addN");const r=s.map((e=>n.data.get(e.dataId).values)),i=fd(s[0].shape,s[0].dtype),a=i.values;for(let e=0;en&&(n=r,s=e)}d[e]=s}return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}};const _N={kernelName:Ca,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;kT(r,"argMin");let a=Vi(i,r.shape);const o=fm(a,r.shape.length);let l=r;const u=[];null!=o&&(l=AN({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),a=gm(a.length,l.shape.length)),a=[a[0]],pm("argMin",a,l.shape.length);const[c,h]=hm(l.shape,a),d=ta(Di(c),"int32"),p=Di(h),f=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}},EN=IT(ka,(e=>Math.asin(e))),IN={kernelName:ka,backendName:"cpu",kernelFunc:EN},TN=IT(Sa,(e=>Math.asinh(e))),NN={kernelName:Sa,backendName:"cpu",kernelFunc:TN},ON=IT(_a,(e=>Math.atan(e))),RN={kernelName:_a,backendName:"cpu",kernelFunc:ON},DN=BT(((e,t)=>Math.atan2(e,t))),MN=nN(Ia,DN),FN={kernelName:Ia,backendName:"cpu",kernelFunc:MN},BN=IT(Ea,(e=>Math.atanh(e))),zN={kernelName:Ea,backendName:"cpu",kernelFunc:BN};function LN(e,t,n,s,r,i){const a=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,h=r.effectiveFilterWidth,d=r.padInfo.top,p=r.padInfo.left,f="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=fd(r.outShape,n),g=m.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],b=r.outShape[2]*r.outShape[3],w=r.outShape[3];for(let t=0;ty?y=a:"avg"===i&&(b+=a,v++)}if(isNaN(y))break}g[C+n*w+t]="avg"===i?b/v:y}}}return m}function PN(e,t,n,s,r=!1,i=!1){const a=fd(s.outShape,"int32"),o=s.strideHeight,l=s.strideWidth,u=s.dilationHeight,c=s.dilationWidth,h=s.effectiveFilterHeight,d=s.effectiveFilterWidth,p=s.padInfo.top,f=s.padInfo.left,m=fd(t,n,e);for(let e=0;ev&&(v=u,A=r?i?((e*s.inHeight+n)*s.inWidth+o)*s.inChannels+t:(n*s.inWidth+o)*s.inChannels+t:a*d+l)}}a.set(A,e,n,o,t)}}return a}function VN(e,t,n,s,r,i){const a=r.strideDepth,o=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,c=r.dilationHeight,h=r.dilationWidth,d=r.effectiveFilterDepth,p=r.effectiveFilterHeight,f=r.effectiveFilterWidth,m=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,b="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=fd(r.outShape,n),v=w.values,A=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],x=r.outShape[2]*r.outShape[3]*r.outShape[4],C=r.outShape[3]*r.outShape[4],k=r.outShape[4];for(let t=0;tx?x=r:"avg"===i&&(C+=r,S++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}v[g+t]="avg"===i?C/Math.max(S,1):x}}}}return w}const WN={kernelName:Ta,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;kT(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;Ni(hf(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))c=RT({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=Yi(r.shape),s=LN(e,r.shape,r.dtype,t,u,"avg");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const GN={kernelName:Oa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:u}=s;kT(r,"avgPool3d");const c=tf(r.shape,i,a,1,o,l,u),h=VN(n.data.get(r.dataId).values,r.shape,r.dtype,Yi(r.shape),c,"avg");return n.makeTensorInfo(h.shape,"float32",h.values)}};const UN={kernelName:Ra,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:u}=s;kT([r,i],"avgPool3DGrad");const c=tf(i.shape,a,o,1,l,u),h=c.strideDepth,d=c.strideHeight,p=c.strideWidth,f=c.filterDepth,m=c.filterHeight,g=c.filterWidth,y=c.dilationDepth,b=c.dilationHeight,w=c.dilationWidth,v=c.effectiveFilterDepth,A=c.effectiveFilterHeight,x=c.effectiveFilterWidth,C=v-1-c.padInfo.front,k=x-1-c.padInfo.left,S=A-1-c.padInfo.top,_=fd(i.shape,"float32"),E=1/(f*m*g),I=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let n=0;n=c.outHeight||Math.floor(r)!==r))for(let n=0;n=c.outWidth||Math.floor(i)!==i)continue;l+=I.get(e,s,r,i,t)}}}_.set(l*E,e,n,s,r,t)}return n.makeTensorInfo(_.shape,_.dtype,_.values)}};const qN={kernelName:Na,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;kT([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=ef(a.shape,o,l,1,u),h=c.strideHeight,d=c.strideWidth,p=c.filterHeight,f=c.filterWidth,m=c.dilationHeight,g=c.dilationWidth,y=c.effectiveFilterHeight,b=c.effectiveFilterWidth,w=b-1-c.padInfo.left,v=y-1-c.padInfo.top,A=fd(a.shape,"float32"),x=1/(p*f),C=n.data.get(r.dataId).values,k=fd(r.shape,"float32",C);for(let e=0;e=c.outHeight||Math.floor(s)!==s))for(let n=0;n=c.outWidth||Math.floor(r)!==r)continue;a+=k.get(e,s,r,t)}}A.set(a*x,e,n,s,t)}return n.makeTensorInfo(A.shape,A.dtype,A.values)}};const jN={kernelName:_o,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,scale:i,offset:a,mean:o,variance:l}=t;Ni(o.shape.length===l.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),Ni(null==a||o.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),Ni(null==i||o.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),kT([r,o,l,i,a],"batchNorm");let{varianceEpsilon:u}=s;null==u&&(u=.001);const c=n.data.get(r.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=i?n.data.get(i.dataId).values:new Float32Array([1]),f=a?n.data.get(a.dataId).values:new Float32Array([0]),m=new Float32Array(c.length),g=f.length,y=p.length,b=d.length,w=h.length;let v=0,A=0,x=0,C=0;for(let e=0;e=g&&(v=0),A>=w&&(A=0),x>=y&&(x=0),C>=b&&(C=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};function HN(e,t,n,s,r){const i=Bp(s,t,n),a=Di(n),o=Yi(s);if(i){const n=zp(t,o);return"string"===r?e.slice(n,n+a):e.subarray(n,n+a)}const l=fd(s,r,"string"===r?mv(e):e),u=fd(n,r);for(let e=0;ee+t[n]));u.set(l.get(...s),...n)}return"string"===r?gv(u.values):u.values}function $N(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s;kT(r,"slice");const[o,l]=Lp(r,i,a);kp(r,o,l);const u=HN(n.data.get(r.dataId).values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const KN={kernelName:Wl,backendName:"cpu",kernelFunc:$N};const XN={kernelName:Ma,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;kT([r],"batchToSpaceND");const o=i.reduce(((e,t)=>e*t)),l=Aw(r.shape,i,o),u=xw(l.length,i.length),c=Cw(r.shape,i,o),h=kw(a,i.length),d=Sw(c,a,i.length),p=lN({inputs:{x:r},backend:n,attrs:{shape:l}}),f=AN({inputs:{x:p},backend:n,attrs:{perm:u}}),m=lN({inputs:{x:f},backend:n,attrs:{shape:c}}),g=$N({inputs:{x:m},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};function ZN(e,t,n,s,r){const i=Di(s),a=ta(r,n);for(let n=0;n=r||(a[s]+=i>0?t[n]:1)}return a}function YN(e,t,n,s=!1){const r=e.shape[0],i=e.shape[1],a=fd([r,n],t.dtype);for(let o=0;o=n||(s?a.set(1,o,i):t.size>0?a.set(a.get(o,i)+t.get(o,r),o,i):a.set(a.get(o,i)+1,o,i))}return a}const QN={kernelName:Fa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=ZN(n.data.get(r.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,o)}},JN=BT(((e,t)=>e&t)),eO=nN(Ba,JN),tO={kernelName:Ba,backendName:"cpu",kernelFunc:eO};const nO={kernelName:za,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,o=Gd(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},sO=ET((e=>Math.ceil(e))),rO=TT(Pa,sO),iO={kernelName:Pa,backendName:"cpu",kernelFunc:rO},aO=IT(Va,((e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,s=new Float32Array(Di(t.shape)),r=n.data.get(t.dataId),i=r.complexTensorInfos.real,a=r.complexTensorInfos.imag,o=n.data.get(i.dataId).values,l=n.data.get(a.dataId).values;for(let e=0;e{const n=Di(e.shape);r.set(e.vals,t),t+=n}))}else{let s=0;e.forEach((e=>{const i="string"===n?mv(e.vals):e.vals;let a=0;for(let n=0;ne.shape)),i);let a=dw(t.map((e=>e.shape)),i);if(0===Di(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Di(e.shape)>0));if(1===o.length)return RT({inputs:{x:o[0]},backend:n});if("complex64"===o[0].dtype){const e=o.map((e=>YT({inputs:{input:e},backend:n}))),t=o.map((e=>cO({inputs:{input:e},backend:n}))),s=dO({inputs:e,backend:n,attrs:{axis:i}}),r=dO({inputs:t,backend:n,attrs:{axis:i}}),a=KT({inputs:{real:s,imag:r},backend:n});return e.forEach((e=>n.disposeIntermediateTensorInfo(e))),t.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(r),a}const l=o.map((e=>{const t=Di(e.shape.slice(i));return lN({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),u=l.map((e=>({vals:n.data.get(e.dataId).values,shape:e.shape})));a=dw(l.map((e=>e.shape)),1);const c=1===l[0].shape[0],h=uO(u,a,t[0].dtype,c),d=dw(o.map((e=>e.shape)),i),p=n.makeTensorInfo(d,t[0].dtype,h);return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}const pO={kernelName:Ua,backendName:"cpu",kernelFunc:dO};function fO(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s;kT([r,i],"conv2d");const h=pf(l),d=nf(r.shape,i.shape,a,u,o,c,!1,h),p=d.filterHeight,f=d.filterWidth,m=d.dilationHeight,g=d.dilationWidth,y=d.padInfo.left,b=d.padInfo.top,w="channelsLast"===d.dataFormat,v=new gc(d.outShape,r.dtype),A=Yi(r.shape),x=Yi(i.shape),C=A[0],k=w?A[1]:A[2],S=w?A[2]:1,_=w?1:A[1],E=v.strides[0],I=w?v.strides[1]:v.strides[2],T=w?v.strides[2]:1,N=w?1:v.strides[1],O=n.data.get(r.dataId).values,R=n.data.get(i.dataId).values,D=v.values;for(let e=0;e=d.inHeight)continue;const i=e*x[0],a=t+n*k;for(let e=0;e=d.inWidth)continue;const r=a+s*S;let o=i+e*x[1];for(let e=0;e=u.inDepth)continue;const i=e*S[0],a=t+n*k[1];for(let e=0;e=u.inHeight)continue;const r=i+e*S[1],o=a+s*k[2];for(let e=0;e=u.inWidth)continue;const i=r+e*S[2],a=o+t*u.inChannels;let l=i;for(let e=0;eMath.cos(e))),xO={kernelName:Za,backendName:"cpu",kernelFunc:AO},CO=IT(Ya,(e=>Math.cosh(e))),kO={kernelName:Ya,backendName:"cpu",kernelFunc:CO};const SO={kernelName:eo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:u}=s,[c,h,d,p]=r.shape,f=i.shape[0],[m,g]=o,y=fd([f,m,g,p],"float32"),b=n.data.get(i.dataId).values,w=n.data.get(a.dataId).values,v=n.data.get(r.dataId).values,A=Yi(r.shape),x=Yi(y.shape);for(let e=0;e=c)continue;const o=m>1?(r-n)*(h-1)/(m-1):0,f=g>1?(i-s)*(d-1)/(g-1):0;for(let t=0;t1?n*(h-1)+t*o:.5*(n+r)*(h-1);if(c<0||c>h-1)for(let n=0;n1?s*(d-1)+l*f:.5*(s+i)*(d-1);if(c<0||c>d-1){for(let n=0;n1?s*(d-1)+n*f:.5*(s+i)*(d-1);if(r<0||r>d-1){for(let s=0;se+f-t-1:(e,t)=>e+t;for(let e=0;ee+f-t-1:(e,t)=>e+t;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`));const o=r.shape[0],l=r.shape[1],u=r.shape[2],c=r.shape[3],h=l*i,d=u*i,p=c/(i*i),f=n.data.get(r.dataId).values,m=new Float32Array(o*h*d*p);let g=0;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${d}'`));const p=nf(r.shape,i.shape,a,d,o,u,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:b}=p,w=b.left,v=b.top,A=p.outChannels/p.inChannels,x=new gc(p.outShape,r.dtype),C=n.data.get(r.dataId).values,k=n.data.get(i.dataId).values,S=x.values;for(let e=0;e=p.inHeight)continue;const i=e*h[0],a=t+n*c[1];for(let e=0;e=p.inWidth)continue;const r=i+e*h[1],o=a+s*p.inChannels;let l=t,u=r;for(let e=0;e{const{x:s,filter:r}=e,{strides:i,pad:a,dilations:o}=n,l=t,u=l.data.get(s.dataId).values,c=s.shape.length,h=l.data.get(r.dataId).values,d=r.shape.length,{batchSize:p,inHeight:f,inWidth:m,inChannels:g,outHeight:y,outWidth:b,padInfo:w,strideHeight:v,strideWidth:A,filterHeight:x,filterWidth:C,dilationHeight:k,dilationWidth:S,outShape:_}=Jp(s.shape,r.shape,i,a,"NHWC",o),E=Di(_),I=_.length,T=Ui(s.dtype,E);for(let e=0;e=0&&i=0&&pl&&(l=m)}}}T[ra([e,t,i,o],I,Yi(_))]=l}}}return{dataId:l.write(Ju(T,s.dtype),_,s.dtype),shape:_,dtype:s.dtype}}},BO={kernelName:uo,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,u=t,c=Ji(s.shape,u.data.get(s.dataId).values),h=Ji(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=Jp(s.shape,r.shape,a,o,"NHWC",l);Ni(i.rank===S.length,(()=>`Error in ${uo}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const _=Ji(S,u.data.get(i.dataId).values),E=na(r.shape,r.dtype);for(let e=0;e=0&&s=0&&ua&&(a=r,o=t,l=n)}}}E[o][l][i]+=_[e][t][s][i]}}}return{dataId:u.write(Ju(E,s.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},zO={kernelName:lo,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,u=t,c=Ji(s.shape,u.data.get(s.dataId).values),h=Ji(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=Jp(s.shape,r.shape,a,o,"NHWC",l);Ni(i.rank===S.length,(()=>`Error in ${lo}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const _=Ji(S,u.data.get(i.dataId).values),E=na(s.shape,s.dtype);for(let e=0;e=0&&s=0&&ua&&(a=r,o=s,l=u)}}}E[e][o][l][i]+=_[e][t][s][i]}}}return{dataId:u.write(Ju(E,s.dtype),s.shape,s.dtype),shape:s.shape,dtype:s.dtype}}};const LO={kernelName:co,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r}=t,{canvas:i,options:a}=s,{contextOptions:o,imageOptions:l}=a||{},u=(null==l?void 0:l.alpha)||1,c=(null==o?void 0:o.contextType)||"2d";if("2d"!==c)throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);const h=i.getContext(c,(null==o?void 0:o.contextAttributes)||{});if(null==h)throw new Error(`Could not get the context with ${c} type.`);const[d,p]=r.shape.slice(0,2),f=2===r.shape.length?1:r.shape[2],m=n.data.get(r.dataId).values,g="float32"===r.dtype?255:1,y=new Uint8ClampedArray(p*d*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${s}.`)}else if("int32"===r.dtype&&(s<0||s>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${s}.`);1===f?(t[0]=s*g,t[1]=s*g,t[2]=s*g):t[n]=s*g}const n=4*e;y[n+0]=Math.round(t[0]),y[n+1]=Math.round(t[1]),y[n+2]=Math.round(t[2]),y[n+3]=Math.round(t[3])}i.width=p,i.height=d;const b=new ImageData(y,p,d);return h.putImageData(b,0,0),r}},PO=BT(((e,t)=>e*t)),VO=sN(((e,t,n,s)=>({real:e*n-t*s,imag:e*s+t*n}))),WO=nN(ol,PO,VO),GO={kernelName:ol,backendName:"cpu",kernelFunc:WO};function UO(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;let o;kT(r,"sum"),o="bool"===r.dtype?eN({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):RT({inputs:{x:r},backend:n});const l=o.shape.length,u=Vi(i,o.shape),c=fm(u,l);let h=u,d=o;null!=c&&(d=AN({inputs:{x:o},backend:n,attrs:{perm:c}}),h=gm(h.length,l)),pm("sum",h,d.shape.length);const[p,f]=hm(d.shape,h);let m=ZT(n,p,Tc(d.dtype,"int32"));const g=Di(f),y=n.data.get(m.dataId).values,b=n.data.get(d.dataId).values;for(let e=0;e=0&&(d=UO({inputs:{x:d},backend:n,attrs:{axis:u[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}};const HO={kernelName:mo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:s,y:r}=t;kT([s,r],"eluGrad");const i=new Float32Array(Di(r.shape)),a=n.data.get(r.dataId).values,o=n.data.get(s.dataId).values;for(let e=0;e=0?o[e]:o[e]*(t+1)}return n.makeTensorInfo(r.shape,"float32",i)}},$O=BT(((e,t)=>e===t?1:0)),KO=nN(yo,$O,null,"bool"),XO={kernelName:yo,backendName:"cpu",kernelFunc:KO},ZO=Tw,YO=Nw,QO=Ow,JO=Rw,eR=Dw,tR=Mw,nR=IT(go,(e=>{const t=Math.sign(e),n=Math.abs(e),s=1/(1+ZO*n);return t*(1-((((tR*s+eR)*s+JO)*s+QO)*s+YO)*s*Math.exp(-n*n))})),sR={kernelName:go,backendName:"cpu",kernelFunc:nR},rR=ET((e=>Math.exp(e))),iR=TT(bo,rR,"float32"),aR={kernelName:bo,backendName:"cpu",kernelFunc:iR};function oR(e){const{inputs:t,backend:n,attrs:s}=e,{input:r}=t,{dim:i}=s,a=r.shape.length,o=r.shape.slice();let l=i;return i<0&&(Ni(-(a+1)<=i,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+i+1),o.splice(l,0,1),lN({inputs:{x:r},backend:n,attrs:{shape:o}})}const lR={kernelName:wo,backendName:"cpu",kernelFunc:oR},uR=ET((e=>Math.expm1(e))),cR=TT(vo,uR),hR={kernelName:vo,backendName:"cpu",kernelFunc:cR},dR=BT(((e,t)=>e/t)),pR=nN(ho,dR),fR={kernelName:ho,backendName:"cpu",kernelFunc:pR},mR=BT(((e,t)=>e-t)),gR=sN(((e,t,n,s)=>({real:e-n,imag:t-s}))),yR=nN(cu,mR,gR),bR={kernelName:cu,backendName:"cpu",kernelFunc:yR};function wR(e,t,n){const s=e.shape,r=s[0],i=s[1],a=n.data.get(e.dataId),o=a.complexTensorInfos.real,l=a.complexTensorInfos.imag,u=[r,i],c=Di(u),h=Gi("float32",c),d=Gi("float32",c);for(let e=0;e{const{image:s}=e,r=n,i=Gi(s.dtype,Di(s.shape)),[a,o,l,u]=s.shape,c=r.data.get(s.dataId).values;for(let e=0;e=0&&aMath.floor(e))),ER=TT(ko,_R),IR={kernelName:ko,backendName:"cpu",kernelFunc:ER},TR=BT(((e,t)=>Math.floor(e/t))),NR=nN(So,TR,null,"int32"),OR={kernelName:So,backendName:"cpu",kernelFunc:NR};const RR={kernelName:Su,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=fO({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(a){const e=m;if("NCHW"===c&&1===a.shape.length&&1!==a.shape[0]){const e=lN({inputs:{x:a},backend:n,attrs:{shape:[a.shape[0],1,1]}});m=aN({inputs:{a:m,b:e},backend:n}),n.disposeIntermediateTensorInfo(e)}else m=aN({inputs:{a:m,b:a},backend:n});n.disposeIntermediateTensorInfo(e)}if(p){const e=m;if("NCHW"===c&&"prelu"===p&&1===o.shape.length&&1!==o.shape[0]){const e=lN({inputs:{x:o},backend:n,attrs:{shape:[o.shape[0],1,1]}});m=$T(n,m,p,e,f),n.disposeIntermediateTensorInfo(e)}else m=$T(n,m,p,o,f);n.disposeIntermediateTensorInfo(e)}return m}};const DR={kernelName:_u,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=NO({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(a){const e=m;m=aN({inputs:{a:m,b:a},backend:n}),n.disposeIntermediateTensorInfo(e)}if(p){const e=m;m=$T(n,m,p,o,f),n.disposeIntermediateTensorInfo(e)}return m}};function MR(e,t,n,s,r,i,a,o,l){const u=fd([s,i],n);for(let n=0;n=l/i)throw new Error(`Invalid indices: ${s} does not index into ${o}`);for(let e=0;e=0,(()=>`GatherV2: the index value ${t} is not in [0, ${c-1}]`))}let h=o;null==o&&(h=0);const d=Di(i.shape),p=fv(r,i,l,h),f=lN({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=lN({inputs:{x:i},backend:n,attrs:{shape:[p.batchSize,d/p.batchSize]}}),g=[p.batchSize,p.outerSize,d/p.batchSize,p.sliceSize],y=n.bufferSync(m),b=BR(n.bufferSync(f),y,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,b.dtype,b.values)}},LR=BT(((e,t)=>e>t?1:0)),PR=nN(To,LR,null,"bool"),VR={kernelName:To,backendName:"cpu",kernelFunc:PR},WR=BT(((e,t)=>e>=t?1:0)),GR=nN(No,WR,null,"bool"),UR={kernelName:No,backendName:"cpu",kernelFunc:GR};const qR={kernelName:Ro,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t,r=Di(s.shape),i=s.shape[s.shape.length-1],a=lN({inputs:{x:s},backend:n,attrs:{shape:[r/i,i]}}),o=wR(a,!0,n),l=lN({inputs:{x:o},backend:n,attrs:{shape:s.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(o),l}},jR=IT(Mo,(e=>Number.isFinite(e)?1:0),"bool"),HR={kernelName:Mo,backendName:"cpu",kernelFunc:jR},$R=IT(Fo,(e=>Math.abs(e)===1/0?1:0),"bool"),KR={kernelName:Fo,backendName:"cpu",kernelFunc:$R},XR=IT(Bo,(e=>Number.isNaN(e)?1:0),"bool"),ZR={kernelName:Bo,backendName:"cpu",kernelFunc:XR},YR=BT(((e,t)=>ee<=t?1:0)),tD=nN(Po,eD,null,"bool"),nD={kernelName:Po,backendName:"cpu",kernelFunc:tD};function sD(e,t,n){const s=(t-e)/(n-1),r=ta(n,"float32");r[0]=e;for(let e=1;eMath.log(e))),aD=TT(Wo,iD),oD={kernelName:Wo,backendName:"cpu",kernelFunc:aD},lD=IT(Go,(e=>Math.log1p(e))),uD={kernelName:Go,backendName:"cpu",kernelFunc:lD},cD=BT(((e,t)=>e&&t)),hD=nN(Uo,cD,null,"bool"),dD={kernelName:Uo,backendName:"cpu",kernelFunc:hD},pD=IT(qo,(e=>e?0:1),"bool"),fD={kernelName:qo,backendName:"cpu",kernelFunc:pD},mD=BT(((e,t)=>e||t)),gD=nN(jo,mD,null,"bool"),yD={kernelName:jo,backendName:"cpu",kernelFunc:gD};const bD={kernelName:Ho,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s;kT(r,"LRN");const u=r.shape[3],c=u-1,h=n.data.get(r.dataId).values,d=Di(r.shape),p=new Float32Array(d);function f(e){const t=e%u;let n=e-t+Math.max(0,t-i);const s=e-t+Math.min(t+i,c);let r=0;for(;n<=s;n++){const e=h[n];r+=e*e}return r}for(let e=0;ei)&&(i=t)}r[n]=i}return r}function AD(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=n;let l=r.shape;const u=l.length,c=Vi(i,l);let h=c;const d=fm(h,u);let p=o.data.get(r.dataId).values;if(null!=d){const e=new Array(u);for(let t=0;tMath.max(e,t))),kD=nN(Xo,CD),SD={kernelName:Xo,backendName:"cpu",kernelFunc:kD};const _D={kernelName:Zo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;kT(r,"maxPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;Ni(hf(a,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))c=RT({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=Yi(r.shape),s=LN(e,r.shape,r.dtype,t,u,"max");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const ED={kernelName:Qo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:u}=s;kT(r,"maxPool3d");const c=tf(r.shape,i,a,1,o,l,u),h=VN(n.data.get(r.dataId).values,r.shape,r.dtype,Yi(r.shape),c,"max");return n.makeTensorInfo(h.shape,"float32",h.values)}};const ID={kernelName:Jo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:u}=s;kT([r,i],"maxPool3DGrad");const c=tf(i.shape,a,o,1,l,u),h=function(e,t){const n=fd(t.outShape,"int32"),s=t.strideDepth,r=t.strideHeight,i=t.strideWidth,a=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=k&&(k=o,S=n*c*h+r*c+a)}}}n.set(S,m,y,s,r,g)}}}return n}(n.bufferSync(i),c),d=c.strideDepth,p=c.strideHeight,f=c.strideWidth,m=c.dilationDepth,g=c.dilationHeight,y=c.dilationWidth,b=c.effectiveFilterDepth,w=c.effectiveFilterHeight,v=c.effectiveFilterWidth,A=b-1-c.padInfo.front,x=v-1-c.padInfo.left,C=w-1-c.padInfo.top,k=fd(i.shape,"float32"),S=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let r=0;r=c.outHeight||Math.floor(i)!==i))for(let a=0;a=c.outWidth||Math.floor(u)!==u)continue;const d=b*w*v-1-h.get(e,s,i,u,t)===n*w*v+r*v+a?1:0;if(0===d)continue;l+=S.get(e,s,i,u,t)*d}}}k.set(l,e,n,s,r,t)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}};const TD={kernelName:Yo,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;kT([i,a],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=ef(o.shape,l,u,1,c,h),p=n.data.get(o.dataId).values,f=fd(d.outShape,o.dtype,PN(p,o.shape,o.dtype,d).values),m=d.strideHeight,g=d.strideWidth,y=d.dilationHeight,b=d.dilationWidth,w=d.effectiveFilterHeight,v=d.effectiveFilterWidth,A=v-1-d.padInfo.left,x=w-1-d.padInfo.top,C=fd(o.shape,"float32"),k=n.data.get(r.dataId).values,S=fd(r.shape,"float32",k);for(let e=0;e=d.outHeight||Math.floor(s)!==s))for(let r=0;r=d.outWidth||Math.floor(o)!==o)continue;const l=w*v-1-f.get(e,s,o,t)===n*v+r?1:0;if(0===l)continue;a+=S.get(e,s,o,t)*l}}C.set(a,e,n,s,t)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}};const ND={kernelName:el,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;kT(s,"MaxPoolWithArgmax");const u=l.data.get(s.dataId).values,c=ef(s.shape,r,i,[1,1],a),[h,d]=function(e,t,n,s,r){const i=LN(e,0,n,Yi(t),r,"max"),a=PN(e,t,n,r,!0,s);return[i.values,a.values]}(u,s.shape,s.dtype,o,c),p=l.write(h,c.outShape,s.dtype),f=l.write(d,c.outShape,s.dtype);return[{dataId:p,shape:c.outShape,dtype:s.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};const OD={kernelName:tl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=Vi(i,r.shape),l=Di(hm(r.shape,o)[1]),u=[],c=n.makeTensorInfo([],"float32",new Float32Array([l]));u.push(c);const h=eN({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});u.push(h);const d=pR({inputs:{a:h,b:c},backend:n});u.push(d);const p=UO({inputs:{x:d},backend:n,attrs:{axis:i,keepDims:a}});return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}};const RD={kernelName:nl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;kT(r,"min");const o=Vi(i,r.shape);let l=o;const u=fm(l,r.shape.length);let c=r;null!=u&&(c=AN({inputs:{x:r},backend:n,attrs:{perm:u}}),l=gm(l.length,r.shape.length)),pm("min",l,c.shape.length);const[h,d]=hm(c.shape,l),p=Di(d),f=ta(Di(h),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;eMath.min(e,t))),MD=nN(sl,DD),FD={kernelName:sl,backendName:"cpu",kernelFunc:MD};const BD={kernelName:rl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,mode:a}=s;kT(r,"mirrorPad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),u=i.map(((e,t)=>e[0]+r.shape[t])),c="reflect"===a?0:1,h=n.data.get(r.dataId).values,d=r.shape.length,p=Yi(r.shape),f=Di(o),m=o.length,g=Yi(o),y=Gi(r.dtype,f);for(let e=0;e=u[e]&&(t[e]=2*(u[e]-1)-t[e]+c);t=t.map(((e,t)=>e-l[t]));const n=ra(t,d,p);y[e]=h[n]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}},zD=BT(((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),LD=nN(il,zD),PD={kernelName:il,backendName:"cpu",kernelFunc:LD};function VD(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=r.shape.length;let o=i;if(-1===o&&(o=a-1),o!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${o}`);const l=Vi([o],r.shape),u=AD({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),c=dm(u.shape,l),h=lN({inputs:{x:u},backend:n,attrs:{shape:c}}),d=yR({inputs:{a:r,b:h},backend:n}),p=iR({inputs:{x:d},backend:n}),f=UO({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=lN({inputs:{x:f},backend:n,attrs:{shape:c}}),g=pR({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const WD={kernelName:Yl,backendName:"cpu",kernelFunc:VD};const GD={kernelName:al,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s;kT(r,"multinomial");const l=o?r:VD({inputs:{logits:r},backend:n,attrs:{dim:-1}}),u=l.shape[0],c=l.shape[1],h=n.data.get(l.dataId).values,d=[u,i],p=ta(Di(d),"int32");for(let e=0;ee!==t?1:0)),QD=nN(ul,YD,null,"bool"),JD={kernelName:ul,backendName:"cpu",kernelFunc:QD};const eM={kernelName:fl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s;kT(r,"oneHot");const u=Di(r.shape),c=new Float32Array(u*a);c.fill(l);const h=n.data.get(r.dataId).values;for(let e=0;e=0&&h[e]{Oi(i,e.shape,"All tensors passed to stack must have matching shapes"),Ni(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=dO({inputs:t.map((e=>{const t=oR({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}const iM={kernelName:ml,backendName:"cpu",kernelFunc:rM};const aM={kernelName:gl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,constantValue:a}=s;kT(r,"pad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),u=n.data.get(r.dataId).values,c=Di(r.shape),h=r.shape.length,d=Yi(r.shape),p=Di(o),f=o.length,m=Yi(o),g=Gi(r.dtype,p);0!==a&&g.fill(a);for(let e=0;ee+l[t])),f,m)]=u[e]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}},oM=BT(((e,t)=>Math.pow(e,t))),lM=nN(yl,oM),uM={kernelName:yl,backendName:"cpu",kernelFunc:lM};function cM(e,t,n,s){const[r,i]=hm(e,s),a=Tc(t,"int32"),o=ta(Di(r),a),l=Di(i);for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(y,g,f)}};function dM(e,t,n,s){const r=[];let i=0;const a=t.length-1+n.length,o=new Array(a).fill(null).map((()=>[0]));!function(e,t){for(let n=0;nr)throw new Error("Ragged splits must not point past values");for(let e=1;es[e])throw new Error("Ragged splits must be sorted in ascending order")}}(n,s);let l=1;for(let e=0;e=0){const e=o[r],t=e[e.length-1]-s[a];for(let e=a;e{if(e<0||e>=n){const r=ia(s,t.length,Yi(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}}))}(i,a,t[0][0]-1),0===s.length)throw new Error("params.rank must be nonzero");const l=s[0],{outSplits:u,valueSlices:c,numValues:h}=dM(i,a,e,l),d=function(e){const t=[];for(let n=0;ns[t]=e))}return t}(u),p=fM(n,s,r,c,h);return[d,p[0],p[1]]}const gM={kernelName:vl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.data.get(e.dataId).values)),u=r.map((e=>e.shape)),c=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,[d,p,f]=mM(l,u,c,i.shape,i.dtype,h,a.shape),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}},yM=2147483647;function bM(e,t,n,s,r,i,a){if(t.length>1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(a.length>1)throw new Error("deltas must be a scalar or vector");const o=0===t.length,l=0===r.length,u=0===a.length,c=[];o||c.push(t[0]),l||c.push(r[0]),u||c.push(a[0]);for(let e=1;e0&&rn)c=0;else if(c=Math.ceil(Math.abs((r-n)/a)),c>yM)throw new Error(`Requires ((limit - start) / delta) <= ${yM}`);d[t+1]=d[t]+c}const p=Ui(n,d[h]);let f=0;for(let t=0;tn&&(n=t)}return n}static getMaxWidthValueRowID(e){const t=e.length;if(0===t)return 0;let n=0,s=e[0],r=0;for(let i=1;i"Final length of result must be equal to firstDimension.")),r}calculateOutputIndexRowSplit(e,t,n,s){const r=e.length,i=[];for(let a=0;a0&&i.length!==e[r-1])throw new Error("Invalid row split size.");return i}calculateOutputIndexValueRowID(e,t,n,s){const r=e.length,i=[];if(0===r)return[];let a=0,o=e[0];if(o>=t.length)throw new Error(`Got currentValueRowId=${o}, which is not less than ${t.length}`);let l=t[o];i.push(l);for(let u=1;u=0&&(++a,a=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}i.push(l)}if(i.length!==e.length)throw new Error("Invalid row ids.");return i}calculateOutputIndex(e,t,n,s){const r=this.getRowPartitionTensor(e),i=this.getRowPartitionTypeByDimension(e);switch(i){case vM.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,s);case vM.ROW_SPLITS:if(r.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${r.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(r,t,n,s);default:throw new Error(`Unsupported partition type: ${vM[i]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const t=this.rowPartitionTypes[0];switch(t){case vM.FIRST_DIM_SIZE:return e[0];case vM.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case vM.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${vM[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const e=this.getFirstDimensionSize(),t=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let e=n.length-2;e>=0;--e)n[e]=n[e+1]*t[e+1];const s=CM(t,!1),r=Ui(this.valuesDType,Di(s));if(n[0]*t[0]>0){let i=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){i=this.calculateOutputIndex(e-1,i,n[e],t[e])}this.setOutput(this.raggedRank,i,r,s)}return[s,r]}setOutput(e,t,n,s){if(0===n.length)return;const r=this.values,i=n;let a=s.slice();a=a.slice(e+1);const o=Di(a),l=t.length;let u=this.defaultValue;if(u.length!==o&&1!==u.length){const e=this.defaultValueShape;oh((()=>{const t=mf(u,e),n=Rf(t,a);u=n.dataSync()}))}let c=0,h=0,d=0;for(let e=0;e<=l;++e){let s=e=l){const e=n.length;s=Math.floor(e/o)}if(s>d)if(1===this.defaultValue.length)i.subarray(d*o,s*o).fill(this.defaultValue[0]),d=s;else for(;s>d;){xM(i.slice(d*o),u,o),++d}s<0?(c=e+1,h=d):(c=e,h=d,d=h+1)}else++d}}}function xM(e,t,n){for(let s=0;s= 0`);if(s<-1)throw new Error(`Dimension ${s} must be >= -1`);s=-1}n.push(s)}return n}function kM(e,t,n,s,r,i,a,o,l,u){return new AM(e,t,n,s,r,i,a,o,l,u).compute()}const SM={kernelName:xl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.data.get(r.dataId).values,c=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,d=o.map((e=>n.data.get(e.dataId).values)),p=o.map((e=>e.shape)),[f,m]=kM(u,r.shape,c,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}};function _M(e,t,n,s){if(e===t||e1)return ta(0,s);const r=ta(Math.abs(Math.ceil((t-e)/n)),s);t1/e)),TM={kernelName:Sl,backendName:"cpu",kernelFunc:IM};const NM={kernelName:Nl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s;kT(r,"resizeBilinear");const l=Yi(r.shape),[u,c]=o,[h,d,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array(Di([h,u,c,f])),y=[i&&u>1?d-1:d,i&&c>1?p-1:p],b=[i&&u>1?u-1:u,i&&c>1?c-1:c];let w=0;const v=y[0]/b[0],A=y[1]/b[1];for(let e=0;e1?u-1:u,a&&p>1?c-1:c],g=[a&&d>1?d-1:d,a&&p>1?p-1:p],y=m[0]/g[0],b=m[1]/g[1],w=n.data.get(i.dataId).values;let v=0;for(let e=0;e1?d-1:d,i&&c>1?p-1:p],b=[i&&u>1?u-1:u,i&&c>1?c-1:c],w=y[0]/b[0],v=y[1]/b[1];let A=0;for(let e=0;e1?c-1:c,a&&f>1?h-1:h],b=[a&&p>1?p-1:p,a&&f>1?f-1:f],w=y[0]/b[0],v=y[1]/b[1],A=1/w,x=1/v,C=2*Math.ceil(A)+2,k=2*Math.ceil(x)+2;for(let e=0;e=p)continue;const d=t+u*l[1],m=u*w;if(e===Math.min(c-1,a?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=d+t*l[2],i=t*v;s===Math.min(h-1,a?Math.round(i):Math.floor(i))&&(o+=g[r+n])}}m[i+n]=o}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const MM={kernelName:Dl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s;kT(r,"reverse");const a=r.shape.length,o=Vi(i,r.shape);if(0===a)return RT({inputs:{x:r},backend:n});const l=new gc(r.shape,r.dtype),u=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e])),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},FM={kernelName:Cu,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=Gi(s.dtype,Di(s.shape)),[u,c,h,d]=s.shape,[p,f]=vw(a,c,h),m=Math.sin(r),g=Math.cos(r),y=o.data.get(s.dataId).values;for(let e=0;e=0&&v=0&&A{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),zM={kernelName:Ml,backendName:"cpu",kernelFunc:BM},LM=ET((e=>1/Math.sqrt(e))),PM=TT(Fl,LM),VM={kernelName:Fl,backendName:"cpu",kernelFunc:PM};function WM(e,t,n,s,r,i,a,o,l,u){const c=[s/r,r],h=e.values,d=t.values;if(0===s)return fd(n,t.dtype);const p=l instanceof gc?l:fd(c,t.dtype);"string"==typeof l||"number"==typeof l?p.values.fill(l):"boolean"==typeof l&&p.values.fill(+l);for(let e=0;e=s/r)throw new Error(`Invalid indices: ${i} does not index into ${n}`);for(let n=0;n1||1===r.shape.length?1:Di(r.shape.slice(1));for(let e=0;ee>=0?KM*e:$M*(Math.exp(e)-1))),ZM={kernelName:Vl,backendName:"cpu",kernelFunc:XM},YM=IT(ql,(e=>e<0?-1:e>0?1:0)),QM={kernelName:ql,backendName:"cpu",kernelFunc:YM},JM=IT(Gl,(e=>Math.sin(e))),eF={kernelName:Gl,backendName:"cpu",kernelFunc:JM},tF=IT(Ul,(e=>Math.sinh(e))),nF={kernelName:Ul,backendName:"cpu",kernelFunc:tF},sF=Math.log(1.1920928955078125e-7)+2,rF=IT(Hl,(e=>{const t=e>-sF,n=e=l)throw new Error(nv(t,n,l));++f[n],d=d&&n>=p,p=n}let m=!0;for(let e=0;e0&&(f[e]+=f[e-1])}if(m&&d){const t=e,n=s;for(let e=0;eNumber(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};function uF(e,t,n,s,r){const i=Di(s),a=t[0],o=r.length,l=[];let u=1,c=-1;for(let e=0;e0){d[h-1]=1;for(let e=h-2;e>=0;--e)d[e]=d[e+1]*s[e+1]}const p=[];if(o>0){p[o-1]=1;for(let e=o-2;e>=0;--e)p[e]=p[e+1]*l[e+1]}const f=Ui(n,a*o);for(let t=0;t0?r[o-1]+1:0;if(c<0)throw new Error("segment ids must be >= 0");const h=t.slice();h[0]=c;const d=Ui(n,h.reduce(((e,t)=>e*t),1));if(0===o)return c>0&&d.fill(a),[d,h];if(c<=0)throw new Error("segment ids must be >= 0");let p=0,f=1,m=0,g=r[p];for(;;){let t=0;if(f=t)throw new Error("segment ids are not increasing")}if(g<0||g>=c)throw new Error(cv(g,c));g>m&&d.fill(a,m*u,g*u);for(let t=p;t=l[0])throw new Error(hv(t,s[t],l[0]));for(let t=0;to)break}return m{const t=[...c];t[o]=e;const s=$N({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[o]+=e,s}))}},gF=ET((e=>Math.sqrt(e))),yF=IT($l,(e=>Math.sqrt(e))),bF={kernelName:$l,backendName:"cpu",kernelFunc:yF},wF={kernelName:ru,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,s=t;kT(n,"square");const r=s.data.get(n.dataId).values,i=new Float32Array(r.length);for(let e=0;e{const n=e-t;return n*n})),AF=nN(su,vF),xF={kernelName:su,backendName:"cpu",kernelFunc:AF},CF=ET(((e,t)=>{const{pattern:n,replaceGlobal:s,rewrite:r}=t;return e.replace(new RegExp(n,s?"g":""),r)})),kF=TT(iu,CF),SF={kernelName:iu,backendName:"cpu",kernelFunc:kF},_F=IT(Au,((e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),EF={kernelName:Au,backendName:"cpu",kernelFunc:_F};function IF(e,t,n,s){const r=fd(e,t.dtype);for(let e=0;e=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=_p(b,w,v),t=$N({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=lN({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=IF(p,n.bufferSync(r),v,b);A=n.makeTensorInfo(f,e.dtype,e.values)}return A}};class NF{constructor(e,t,n,s,r,i){this.separator=tc(e),this.nGramWidths=t,this.leftPad=tc(n),this.rightPad=tc(s),this.padWidth=r,this.preserveShort=i}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const n=this.getPadWidth(t);return Math.max(0,e+2*n-t+1)}createNGrams(e,t,n,s,r,i){for(let a=0;a0?0:a-o);let d=0;d+=l*this.leftPad.length;for(let t=0;te.forEach((e=>p[f++]=e));for(let e=0;e0){m(e[h+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let r=1;r=e;if(s=s&&t[r]<=n,!s)throw new Error(`Invalid split value ${t[r]}, must be in [${e}, ${n}]`);e=t[r]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const r=s-1,i=Ui("int32",s);if(0===n||0===s){const e=new Array(n);for(let e=0;e<=r;++e)i[e]=0;return[e,i]}i[0]=0;for(let e=1;e<=r;++e){const n=t[e]-t[e-1];let s=0;this.nGramWidths.forEach((e=>{s+=this.getNumNGrams(n,e)})),this.preserveShort&&n>0&&0===s&&(s=1),i[e]=i[e-1]+s}const a=new Array(i[r]);for(let n=0;n{const o=t[n+1]-t[n],l=this.getNumNGrams(o,i);this.createNGrams(e,s,a,r,l,i),r+=l})),this.preserveShort&&r===i[n]){const i=t[n+1]-t[n];if(0===i)continue;const o=i+2*this.padWidth,l=1;this.createNGrams(e,s,a,r,l,o)}}return[a,i]}}function OF(e,t,n,s,r,i,a,o){return new NF(n,s,r,i,a,o).compute(e,t)}const RF={kernelName:ou,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.data.get(c.dataId).values,p=n.data.get(h.dataId).values,[f,m]=OF(d,p,r,i,a,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};function DF(e,t,n,s){if(!e.length)return;if(0===t.length){for(let t=0;tMath.tan(e))),PF={kernelName:hu,backendName:"cpu",kernelFunc:LF},VF=IT(du,(e=>Math.tanh(e)));const WF={kernelName:zl,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{tensor:s,indices:r,updates:i}=t,{sliceRank:a,numUpdates:o,sliceSize:l,strides:u,outputSize:c}=Ey(0,r,s.shape),h=n.bufferSync(r),d=n.bufferSync(i),p=n.bufferSync(s),f=WM(h,d,s.shape,c,l,o,a,u,p,!1);return n.makeTensorInfo(s.shape,f.dtype,f.values)}};function GF(e,t){const n=new Array(e.rank);for(let s=0;s{const n=t.value-e.value;return 0===n?e.index-t.index:n};function jF(e,t,n=0,s=e.length-1){for(;s>n;){if(s-n>600){const r=s-n+1,i=t-n+1,a=Math.log(r),o=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*o*(r-o)/r)*Math.sign(i-r/2);jF(e,t,Math.max(n,Math.floor(t-i*o/r+l)),Math.min(s,Math.floor(t+(r-i)*o/r+l)))}const r=e[t];let i=n,a=s;for(Ti(e,n,t),qF(e[s],r)>0&&Ti(e,n,s);i0;)a-=1}0===qF(e[n],r)?Ti(e,n,a):(a+=1,Ti(e,a,s)),a<=t&&(n=a+1),t<=a&&(s=a-1)}}function HF(e,t,n,s,r){const i=t[t.length-1],[a,o]=[e.length/i,i],l=Gi(n,a*s),u=Gi("int32",a*s);for(let t=0;ta[t]={value:e,index:t})),st-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return Ei(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return Ei(0,n,t-1)}(e,t);case"nearest":return function(e,t){return Ei(0,e,t-1)}(e,t);default:return function(e,t){return e}(e)}}function ZF(e,t,n,s,r,i,a,o,l,u,c){return 0<=o&&o{for(let n=0;nn.disposeIntermediateTensorInfo(e))),h}},sB=[dN,fN,gN,bN,oN,wN,CN,kN,SN,_N,IN,NN,RN,FN,zN,WN,GN,UN,qN,hN,jN,XN,QN,tO,nO,tN,iO,oO,XT,lO,pO,mO,gO,yO,bO,wO,vO,xO,kO,SO,_O,EO,IO,TO,OO,RO,DO,MO,FO,BO,zO,LO,jO,OT,HO,XO,sR,aR,lR,hR,xR,kR,SR,IR,OR,RR,DR,FR,zR,VR,UR,DT,qR,hO,HR,KR,ZR,FT,JR,nD,rD,oD,uD,dD,fD,yD,bD,wD,xD,SD,_D,ED,ID,TD,ND,OD,RD,FD,BD,PD,GD,GO,qD,HD,KD,ZD,JD,eM,sM,iM,aM,uM,PT,hM,gM,wM,SM,EM,QT,fR,TM,WT,UT,uN,NM,OM,RM,DM,MM,FM,zM,VM,GM,jM,HM,ZM,HT,QM,eF,nF,KN,WD,iF,aF,lF,cF,dF,pF,fF,mF,bF,wF,xF,SF,EF,TF,RF,FF,zF,bR,qO,PF,{kernelName:du,backendName:"cpu",kernelFunc:VF},WF,UF,$F,KF,xN,eB,tB,nB,nM];for(const e of sB)Mu(e);const rB={},iB={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function aB(e,t){if(!(e in rB)||null!=t){const n=function(e,t){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=null==t?function(e){if(ca().getBool("IS_SAFARI")||"undefined"==typeof OffscreenCanvas||2!==e){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}return new OffscreenCanvas(300,150)}(e):t;n.addEventListener("webglcontextlost",(t=>{t.preventDefault(),delete rB[e]}),!1),ca().getBool("SOFTWARE_WEBGL_ENABLED")&&(iB.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",iB)||n.getContext("experimental-webgl",iB);return n.getContext("webgl2",iB)}(e,t);if(null===n)return null;rB[e]=n}const n=rB[e];return null==n||n.isContextLost()?(delete rB[e],aB(e)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),rB[e])}var oB,lB,uB;function cB(e,t){return[t,e]}function hB(e){const t=Di(e);return Bi(Math.ceil(t/4))}function dB(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function pB(e,t){const n=e;let s,r,i,a,o,l,u,c,h,d;return 2===ca().getNumber("WEBGL_VERSION")?(s=n.R32F,r=n.R16F,i=n.RGBA16F,a=n.RGBA32F,o=n.RED,u=4,c=1,h=n.HALF_FLOAT,d=n.FLOAT,l=n.RGBA8):(s=e.RGBA,r=e.RGBA,i=e.RGBA,a=n.RGBA,o=e.RGBA,u=4,c=4,h=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT,l=e.RGBA),{internalFormatFloat:s,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:a,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:h,textureTypeFloat:d}}function fB(e,t){const n=t();return ca().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${t}`}}(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(oB||(oB={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(lB||(lB={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(uB||(uB={}));function mB(e){return!!(ca().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8e.getExtension(t)),'Extension "'+t+'" not supported on this browser.')}const yB=/ERROR: [0-9]+:([0-9]+):/g;function bB(e,t){const n=yB.exec(t);if(null==n)return;const s=+n[1],r=e.split("\n"),i=r.length.toString().length+2,a=r.map(((e,t)=>zi((t+1).toString(),i)+e));let o=0;for(let e=0;ee.validateProgram(t))),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw new Error("Shader program validation failed.")}function vB(e,t,n,s,r,i,a){const o=e.getAttribLocation(t,n);return-1!==o&&(fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,s))),fB(e,(()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,i,a))),fB(e,(()=>e.enableVertexAttribArray(o))),!0)}function AB(e,t,n,s){fB(e,(()=>function(e,t,n){_B(e,n),fB(e,(()=>e.activeTexture(e.TEXTURE0+n))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,t)))}(e,t,s))),fB(e,(()=>e.uniform1i(n,s)))}function xB(e,t,n){fB(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,n))),fB(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)))}function CB(e,t){fB(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,t))),fB(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)))}function kB(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}(e,t))}function SB(e,t,n){const s=fB(e,(()=>t()));if(null==s)throw new Error(n);return s}function _B(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,s=t+e.TEXTURE0;if(sn){throw new Error(`textureUnit must be in ${`[gl.TEXTURE0, gl.TEXTURE${n}]`}.`)}}function EB(e,t=2){return Di(e.slice(0,e.length-t))}function IB(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function TB(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[EB(e),...IB(e)]),t}function NB(e){return e%2==0}function OB(e,t){if(Mi(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const n=e[e.length-1],s=t[t.length-1];if(n===s)return!0;if(NB(n)&&NB(s)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&NB(e[0])&&NB(t[0])}let RB,DB;function MB(e,t){return null!=e.getExtension(t)}function FB(e){try{if(null!=aB(e))return!0}catch(e){return!1}return!1}function BB(e){if(0===e)return!1;const t=aB(e);if(1!==e){if(MB(t,"EXT_color_buffer_float"))return zB(t);const e="EXT_color_buffer_half_float";if(MB(t,e)){const n=t.getExtension(e);return function(e,t){const n=pB(e,t),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const r=1,i=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,i,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(s),e.deleteFramebuffer(a),o}(t,n)}return!1}if(!MB(t,"OES_texture_float"))return!1;if(!MB(t,"WEBGL_color_buffer_float"))return!1;return zB(t)}function zB(e){const t=pB(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const r=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),r}function LB(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&Ni("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the WebGL backend.`))}))}const PB=ca();function VB(){let e,t,n,s,r,i,a,o,l,u;return 2===ca().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",s="in",r="texture",i="outputColor",a="out vec4 outputColor;",o=ca().getBool("WEBGL2_ISNAN_CUSTOM")?"\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ":"",l="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",s="varying",r="texture2D",i="gl_FragColor",a="",o="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",l="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:s,texture2D:r,output:i,defineOutput:a,defineSpecialNaN:o,defineSpecialInf:l,defineRound:u}}function WB(e,t,n="index"){const s=Yi(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${t}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${t}`:`index -= ${e[r]} * ${t}`};`)).join("")}function GB(e,t,n="index"){const s=Yi(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / outShapeStrides[${r}]`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * outShapeStrides[${r}]`:`index -= ${e[r]} * outShapeStrides[${r}]`};`)).join("")}function UB(e,t,n="index"){const s=function(e,t){const n=e.length,s=e.map((e=>`${t}[${e}]`)),r=new Array(n-1);r[n-2]=s[n-1];for(let e=n-3;e>=0;--e)r[e]=`(${r[e+1]} * ${s[e+1]})`;return r}(e.map(((e,t)=>t)),t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${s[r]}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${s[r]}`:`index -= ${e[r]} * ${s[r]}`};`)).join("")}function qB(e){const t=Yi(e).map((e=>e.toString()));return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n }\n`}PB.registerFlag("HAS_WEBGL",(()=>PB.getNumber("WEBGL_VERSION")>0)),PB.registerFlag("WEBGL_VERSION",(()=>FB(2)?2:FB(1)?1:0)),PB.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(()=>!1)),PB.registerFlag("WEBGL_BUFFER_SUPPORTED",(()=>2===PB.get("WEBGL_VERSION"))),PB.registerFlag("WEBGL_CPU_FORWARD",(()=>!0)),PB.registerFlag("WEBGL_FORCE_F16_TEXTURES",(()=>!1)),PB.registerFlag("WEBGL_PACK",(()=>PB.getBool("HAS_WEBGL"))),PB.registerFlag("WEBGL_PACK_NORMALIZATION",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_CLIP",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_DEPTHWISECONV",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_REDUCE",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_LAZILY_UNPACK",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_CONV_IM2COL",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",(()=>PB.getBool("WEBGL_PACK"))),PB.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(()=>function(e){if(null==RB){const t=aB(e);RB=t.getParameter(t.MAX_TEXTURE_SIZE)}return RB}(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(()=>function(e){if(null==DB){const t=aB(e);DB=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,DB)}(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(()=>{const e=PB.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const n=aB(e);return t=MB(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:MB(n,"EXT_disjoint_timer_query")?1:0,t}(e)})),PB.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(()=>PB.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!qc())),PB.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(()=>function(e){if(0===e)return!1;const t=aB(e);if(1===e){if(!MB(t,"OES_texture_float"))return!1}else if(!MB(t,"EXT_color_buffer_float"))return!1;return zB(t)}(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(()=>!PB.getBool("WEBGL_FORCE_F16_TEXTURES")&&PB.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))),PB.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(()=>BB(PB.getNumber("WEBGL_VERSION")))),PB.registerFlag("WEBGL_FENCE_API_ENABLED",(()=>{return 2===(e=PB.getNumber("WEBGL_VERSION"))&&null!=aB(e).fenceSync;var e})),PB.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(()=>PB.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0)),PB.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",(()=>-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)})),PB.registerFlag("WEBGL_FLUSH_THRESHOLD",(()=>qc()?1:-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)})),PB.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(()=>128)),PB.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(()=>!1)),PB.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e5)),PB.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(()=>128)),PB.registerFlag("WEBGL_EXP_CONV",(()=>!1)),PB.registerFlag("SOFTWARE_WEBGL_ENABLED",(()=>PB.getBool("IS_TEST"))),PB.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",(()=>1/0)),PB.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",(()=>!1)),PB.registerFlag("WEBGL2_ISNAN_CUSTOM",(()=>!1)),PB.registerFlag("ENGINE_COMPILE_ONLY",(()=>!1));const jB="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",{getBroadcastDims:HB}=r;function $B(e,t,n){const s=[];if(e.forEach((e=>{const t=Di(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?s.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(s.push(`uniform sampler2D ${e.name};`),s.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=rz(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:s.push(`uniform int ${e.name}Shape;`);break;case 2:s.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:s.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:s.push(`uniform ivec4 ${e.name}Shape;`)}s.push(`uniform ivec2 ${e.name}TexShape;`)}})),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:s.push("uniform int outShape;");break;case 2:s.push("uniform ivec2 outShape;"),s.push("uniform int outShapeStrides;");break;case 3:s.push("uniform ivec3 outShape;"),s.push("uniform ivec2 outShapeStrides;");break;case 4:s.push("uniform ivec4 outShape;"),s.push("uniform ivec3 outShapeStrides;")}s.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach((e=>{s.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)}));const r=s.join("\n"),i=e.map((e=>function(e,t,n=!1,s){let r="";r+=n?XB(e,s):KB(e,s);const i=e.shapeInfo.logicalShape,a=t.logicalShape;i.length<=a.length&&(r+=n?function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",i=e.shapeInfo.logicalShape.length,a=t.logicalShape.length,o=HB(e.shapeInfo.logicalShape,t.logicalShape),l=sz(a),u=a-i;let c;const h=["x","y","z","w","u","v"];c=0===i?"":a<2&&o.length>=1?"coords = 0;":o.map((e=>`coords.${h[e+u]} = 0;`)).join("\n");let d="";d=a<2&&i>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${h[t+u]}`)).join(", ");let p="return outputValue;";const f=1===Di(e.shapeInfo.logicalShape),m=Di(t.logicalShape),g=1===m;if(1!==i||f||g){if(f&&!g)p=1===a?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(o.length){const e=i-2,t=i-1;o.indexOf(e)>-1&&o.indexOf(t)>-1?p="return vec4(outputValue.x);":o.indexOf(e)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(t)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return`\n vec4 ${r}() {\n ${l} coords = getOutputCoords();\n ${c}\n vec4 outputValue = get${s}(${d});\n ${p}\n }\n `}(e,t):function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",i=t.texShape,a=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&null==e.shapeInfo.flatOffset&&Mi(a,i))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const u=sz(l),c=HB(e.shapeInfo.logicalShape,t.logicalShape),h=l-o;let d;const p=["x","y","z","w","u","v"];d=0===o?"":l<2&&c.length>=1?"coords = 0;":c.map((e=>`coords.${p[e+h]} = 0;`)).join("\n");let f="";f=l<2&&o>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${p[t+h]}`)).join(", ");return`\n float ${r}() {\n ${u} coords = getOutputCoords();\n ${d}\n return get${s}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms))).join("\n"),a=t.texShape,o=VB(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(o);let u,c,h=function(e){const t=`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFs} vec2 resultUV;\n ${e.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${e.defineSpecialNaN}\n ${e.defineSpecialInf}\n ${e.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${ZB}\n ${YB}\n ${QB}\n `;return t}(o);t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return ez();case 1:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===s[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${s[1]}.0);\n }\n `;if(1===s[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${s[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n return 2 * (resTexRC.x * ${s[1]} + resTexRC.y);\n }\n `}(0,t,n);case 2:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(Mi(e,t))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(${s[0]}, ${s[1]}));\n }\n `;const r=Math.ceil(e[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec2(r, c);\n }\n `}(e,t,n);case 3:return function(e,t,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),i=r*Math.ceil(e[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n\n int b = index / ${i};\n index -= b * ${i};\n\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec3(b, r, c);\n }\n `}(e,t,n);default:return function(e,t,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),i=r*Math.ceil(e[e.length-2]/2);let a=i,o="",l="b, r, c";for(let t=2;t1&&!Mi(t,n)&&s.lengthe[t])).join(", ")}function oz(e,t,n,s){const r=n.map(((e,n)=>{const s={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(s.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:s}})),i=r.map((e=>e.shapeInfo)),a={logicalShape:s.shape,texShape:s.texData.texShape,isUniform:!1,isPacked:s.texData.isPacked,flatOffset:null},o=$B(r,a,t),l=function(e,t){const n=SB(e,(()=>e.createShader(e.FRAGMENT_SHADER)),"Unable to create fragment WebGLShader.");if(fB(e,(()=>e.shaderSource(n,t))),fB(e,(()=>e.compileShader(n))),ca().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw bB(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}(e.gl,o),u=e.createProgram(l);return ca().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:i,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:i,outShapeInfo:a},lz(e,t,u)))}function lz(e,t,n){const s=[],r=[];let i,a,o,l=null,u=null;u=e.getUniformLocation(n,"NAN",!1),1===ca().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const c=!1;for(const r of t.variableNames){const i={name:r,uniform:e.getUniformLocation(n,r,c),offset:e.getUniformLocation(n,`offset${r}`,c)};t.enableShapeUniforms&&(i.shape=e.getUniformLocation(n,`${r}Shape`,c),i.texShape=e.getUniformLocation(n,`${r}TexShape`,c)),s.push(i)}if(t.enableShapeUniforms&&(i=e.getUniformLocation(n,"outShape",c),o=e.getUniformLocation(n,"outShapeStrides",c),a=e.getUniformLocation(n,"outTexShape",c)),t.customUniforms)for(const s of t.customUniforms)r.push(e.getUniformLocation(n,s.name,c));return{variablesLocations:s,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:i,outShapeStridesLocation:o,outTexShapeLocation:a}}function uz(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach(((e,n)=>{const s=e.logicalShape,r=t[n],i=r.shape;if(!Mi(s,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${s} and ${i} must match`);if(e.isUniform&&r.isUniform)return;const a=e.texShape,o=r.isUniform?null:r.texData.texShape;if(!Mi(a,o))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${a} and ${o} must match`)}))}function cz(e){return ca().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class hz{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=oB.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=VB();this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?GB(["r","c","d"],e):WB(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${t.output} = result;\n }\n `}}class dz{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=oB.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=VB();this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?GB(["r","c","d"],e):WB(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${t.output} = result;\n }\n `}}class pz{constructor(e){this.variableNames=["A"],this.outTexUsage=lB.DOWNLOAD;const t=VB();this.outputShape=e,this.userCode=`\n ${jB}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}}class fz{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=lB.DOWNLOAD;const t=VB();this.outputShape=e,this.userCode=`\n ${jB}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${t.output} = encode_float(x);\n }\n `}}const mz={R:0,G:1,B:2,A:3};class gz{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const s=VB();this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let i="";for(let e=0;ee.createShader(e.VERTEX_SHADER)),"Unable to create vertex WebGLShader.");if(fB(e,(()=>e.shaderSource(n,t))),fB(e,(()=>e.compileShader(n))),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error("Failed to compile vertex shader.");return n}(e,`${t.version}\n precision highp float;\n ${t.attribute} vec3 clipSpacePos;\n ${t.attribute} vec2 uv;\n ${t.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`)}function wz(e){return function(e,t){const n=SB(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),fB(e,(()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function vz(e){return function(e,t){const n=SB(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return fB(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n))),fB(e,(()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Uint16Array([0,1,2,2,1,3]))}function Az(e,t,n,s,r,i){!function(e,t){const n=ca().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0)throw new Error(`Requested texture size [${e}x${t}] is invalid.`);if(e>n||t>n)throw new Error(`Requested texture size [${e}x${t}] greater than WebGL maximum on this browser / GPU [${n}x${n}].`)}(t,n);const a=function(e){return SB(e,(()=>e.createTexture()),"Unable to create WebGLTexture.")}(e),o=e.TEXTURE_2D;return fB(e,(()=>e.bindTexture(o,a))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST))),fB(e,(()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST))),1===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texImage2D(o,0,s,t,n,0,r,i,null))):fB(e,(()=>e.texStorage2D(o,1,s,t,n))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,null))),{texture:a,texShape:[n,t]}}function xz(e){return e.internalFormatFloat}function Cz(e){return e.internalFormatHalfFloat}function kz(e){return e.downloadTextureFormat}function Sz(e){return e.internalFormatPackedFloat}function _z(e){return e.internalFormatPackedHalfFloat}function Ez(e,t,n,s,r,i,a,o){const l=e,u=new Float32Array(function(e,t){const[n,s]=dB(e,t);return n*s*4}(i,a));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}class Iz{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=ca().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,function(e,t){rB[e]=t}(t,e)):this.gl=aB(t),e=this.gl,2===ca().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>fB(t,(()=>t.createVertexArray())),this.bindVertexArray=e=>fB(t,(()=>t.bindVertexArray(e))),this.deleteVertexArray=e=>fB(t,(()=>t.deleteVertexArray(e))),this.getVertexArray=()=>fB(t,(()=>t.getParameter(t.VERTEX_ARRAY_BINDING)))}else if(null!=e){const t=e.getExtension("OES_vertex_array_object");if(null==t)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>fB(e,(()=>t.createVertexArrayOES())),this.bindVertexArray=n=>fB(e,(()=>t.bindVertexArrayOES(n))),this.deleteVertexArray=n=>fB(e,(()=>t.deleteVertexArrayOES(n))),this.getVertexArray=()=>fB(e,(()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES)))}let n="WEBGL_color_buffer_float";const s="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===ca().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=gB(this.gl,e),MB(this.gl,t))this.textureHalfFloatExtension=gB(this.gl,t);else if(ca().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),MB(this.gl,s))this.colorBufferHalfFloatExtension=gB(this.gl,s);else if(ca().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",MB(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!MB(this.gl,s))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(s)}this.vertexBuffer=wz(this.gl),this.indexBuffer=vz(this.gl),this.framebuffer=function(e){return SB(e,(()=>e.createFramebuffer()),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=pB(this.gl,this.textureHalfFloatExtension)}get debug(){return ca().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program,this.outputTexture;const e=this.gl;fB(e,(()=>e.finish())),fB(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,null))),fB(e,(()=>e.deleteFramebuffer(this.framebuffer))),fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,null))),fB(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null))),fB(e,(()=>e.deleteBuffer(this.indexBuffer))),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=cB(t,n);return Az(e,r,i,xz(s),s.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=cB(t,n);return Az(e,r,i,Cz(s),s.textureFormatFloat,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=cB(t,n);return Az(e,r,i,kz(s),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,n){fB(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),n.data instanceof Uint8Array?2===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data))):fB(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data))):2===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n))):fB(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,s){this.throwIfDisposed(),function(e,t,n,s,r,i){let a,o,l;fB(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),r instanceof Uint8Array?(a=new Uint8Array(n*s*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(a=new Float32Array(n*s*4),o=e.FLOAT,l=i.internalFormatPackedFloat),a.set(r),2===ca().getNumber("WEBGL_VERSION")?fB(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,s,e.RGBA,o,a))):fB(e,(()=>e.texImage2D(e.TEXTURE_2D,0,l,n,s,0,e.RGBA,o,a))),fB(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t,n,s,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=dB(t,n);return Az(e,r,i,_z(s),e.RGBA,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=dB(t,n);return Az(e,r,i,Sz(s),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(CB(this.gl,this.framebuffer),this.outputTexture=null),fB(this.gl,(()=>this.gl.deleteTexture(e)))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n,s){const[r,i]=cB(t,n),a=new Uint8Array(t*n*4);return fB(e,(()=>e.readPixels(0,0,r,i,s.downloadTextureFormat,e.UNSIGNED_BYTE,a))),new Float32Array(a.buffer)}(this.gl,t,n,this.textureConfig)))}downloadPackedMatrixFromBuffer(e,t,n,s,r,i){return Ez(this.gl,e,0,0,0,r,i,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return function(e,t,n){const s=e,r=new Float32Array(n);return s.bindBuffer(s.PIXEL_PACK_BUFFER,t),s.getBufferSubData(s.PIXEL_PACK_BUFFER,0,r),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),r}(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const s=function(e,t,n,s){const r=e.createBuffer();fB(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r)));const i=16*t*n;return fB(e,(()=>e.bufferData(e.PIXEL_PACK_BUFFER,i,e.STREAM_READ))),fB(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0))),fB(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null))),r}(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),s}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(ca().getBool("WEBGL_FENCE_API_ENABLED")){const s=e,r=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=s.clientWaitSync(r,0,0);return e===s.ALREADY_SIGNALED||e===s.CONDITION_SATISFIED},t=r}else ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n){const s=new Float32Array(t*n*4);return fB(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,s))),s}(this.gl,t,n)))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=bz(t));const n=function(e){return SB(e,(()=>e.createProgram()),"Unable to create WebGLProgram.")}(t);fB(t,(()=>t.attachShader(n,this.vertexShader))),fB(t,(()=>t.attachShader(n,e))),function(e,t){if(fB(e,(()=>e.linkProgram(t))),!ca().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw new Error("Failed to link vertex and fragment shaders.")}(t,n);const s=Object.assign(n,{vao:this.createVertexArray()});return this.debug&&wB(t,s),s}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;fB(t,(()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer))),function(e,t,n){fB(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),vB(e,t,"clipSpacePos",n,3,20,0)&&vB(e,t,"uv",n,2,20,12)}(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(fB(this.gl,(()=>this.gl.deleteProgram(e))),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&wB(this.gl,this.program),fB(this.gl,(()=>this.gl.useProgram(e)))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?function(e,t,n){return SB(e,(()=>e.getUniformLocation(t,n)),'uniform "'+n+'" not present in program.')}(this.gl,e,t):function(e,t,n){return e.getUniformLocation(t,n)}(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),fB(this.gl,(()=>this.gl.getAttribLocation(e,t)))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),AB(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[s,r]=dB(t,n);this.setOutputMatrixTextureDriver(e,s,r)}setOutputMatrixWriteRegion(e,t,n,s){this.setOutputMatrixWriteRegionDriver(n,e,s,t)}setOutputPackedMatrixWriteRegion(e,t,n,s){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&wB(this.gl,this.program),kB(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){this.getVertexArray();this.debugValidate()}fB(e,(()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),fB(this.gl,(()=>this.gl.finish()))}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=gB(this.gl,2===ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await Li((()=>this.disposed||this.isQueryAvailable(e,ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))),this.getQueryTime(e,ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){const t=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),n=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise((t=>{this.addItemToPoll((()=>e.isFencePassed()),(()=>t()))}))}pollItems(){const e=function(e){let t=0;for(;te.isDoneFn)));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let n;"setTimeoutCustom"in ca().platform&&(n=ca().platform.setTimeoutCustom.bind(ca().platform)),Li((()=>(this.pollItems(),0===this.itemsToPoll.length)),(()=>0),null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),xB(this.gl,e,this.framebuffer),this.debug&&kB(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(xB(this.gl,this.outputTexture,this.framebuffer),this.debug&&kB(this.gl)):CB(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const s=this.gl;xB(s,e,this.framebuffer),this.debug&&kB(s),this.outputTexture=e,fB(s,(()=>s.viewport(0,0,t,n))),fB(s,(()=>s.scissor(0,0,t,n)))}setOutputMatrixWriteRegionDriver(e,t,n,s){this.throwIfDisposed(),fB(this.gl,(()=>this.gl.scissor(e,t,n,s)))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}}const{mx:Tz,XI:Nz,Nk:Oz,f6:Rz,ct:Dz,YG:Mz,hH:Fz,z3:Bz,sG:zz,uM:Lz,vS:Pz,qB:Vz,GG:Wz,rq:Gz,lg:Uz,WR:qz,cu:jz,GE:Hz,px:$z,jC:Kz,He:Xz,hE:Zz,BF:Yz,Dk:Qz,cl:Jz,_B:eL,ub:tL,_f:nL,Ku:sL,qy:rL,Zy:iL,bu:aL,zv:oL,dH:lL,HS:uL,yH:cL,l3:hL,z9:dL,x6:pL,_m:fL,eW:mL,GK:gL,SP:yL,yr:bL,dl:wL,Dw:vL,xT:AL,_X:xL,wz:CL}=S;function kL(e,t){return["x","y","z","w","u","v"].slice(0,t).map((t=>`${e}.${t}`))}function SL(e,t){return 1===t?[e]:kL(e,t)}class _L{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=cz(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=SL("rc",this.rank),t=sz(this.rank),n=this.getOutOfBoundsCondition(e),s=this.getSetup(e),r=this.getOutput(e);this.userCode=`\n void main() {\n ${t} rc = getOutputCoords();\n\n if(${n}) {\n setOutput(vec4(0));\n } else {\n ${s}\n\n setOutput(vec4(${r}));\n }\n }\n `}}getSourceCoordsArr(e){const t=[];for(let n=0;n<=1;n++)for(let s=0;s<=1;s++){let r=`${0===n?"r":"rp1"}, ${0===s?"c":"cp1"}`;for(let t=2;t ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let n=this.rank-2;n= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n= ${n};\n bool rEdge = rp1 >= ${s};\n `}getOutput(e){const t=this.getSourceCoordsArr(e);if(1===this.rank){return`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${t[0]}),\n cEdge ? 0. : getA(${t[1]}),\n rEdge ? 0. : getA(${t[2]}),\n rEdge || cEdge ? 0. : getA(${t[3]})`}}class EL{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length);let n="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),n+=`\n ${t}\n ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${e>0?"}":""}\n `}var s,r;this.userCode=`\n ${s=t,r=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${r?UB(["r","c","d"],"inputShape"):WB(["r","c","d"],s)}\n return ivec3(r, c, d);\n }\n `}\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":qB(e)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n ${n}\n\n setOutput(result);\n }\n `}}class IL{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,n){const s=NL(t,n),r=OL(e,s,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const i=TL(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=i,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let a;return s===uB.PACKED_2X2_FLOAT32?a=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):s===uB.PACKED_2X2_FLOAT16?a=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):s===uB.UNPACKED_FLOAT32?a=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):s===uB.UNPACKED_FLOAT16?a=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):s===uB.PACKED_4X1_UNSIGNED_BYTE&&(a=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(a),this.numUsedTextures++,this._numBytesAllocated+=i,this.log(),a}releaseTexture(e,t,n,s){if(null==this.freeTextures)return;const r=NL(n,s),i=OL(t,r,s);i in this.freeTextures||(this.freeTextures[i]=[]);const a=TL(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,s),o=ca().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==o&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=a):(this.freeTextures[i].push(e),this.numFreeTextures++,this._numBytesFree+=a),this.numUsedTextures--;const l=this.usedTextures[i],u=l&&l.indexOf(e);if(null==u||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),this.log()}log(){if(!this.logEnabled)return;this.numFreeTextures,this.numUsedTextures,this._numBytesFree,this._numBytesAllocated}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));for(const e in this.usedTextures)this.usedTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function TL(e,t,n,s,r){const i=function(e,t){switch(e){case uB.PACKED_2X2_FLOAT32:return Sz(t);case uB.PACKED_2X2_FLOAT16:return _z(t);case uB.UNPACKED_FLOAT32:return xz(t);case uB.UNPACKED_FLOAT16:return Cz(t);case uB.PACKED_4X1_UNSIGNED_BYTE:return kz(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,s);let a;if(r){const[t,n]=dB(e[0],e[1]);a=t*n}else{const[t,n]=cB(e[0],e[1]);a=t*n}const o=function(e,t){const n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;if(t===n.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}(n,i);return a*o}function NL(e,t){if(e===lB.UPLOAD)return uB.PACKED_2X2_FLOAT32;if(e===lB.RENDER||null==e)return function(e){return ca().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?uB.PACKED_2X2_FLOAT32:uB.UNPACKED_FLOAT32:e?uB.PACKED_2X2_FLOAT16:uB.UNPACKED_FLOAT16}(t);if(e===lB.DOWNLOAD||e===lB.PIXELS)return uB.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function OL(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}class RL{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${t}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}const DL="if (isnan(x)) return x;",ML="return x;",FL="return abs(x);";const BL="return (x >= 0.0) ? x : (exp(x) - 1.0);",zL=DL+"\n return (x < 0.0) ? 0.0 : x;\n",LL=DL+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",PL="return x;",VL="return 1.0 / (1.0 + exp(-1.0 * x));",WL="return x;",GL="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",UL="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",qL="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",jL="return 1.0 / (1.0 + exp(-1.0 * x));";class HL{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${t}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}class $L{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=cz(this.outputShape.length);const t=e.length,n=SL("rc",t),s=sz(t),r=function(e,t){if(1===e)return"rc";let n="";for(let s=0;st.push(e)))}const t=this.texData.get(e),{values:n,shape:s,slice:r,dtype:i,complexTensorInfos:a,isPacked:o}=t;if(null!=r){let t;t=o?new HL(s,PL):new RL(s,PL);const n=this.runWebGLProgram(t,[{dataId:e,shape:s,dtype:i}],i),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if(ca().getBool("DEBUG")&&!ca().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===ca().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,u,c=null;if("complex64"!==i&&ca().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);c=this.gpgpu.createBufferFromTexture(t.texture.texture,...hB(s))}if(this.pendingRead.set(e,[]),"complex64"!==i&&await this.gpgpu.createAndWaitForFence(),"complex64"===i){const e=await Promise.all([this.read(a.real.dataId),this.read(a.imag.dataId)]);u=Fw(e[0],e[1])}else if(null==c)u=this.getValuesFromTexture(e);else{const e=Di(s);u=this.gpgpu.downloadFloat32MatrixFromBuffer(c,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=c){const e=this.gpgpu.gl;fB(e,(()=>e.deleteBuffer(c)))}const h=this.convertAndCacheOnCPU(e,u),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach((e=>e(h))),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&ih().removeDataId(e,this),this.pendingDeletes--),h}readToGPU(e,t={}){const n=this.texData.get(e),{values:s,shape:r,slice:i,dtype:a,isPacked:o,texture:l}=n;if("complex64"===a)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=i){let n;n=o?new HL(r,PL):new RL(r,PL);const s=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:a}],a),i=this.readToGPU(s,t);return this.disposeIntermediateTensorInfo(s),i}if(null==l)throw null!=s?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const u=this.decode(e,t.customTexShape),c=ih().makeTensorFromTensorInfo(u),h=this.texData.get(u.dataId);return Object.assign({tensorRef:c},h.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>nc(e)));return fd(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return fd(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t0}time(e){const t=this.activeTimers,n=[];let s=!1;null==this.programTimersStack?(this.programTimersStack=n,s=!0):this.activeTimers.push(n),this.activeTimers=n,e();const r=rc(this.activeTimers.map((e=>e.query))).filter((e=>null!=e)),i=rc(this.activeTimers.map((e=>e.name))).filter((e=>null!=e));this.activeTimers=t,s&&(this.programTimersStack=null);const a={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);a.kernelMs=function(e){let t=0;for(let n=0;ne.map(((e,t)=>({name:i[t],ms:e}))).map((e=>`${e.name}: ${e.ms}`)).join(", ")}else a.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,a})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:ec(),endMs:null}}endTimer(e){return ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=ec(),e)}async getQueryTime(e){if(ca().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:n}=this.texData.get(e);return null!=n&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:n,texShape:s,usage:r,isPacked:i,slice:a}=this.texData.get(e),o=a&&a.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),null!=t&&(this.numBytesInGPU-=this.computeBytes(s,n),this.textureManager.releaseTexture(t,s,r,i)));const u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=ZL){return ca().getBool("WEBGL_CPU_FORWARD")&&e.every((e=>null==this.texData.get(e.dataId).texture&&Di(e.shape)0&&Hi(n[0])){const r=n.map((e=>tc(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return this.texData.get(s).usage=null,{dataId:s,shape:e,dtype:t}}makeOutput(e,t,n){return ih().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new $L(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new _L(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[EB(e.shape),...IB(e.shape)],s={dtype:e.dtype,shape:n,dataId:e.dataId},r=[EB(t),...IB(t)],i=new EL(r,n),a=[n],o=this.runWebGLProgram(i,[s],e.dtype,a,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:s,shape:r,dtype:i}=n;if(null!=t){Ni(Di(r)<=t[0]*t[1]*4,(()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data."))}const a=TB(r);let o;o=s?new dz(a):new hz(a);const l=[null!=t?t:hB(a)];return{dtype:i,shape:r,dataId:this.runWebGLProgram(o,[{shape:a,dtype:i,dataId:e}],i,l,!0,t).dataId}}runWebGLProgram(e,t,n,s,r=!1,i){const a=this.makeTensorInfo(e.outputShape,n),o=this.texData.get(a.dataId);if(e.packedOutput&&(o.isPacked=!0),e.outPackingScheme===oB.DENSE){const t=null!=i?i:hB(e.outputShape);o.texShape=t.map((e=>2*e))}if(null!=e.outTexUsage&&(o.usage=e.outTexUsage),0===Di(a.shape))return o.values=Gi(a.dtype,0),a;const l=[],u=t.map((t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&Di(t.shape)<=ca().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!n.isPacked!=!!e.packedInputs)t=n.isPacked?this.unpackTensor(t):this.packTensor(t),l.push(t),n=this.texData.get(t.dataId);else if(n.isPacked&&!OB(n.shape,t.shape)){const e=t,s=t.shape;t.shape=n.shape,t=this.packedReshape(t,s),l.push(t),n=this.texData.get(t.dataId),e.shape=s}return{shape:t.shape,texData:n,isUniform:!1}}));this.uploadToGPU(a.dataId);const c={shape:a.shape,texData:o,isUniform:!1},h=function(e,t,n){let s="";t.concat(n).forEach((t=>{const r=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const i=t.texData.texShape,{useSqueezeShape:a,uniformShape:o,keptDims:l}=rz(e.packedInputs,t.shape,i);let u="",c="",h="";if(1===o.length&&e.packedInputs){const e=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==o.length||e.packedInputs){if(o.length>2&&!e.packedInputs){const e=Yi(o);h=`${e[0]===i[1]}_${e[e.length-1]===i[1]}`}}else c=`${o[0]>1}_${o[1]>1}`;const d=t.shape.length,p=2===o.length&&Mi(t.shape,i),f=1===Di(t.shape),m=Vd(t.shape,n.shape),g=!e.packedInputs&&d===n.shape.length&&Mi(i,n.texData.texShape),y=e.packedInputs||o.length>2?"":`${i[0]>1}_${i[1]>1}`;s+=`${d}_${g}_${a?l:""}_${o.length}_${f}_${m}_${p}_${u}_${c}_${h}_${y}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;s+=`${t.shape}_${e}_${r}`}}));const r=e.userCode;let i=e.constructor.name;return i+="_"+s+"_"+r+`${ca().getNumber("WEBGL_VERSION")}`,i}(e,u,c),d=this.getAndSaveBinary(h,(()=>oz(this.gpgpu,e,u,c))),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),ca().get("ENGINE_COMPILE_ONLY")||function(e,t,n,s,r){t.program.enableShapeUniforms||(uz(t.inShapeInfos,n),uz([t.outShapeInfo],[s]));const i=s.texData.texture,a=s.texData.texShape;s.texData.isPacked?e.setOutputPackedMatrixTexture(i.texture,a[0],a[1]):e.setOutputMatrixTexture(i.texture,a[0],a[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===ca().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let s=0;sthis.disposeIntermediateTensorInfo(e))),p&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));const m=ca().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=ec();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!ca().getBool("WEBGL_LAZILY_UNPACK")&&o.isPacked&&!1===r){const e=this.unpackTensor(a);return this.disposeIntermediateTensorInfo(a),e}return a}compileAndRun(e,t,n,s,r=!1){n=n||t[0].dtype;return this.runWebGLProgram(e,t,n,s,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){if(!this.disposed){if(!ca().getBool("IS_TEST")){Object.keys(this.binaryCache).forEach((e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}))}this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=oh((()=>{if(!ca().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=ca().getBool("DEBUG");ca().set("DEBUG",!1);const t=this.abs(_d(1e-8)).dataSync()[0];if(ca().set("DEBUG",e),t>0)return 32}return 16}))),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:n,dtype:s,values:r,texture:i,usage:a,isPacked:o}=t;if(null!=i)return;const l=null!=this.activeTimers;let u;l&&(u=ec());let c=t.texShape;if(null==c&&(c=function(e,t=!1){let n=ca().getNumber("WEBGL_MAX_TEXTURE_SIZE"),s=ca().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(s===1/0&&ca().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(s=n/2),t&&(n*=2,s*=2,1===(e=e.map(((t,n)=>n>=e.length-2?Ii(e[n]):e[n]))).length&&(e=[2,e[0]])),2!==e.length){const t=Wi(e);e=t.newShape}let r=Di(e),i=null;e.length<=1&&r<=n?i=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?i=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?i=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?i=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?i=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(i=[e[0],e[1]*e[2]*e[3]]);const a=null!=i&&Math.max(...i)>s&&Math.min(...i)<=(t?2:1)&&Math.min(...i)>0;if(null==i||a)if(t){const t=EB(e);let n=2,s=2;e.length&&([n,s]=IB(e)),r=t*(n/2)*(s/2),i=Bi(r).map((e=>2*e))}else i=Bi(r);return i}(n,o),t.texShape=c),null!=r){const e=TB(n);let i,a=c[1],h=c[0];const d=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!o&&d||([a,h]=dB(c[0],c[1])),i=o?new yz(e,d):new gz(e,d);const p=d?[h,a]:c,f=this.makeTensorInfo(p,s),m=this.texData.get(f.dataId);m.usage=d?lB.PIXELS:lB.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),a,h,r);const g=[[h,a]],y=!0,b=this.runWebGLProgram(i,[f],s,g,y),w=this.texData.get(b.dataId);t.texShape=w.texShape,t.isPacked=w.isPacked,t.usage=w.usage,ca().get("ENGINE_COMPILE_ONLY")?this.disposeData(b.dataId):(t.texture=w.texture,t.values=null,this.texData.delete(b.dataId)),this.disposeIntermediateTensorInfo(f),l&&(this.uploadWaitMs+=ec()-u)}else{const e=this.acquireTexture(c,a,s,o);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:s}=n;return null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t1024*this.numMBBeforeWarning*1024){(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0}return this.textureManager.acquireTexture(e,t,s)}computeBytes(e,t){return e[0]*e[1]*ji(t)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}for(const[,t]of Object.entries(this.binaryCache)){const n=new Promise((e=>{try{this.checkCompletion_(t),e(!0)}catch(e){throw e}}));e.push(n)}return Promise.all(e)}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await cw(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw bB(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.");throw new Error("Failed to link vertex and fragment shaders.")}return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:t,customUniformLocations:n,infLoc:s,nanLoc:r,outShapeLocation:i,outShapeStridesLocation:a,outTexShapeLocation:o}=lz(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=s,e.nanLoc=r,e.outShapeLocation=i,e.outShapeStridesLocation=a,e.outTexShapeLocation=o}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:s,height:r,width:i,channels:a}=e,o=ih().backend;if(!o.gpgpu.gl.isTexture(s))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const l=o.writeTexture(s,t,n,r,i,a);return ih().makeTensorFromDataId(l,t,n,o)}}YL.nextDataId=0;jc()&&ch("webgl",(()=>new YL),2);const QL="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class JL{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=Gd(t,n),this.enableShapeUniforms=cz(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${e}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}}const eP="\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n";class tP{constructor(e,t,n,s=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Gd(t,n);const r=this.outputShape.length;this.enableShapeUniforms=cz(r);let i="";if(s)if(0===r||1===Di(this.outputShape))i="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(i=`\n ${sz(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?i+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":i+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=SL("coords",r);this.enableShapeUniforms?i+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= outShape[${r} - 2];\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= outShape[${r} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:i+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= ${this.outputShape[r-2]};\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= ${this.outputShape[r-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${e}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${i}\n\n setOutput(result);\n }\n `}}function nP(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const sP={kernelName:Oo,backendName:"webgl",kernelFunc:nP};function rP(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.makeTensorInfo(s.shape,"complex64"),a=n.texData.get(i.dataId),o=nP({inputs:{x:s},backend:n}),l=nP({inputs:{x:r},backend:n});return a.complexTensorInfos={real:o,imag:l},i}const iP={kernelName:Wa,backendName:"webgl",kernelFunc:rP},aP="return (a < 0.) ? b * a : a;",oP="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const lP={kernelName:zo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s,a=n.makeTensorInfo([],"float32",Qu(i,"float32")),o=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new tP(oP,r.shape,a.shape):new JL(aP,r.shape,a.shape),l=n.runWebGLProgram(o,[r,a],"float32");return n.disposeIntermediateTensorInfo(a),l}},uP="return (a < 0.) ? b * a : a;",cP="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const hP={kernelName:bl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t,i=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new tP(cP,s.shape,r.shape):new JL(uP,s.shape,r.shape);return n.runWebGLProgram(i,[s,r],"float32")}},dP="if (isnan(x)) return x;";function pP({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:s}){return({inputs:r,backend:i})=>{const{x:a}=r,o=i,l=s||a.dtype;if(o.shouldExecuteOnCPU([a])&&null!=n){const e=o.texData.get(a.dataId),t=n(e.values,l);return o.makeTensorInfo(a.shape,l,t)}let u;return u=ca().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new HL(a.shape,t):new RL(a.shape,e),o.runWebGLProgram(u,[a],l)}}function fP({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:s=!1,cpuKernelImpl:r,dtype:i}){return({inputs:a,backend:o})=>{const{a:l,b:u}=a,c=o;if(s&&"complex64"===l.dtype){const t=c.texData.get(l.dataId),n=c.texData.get(u.dataId),[s,r]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map((t=>{const[n,s]=t,r={dataId:n.dataId,dtype:n.dtype,shape:l.shape},i={dataId:s.dataId,dtype:s.dtype,shape:u.shape},a=new JL(e,l.shape,u.shape);return c.runWebGLProgram(a,[r,i],Tc(n.dtype,s.dtype))})),i=rP({inputs:{real:s,imag:r},backend:c});return c.disposeIntermediateTensorInfo(s),c.disposeIntermediateTensorInfo(r),i}const h=i||Tc(l.dtype,u.dtype);if(("string"===l.dtype||"string"===u.dtype||c.shouldExecuteOnCPU([l,u]))&&null!=r){const e=c.texData.get(l.dataId).values,t=c.texData.get(u.dataId).values,n="string"===l.dtype?mv(e):e,s="string"===l.dtype?mv(t):t,[i,a]=r(l.shape,u.shape,n,s,h),o=c.makeTensorInfo(a,h);return c.texData.get(o.dataId).values=i,o}let d;return d=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new tP(t,l.shape,u.shape,n):new JL(e,l.shape,u.shape),c.runWebGLProgram(d,[l,u],h)}}function mP(e,t=!1){if("linear"===e)return t?WL:ML;if("relu"===e)return t?UL:zL;if("elu"===e)return t?GL:BL;if("relu6"===e)return t?qL:LL;if("prelu"===e)return t?cP:uP;if("leakyrelu"===e)return t?oP:aP;if("sigmoid"===e)return t?jL:VL;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class gP{constructor(e,t,n,s=!1,r=!1,i=!1,a=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=cz(this.outputShape.length);const u=s?e[1]:e[2],c=Math.ceil(u/2),h=s?"i * 2, rc.y":"rc.y, i * 2",d=r?"rc.z, i * 2":"i * 2, rc.z",p=s?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",g="";a&&(m=o?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${a}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${a}\n }`:`vec4 activation(vec4 x) {\n ${a}\n }`,g="result = activation(result);");const y=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let b="rc.x",w="rc.x";e[0]`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`));const c=a.texData.get(r.dataId);return!c.isPacked||OB(r.shape,l)||null!==c.texture&&OB(c.shape,l)?(a.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}):function(e,t,n){const s=[EB(e.shape),...IB(e.shape)],r={dtype:e.dtype,shape:s,dataId:e.dataId},i=[EB(t),...IB(t)],a=new EL(i,s),o=[s],l=n.runWebGLProgram(a,[r],e.dtype,o,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,a)}const CP={kernelName:El,backendName:"webgl",kernelFunc:xP};class kP{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];const a=4*Math.floor(n/4),o=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${Fi(e)?e.toPrecision(2):e}, ones);`}let u="";r%n>0&&(u=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${u}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${a}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${l}\n }\n\n int inIdx = inOffset + ${a};\n if (${1===o}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${l}\n } else if (${2===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${l}\n } else if (${3===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${l}\n }\n setOutput(sumValue);\n }\n `}}class SP{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];let a="0.0",o="";"prod"===t?a="1.0":"min"===t?(a="1.0 / 1e-20",o="min"):"max"===t&&(a="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const u=4*Math.floor(n/4),c=n%4;let h=`\n if (${"sum"===t}) {\n sumValue += dot(values, ones);\n } else if (${"prod"===t}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${o}(values, minMaxValue);\n if (${"min"===t} || ${"max"===t}) {\n minMaxValue = ${o}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,d="vec4";"all"===t?(a="1.0",h="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===t&&(a="0.0",h="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");let p="";r%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${a};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${p}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n vec4 minMaxValue = vec4(${a});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${u}; i += 4) {\n int inIdx = inOffset + i;\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${h}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${2===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${3===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${h}\n }\n setOutput(${l});\n }\n `}}function _P(e,t,n,s){const r=function(e){const t=[];for(;0===t.length||1!==t[t.length-1].outSize;){const n=t.length?t[t.length-1].outSize:e[1],s=ww(n);t.push({inSize:n,windowSize:s,outSize:Math.ceil(n/s)})}return t}(e.shape);let i=e;for(let a=0;a6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],s=new Array(t);for(let t=0;t6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const s=sz(this.rank),r=kL("rc",this.rank),i=new Array(this.rank);for(let e=0;e`Error in matMul: inner shapes (${h}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${s} must match.`));const v=n?[y,h,p]:[y,p,h],A=s?[b,f,d]:[b,d,f],x=xP({inputs:{x:e},backend:r,attrs:{shape:v}}),C=xP({inputs:{x:t},backend:r,attrs:{shape:A}}),k=[x,C],S=Math.max(y,b),_=n?x.shape[1]:x.shape[2],E=null!=i,I=null!=a,T="leakyrelu"===l,N=null!=l?mP(l,!0):null;let O;if((1===p||1===f)&&_>MP&&!1===(E||I||T||null!=N)){let e=x,t=C;n&&(e=RP({inputs:{x},backend:r,attrs:{perm:[0,2,1]}}),k.push(e)),s&&(t=RP({inputs:{x:C},backend:r,attrs:{perm:[0,2,1]}}),k.push(t));const i=1===f;let a=e;1!==f&&(a=xP({inputs:{x:e},backend:r,attrs:{shape:[S,_,1]}}),k.push(a));const o=1===f?2:1;let l=t;i&&(l=xP({inputs:{x:t},backend:r,attrs:{shape:[S,1,_]}}),k.push(l));const u=vP({inputs:{a,b:l},backend:r});O=NP({inputs:{x:u},backend:r,attrs:{axis:o,keepDims:!0}}),k.push(u)}else{const l=Tc(e.dtype,t.dtype),u=new gP(v,A,[S,p,f],n,s,E,N,I,T),c=[x,C];if(null!=i&&c.push(i),I&&c.push(a),T){const e=r.makeTensorInfo([],"float32",Qu(o,"float32"));c.push(e),k.push(e)}O=r.runWebGLProgram(u,c,l)}const R=xP({inputs:{x:O},backend:r,attrs:{shape:w}});k.push(O);for(const e of k)r.disposeIntermediateTensorInfo(e);return R}const BP={kernelName:ku,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i,bias:a,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:h}=s;return FP({a:r,b:i,transposeA:l,transposeB:u,backend:n,bias:a,preluActivationWeights:o,leakyreluAlpha:h,activation:c})}},zP="return abs(x);";const LP={kernelName:ma,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])&&"complex64"!==s.dtype){const e=n.texData.get(s.dataId),t=lL(e.values);return n.makeTensorInfo(s.shape,s.dtype,t)}let r;return r=ca().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new HL(s.shape,zP):new RL(s.shape,zP),n.runWebGLProgram(r,[s],s.dtype)}},PP=pP({opSnippet:DL+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),VP={kernelName:ga,backendName:"webgl",kernelFunc:PP},WP=pP({opSnippet:DL+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),GP={kernelName:ya,backendName:"webgl",kernelFunc:WP},UP="return a + b;",qP=fP({opSnippet:UP,packedOpSnippet:UP,supportsComplex:!0,cpuKernelImpl:Tz}),jP={kernelName:ba,backendName:"webgl",kernelFunc:qP};class HP{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`float v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${s};\n setOutput(result);\n }\n `}}class $P{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`vec4 v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${s};\n setOutput(result);\n }\n `}}const KP={kernelName:wa,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,r=n;if(1===r.length)return nP({inputs:{x:r[0]},backend:s});if(r.length>ca().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:s}),i=e({inputs:r.slice(t),backend:s});return e({inputs:[n,i],backend:s})}const i=r.map((e=>e.dtype)).reduce(((e,t)=>Tc(e,t))),a=r.map((e=>e.shape)),o=ca().getBool("WEBGL_PACK")?new $P(r[0].shape,a):new HP(r[0].shape,a);return s.runWebGLProgram(o,r,i)}};const XP={kernelName:va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=Vi(i,r.shape);let u=l;const c=fm(u,o);let h=r;null!=c&&(h=RP({inputs:{x:r},backend:n,attrs:{perm:c}}),u=gm(u.length,o)),pm("all",u,o);const[d,p]=hm(h.shape,u),f=xP({inputs:{x:h},backend:n,attrs:{shape:[-1,Di(p)]}}),m=_P(f,f.dtype,"all",n);let g;if(a){g=xP({inputs:{x:m},backend:n,attrs:{shape:dm(d,l)}})}else g=xP({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};const ZP={kernelName:Aa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=Vi(i,r.shape);let u=l;const c=fm(u,o);let h=r;null!=c&&(h=RP({inputs:{x:r},backend:n,attrs:{perm:c}}),u=gm(u.length,o)),pm("any",u,o);const[d,p]=hm(h.shape,u),f=xP({inputs:{x:h},backend:n,attrs:{shape:[-1,Di(p)]}}),m=_P(f,f.dtype,"any",n);let g;if(a){g=xP({inputs:{x:m},backend:n,attrs:{shape:dm(d,l)}})}else g=xP({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};class YP{constructor(e,t,n){this.variableNames=["A"];const{windowSize:s,batchSize:r,outSize:i}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,i];const a="max"===t?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${s};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${s}; i++) {\n int inIdx = ${o};\n float candidate = getA(batch, inIdx);\n if (candidate ${a} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}class QP{constructor(e,t,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,Ni(e.length>2,(()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`));const r=e[e.length-1],i=Math.ceil(r/t);this.outputShape=e.slice(0,-1),i>1&&this.outputShape.push(i),s||this.variableNames.push("bestIndicesA");const a=this.outputShape,o=a.length,l=sz(o),u=SL("coords",o);let c,h;if(1===i){h=o+1;const e=sz(h);c=`\n ${e} sourceLocR = ${e}(${u.join()}, 0);\n ++${u[o-1]};\n ${e} sourceLocG = ${e}(${u.join()}, 0);\n ++${u[o-2]};\n ${e} sourceLocA = ${e}(${u.join()}, 0);\n --${u[o-1]};\n ${e} sourceLocB = ${e}(${u.join()}, 0);\n --${u[o-2]};`}else h=o,c=`\n ${l} sourceLocR = coords;\n ++${u[o-1]};\n ${l} sourceLocG = coords;\n ++${u[o-2]};\n ${l} sourceLocA = coords;\n --${u[o-1]};\n ${l} sourceLocB = coords;\n --${u[o-2]};`;const d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],f=d.map((e=>"int "+e)),m=SL("sourceLocR",h-1).concat("inIdx.r"),g=SL("sourceLocG",h-1).concat("inIdx.g"),y=SL("sourceLocB",h-1).concat("inIdx.b"),b=SL("sourceLocA",h-1).concat("inIdx.a"),w="max"===n?"greaterThan":"lessThan",v=s?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${y.join()}),\n getBestIndicesAChannel(${b.join()})));`,A=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${y.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,x=s?"":`\n float getBestIndicesAChannel(${f.join()}) {\n return getChannel(getBestIndicesA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${f.join()}) {\n return getChannel(getA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }\n ${x}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${u[o-1]} < ${a[o-1]-1};\n bool hasNextRow = ${u[o-2]} < ${a[o-2]-1};\n ${c}\n ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p},\n sourceLocB${p}, sourceLocA${p}) * ${t};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${A};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${v}\n vec4 candidate = ${A};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${w}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}}function JP(e,t,n,s=null){let r=t.shape[0],i=t.shape[1];null!=s&&(r=s.shape[0],i=s.shape[1]);const a=ww(i),o={windowSize:a,inSize:i,batchSize:r,outSize:Math.ceil(i/a)},l=new YP(o,n,null==s),u=[t];null!=s&&u.push(s);const c=e.runWebGLProgram(l,u,"int32");if(1===c.shape[1])return c;const h=JP(e,t,n,c);return e.disposeIntermediateTensorInfo(c),h}function eV(e,t,n,s=null){const r=null!=s?s.shape:t.shape,i=ww(r[r.length-1]),a=new QP(r,i,n,null==s),o=null==s?[t]:[t,s],l=e.runWebGLProgram(a,o,"int32");if(l.shape.length===t.shape.length){const s=eV(e,t,n,l);return e.disposeIntermediateTensorInfo(l),s}return l}function tV(e,t,n,s){const r=[n];if(pm("arg"+s.charAt(0).toUpperCase()+s.slice(1),r,t.shape.length),!ca().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],i=e.texData.get(t.dataId);let a=t;null!==i&&i.isPacked&&(a=e.unpackTensor(t),n.push(a));const[o,l]=hm(a.shape,r),u=Di(l),c=xP({inputs:{x:a},backend:e,attrs:{shape:[-1,u]}});n.push(c);const h=JP(e,c,s);n.push(h);const d=xP({inputs:{x:h},backend:e,attrs:{shape:o}});return n.forEach((t=>e.disposeIntermediateTensorInfo(t))),d}return eV(e,t,s)}const nV={kernelName:xa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=Vi(i,r.shape);const o=fm(a,r.shape.length);let l=r;const u=[];null!=o&&(l=RP({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),a=gm(a.length,l.shape.length)),pm("argMax",[a[0]],l.shape.length);const c=tV(n,l,a[0],"max");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}};const sV={kernelName:Ca,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=Vi(i,r.shape);const o=fm(a,r.shape.length);let l=r;const u=[];null!=o&&(l=RP({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),a=gm(a.length,l.shape.length)),pm("argMin",[a[0]],l.shape.length);const c=tV(n,l,a[0],"min");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}},rV=pP({opSnippet:DL+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),iV={kernelName:ka,backendName:"webgl",kernelFunc:rV},aV=pP({opSnippet:DL+"return log(x + sqrt(x * x + 1.0));"}),oV={kernelName:Sa,backendName:"webgl",kernelFunc:aV},lV=pP({opSnippet:DL+"\n return atan(x);\n"}),uV={kernelName:_a,backendName:"webgl",kernelFunc:lV},cV=fP({opSnippet:QL+"\n return atan(a, b);\n",packedOpSnippet:"\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n "+eP+"\n return result;\n"}),hV={kernelName:Ia,backendName:"webgl",kernelFunc:cV},dV=pP({opSnippet:DL+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),pV={kernelName:Ea,backendName:"webgl",kernelFunc:dV};class fV{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,a=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;const f="avg"===t,m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let y="0.0";if(f||(y="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${a}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h};\n wC += ${u}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?m:g:`wR * ${h} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");const w=4*Math.floor(i/4),v=i%4,A=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${a}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n const float initializationValue = ${y};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${y});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${w}; wC += 4) {\n int xC = xCCorner + wC * ${u};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n getValue(batch, xR, xC + 3 * ${u}, d)\n );\n\n ${A}\n }\n\n int xC = xCCorner + ${w};\n if (${1===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${A}\n } else if (${2===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${A}\n } else if (${3===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n initializationValue\n );\n\n ${A}\n }\n }\n setOutput(${b});\n }\n `}}class mV{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const i=e.filterWidth,a=e.strideDepth,o=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,c=e.dilationHeight,h=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,f=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;const b="avg"===t;let w="0.0";if(b||(w="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${a}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${f};\n wC += ${h}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${f} +\n wR * ${f} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let v=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(v="avgValue / max(count, 1.0)");const A=4*Math.floor(i/4),x=i%4,C=`\n if (${b}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${a}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n const float initializationValue = ${w};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${w});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${A}; wC += 4) {\n int xC = xCCorner + wC * ${h};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n getValue(batch, xD, xR, xC + 3 * ${h}, ch)\n );\n\n ${C}\n }\n\n int xC = xCCorner + ${A};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${C}\n } else if (${2===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n initializationValue,\n initializationValue\n );\n\n ${C}\n } else if (${3===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n initializationValue\n );\n\n ${C}\n }\n }\n }\n setOutput(${v});\n }\n `}}const gV={kernelName:Ta,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;LB(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;Ni(hf(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))return nP({inputs:{x:r},backend:n});const c=new fV(u,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}};const yV={kernelName:Oa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:u}=s,c=tf(r.shape,i,a,[1,1,1],o,l,u),h=new mV(c,"avg",!1);return n.runWebGLProgram(h,[r],"float32")}};class bV{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=o-1-e.padInfo.top,c=l-1-e.padInfo.left,h=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${h});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${o};\n wR += ${i}) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC+= ${a}) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}}class wV{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=c-1-e.padInfo.front,f=h-1-e.padInfo.top,m=d-1-e.padInfo.left,g=1/(t*n*s);this.userCode=`\n const ivec3 pads = ivec3(${p}, ${f}, ${m});\n const float avgMultiplier = float(${g});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${o}) {\n float dyD = float(dyDCorner + wD) / ${r}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${h};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${d};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${a}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const vV={kernelName:Ra,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=tf(a.shape,o,l,[1,1,1],u,c),d=new wV(h);return n.runWebGLProgram(d,[r],a.dtype)}};const AV={kernelName:Na,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;LB([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=ef(a.shape,o,l,1,u),h=new bV(c);return n.runWebGLProgram(h,[r],a.dtype)}};const xV={kernelName:Da,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;return FP({a:r,b:i,transposeA:a,transposeB:o,backend:n})}};class CV{constructor(e,t,n,s,r,i){this.outputShape=[],this.variableNames=["x","mean","variance"],Gd(e,t),Gd(e,n);let a="0.0";null!=s&&(Gd(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="1.0";null!=r&&(Gd(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${a};\n float scale = ${o};\n float inv = scale * inversesqrt(variance + float(${i}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}class kV{constructor(e,t,n,s,r,i){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Gd(e,t),Gd(e,n);let a="vec4(0.0)";null!=s&&(Gd(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="vec4(1.0)";null!=r&&(Gd(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${a};\n vec4 scale = ${o};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${i}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}const SV={kernelName:_o,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,mean:r,variance:i,offset:a,scale:o}=e;Ni(r.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),Ni(null==a||r.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),Ni(null==o||r.shape.length===o.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[s,r,i];let c=null;null!=a&&(c=a.shape,u.push(a));let h=null;null!=o&&(h=o.shape,u.push(o));const d=ca().getBool("WEBGL_PACK_NORMALIZATION")?new kV(s.shape,r.shape,i.shape,c,h,l):new CV(s.shape,r.shape,i.shape,c,h,l);return t.runWebGLProgram(d,u,u[0].dtype)}};class _V{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=sz(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return EV.slice(0,e).map((e=>"sourceLoc."+e)).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let s;s=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${e.map(((e,t)=>`sourceLoc.${EV[t]} = start[${t}] + coords.${EV[t]};`)).join("\n")}\n `,this.userCode=`\n void main() {\n ${s}\n setOutput(getSource(${n}));\n }\n `}}const EV=["x","y","z","w","u","v"];class IV{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=sz(this.rank),n=SL("coords",this.rank),s=SL("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${s.slice(-2).join()})`,i=`getChannel(getSource(${s.join()}), ${r})`,a=`\n result.x = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.y = ${i};\n --${s[this.rank-1]};\n }\n `,o=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n ++${s[this.rank-2]};\n result.z = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.w = ${i};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map(((e,t)=>`start[${t}]`)).join()});`:e.map(((e,t)=>`${s[t]} = ${n[t]} + start[${t}];`)).join("\n");this.userCode=`\n void main() {\n ${t} coords = getOutputCoords();\n ${t} sourceLoc;\n ${l}\n vec4 result = vec4(0.);\n ${a}\n ${o}\n setOutput(result);\n }\n `}}function TV(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s,[o,l]=Lp(r,i,a);if(kp(r,o,l),0===Di(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=uL(e.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:u}=n.texData.get(r.dataId),c=Bp(r.shape,o,l);if(u||!c){const e=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new IV(l):new _V(l),t=[o];return n.runWebGLProgram(e,[r],r.dtype,t)}return n.uploadToGPU(r.dataId),function(e,t,n,s){const r=s.texData.get(e.dataId),i=s.makeTensorInfo(n,e.dtype),a=s.texData.get(i.dataId);Object.assign(a,r),a.refCount=1,a.shape=n,a.dtype=e.dtype;let o=zp(t,Yi(e.shape));r.slice&&(o+=r.slice.flatOffset),a.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=s.dataRefCount.get(a.slice.origDataId)||1;return s.dataRefCount.set(a.slice.origDataId,l+1),i}(r,o,l,n)}const NV={kernelName:Wl,backendName:"webgl",kernelFunc:TV},OV={kernelName:Ma,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;Ni(r.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=Aw(r.shape,i,o),u=xw(l.length,i.length),c=Cw(r.shape,i,o),h=kw(a,i.length),d=Sw(c,a,i.length),p=[],f=xP({inputs:{x:r},backend:n,attrs:{shape:l}}),m=RP({inputs:{x:f},backend:n,attrs:{perm:u}}),g=xP({inputs:{x:m},backend:n,attrs:{shape:c}}),y=TV({inputs:{x:g},backend:n,attrs:{begin:h,size:d}});return p.push(f),p.push(m),p.push(g),p.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}};const RV={kernelName:Fa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=n.readSync(r.dataId),l=n.readSync(i.dataId),u=Nz(o,l,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,u)}};const DV={kernelName:Ba,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:s,b:r}=t,i=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS"),a=ca().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([s,r])||1===a){const e=n.texData.get(s.dataId).values,t=n.texData.get(r.dataId).values,[i,a]=Rz(s.shape,r.shape,e,t,s.dtype),o=n.makeTensorInfo(a,s.dtype);return n.texData.get(o.dataId).values=i,o}let o;return o=i?new tP("\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n",s.shape,r.shape,!1):new JL("\n return float(int(a.r) & int(b.r));\n",s.shape,r.shape),n.runWebGLProgram(o,[s,r],s.dtype)}};const MV={kernelName:za,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.readSync(s.dataId),a=n.readSync(r.dataId),o=Gd(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},FV=fP({opSnippet:"return float(a != b);",cpuKernelImpl:Jz,dtype:"bool"}),BV={kernelName:ul,backendName:"webgl",kernelFunc:FV};function zV(e){const{inputs:t,backend:n}=e,{input:s}=t;return nP({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.real},backend:n})}const LV={kernelName:kl,backendName:"webgl",kernelFunc:zV},PV="return float(int(x));";const VV={kernelName:La,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s,attrs:r}=t,{x:i}=n,{dtype:a}=r;if("complex64"===a){if("complex64"===i.dtype)return nP({inputs:{x:i},backend:s});const t=ig(i.shape),n=e({inputs:{x:i},backend:s,attrs:{dtype:"float32"}}),r=rP({inputs:{real:n,imag:t},backend:s});return t.dispose(),s.disposeIntermediateTensorInfo(n),r}if("complex64"===i.dtype){const t=zV({inputs:{input:i},backend:s}),n=e({inputs:{x:t},backend:s,attrs:{dtype:a}});return s.disposeIntermediateTensorInfo(t),n}if(!qi(i.dtype,a)){const e=nP({inputs:{x:i},backend:s});return{dataId:e.dataId,shape:e.shape,dtype:a}}if(s.shouldExecuteOnCPU([i])){const e=s.texData.get(i.dataId).values,[t,n,r]=Dz(e,i.shape,i.dtype,a);return s.makeTensorInfo(t,n,r)}if("int32"===a)return function(e,t){const n=new RL(e.shape,PV),s=t.runWebGLProgram(n,[e],"int32");return{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}(i,s);if("bool"===a){const e=s.makeTensorInfo([],"bool",Gi("bool",1)),t=FV({inputs:{a:i,b:e},backend:s});return s.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${a}`)}},WV="return ceil(x);",GV=pP({opSnippet:WV,packedOpSnippet:WV,cpuKernelImpl:Mz}),UV={kernelName:Pa,backendName:"webgl",kernelFunc:GV};class qV{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}}class jV{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}}const HV={kernelName:Va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{clipValueMin:i,clipValueMax:a}=s;let o;o=ca().getBool("WEBGL_PACK_CLIP")?new jV(r.shape):new qV(r.shape);const l=[[i],[a]];return n.runWebGLProgram(o,[r],r.dtype,l)}};class $V{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}}function KV(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const XV={kernelName:Ga,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=n.texData.get(s.dataId),i=new $V(s.shape),a=[KV(s,r.complexTensorInfos.real),KV(s,r.complexTensorInfos.imag)];return n.runWebGLProgram(i,a,a[0].dtype)}};class ZV{constructor(e){this.outputShape=[],this.outputShape=dw(e,1),this.variableNames=e.map(((e,t)=>`T${t}`));const t=new Array(e.length-1);t[0]=e[0][1];for(let n=1;n`T${t}`));const o=new Array(e.length-1);o[0]=e[0][t];for(let n=1;n= ${o[e-1]}) {\n return getChannel(\n getT${e}(${QV(a,l,t)}),\n vec2(${QV(u,l,t)}));\n }`}const d=o.length,p=o[o.length-1];h+=`\n return getChannel(\n getT${d}(${QV(a,l,p)}),\n vec2(${QV(u,l,p)}));`,this.userCode=`\n float getValue(${a.map((e=>"int "+e))}) {\n ${h}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${i}), 0., 0., 0.);\n\n ${i[s-1]} = ${i[s-1]} + 1;\n if (${i[s-1]} < ${n[s-1]}) {\n result.g = getValue(${i});\n }\n\n ${i[s-2]} = ${i[s-2]} + 1;\n if (${i[s-2]} < ${n[s-2]}) {\n result.a = getValue(${i});\n }\n\n ${i[s-1]} = ${i[s-1]} - 1;\n if (${i[s-2]} < ${n[s-2]} &&\n ${i[s-1]} < ${n[s-1]}) {\n result.b = getValue(${i});\n }\n setOutput(result);\n }\n `}}function QV(e,t,n){const s=e.indexOf(t);return e.map(((e,t)=>t===s?`${e} - ${n}`:e)).join()}function JV(e){const{inputs:t,backend:n}=e,{input:s}=t;return nP({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.imag},backend:n})}const eW={kernelName:Do,backendName:"webgl",kernelFunc:JV};function tW(e,t,n){const s=e[0].dtype;if("complex64"===s){const s=e.map((e=>zV({inputs:{input:e},backend:n}))),r=e.map((e=>JV({inputs:{input:e},backend:n}))),i=tW(s,t,n),a=tW(r,t,n),o=rP({inputs:{real:i,imag:a},backend:n});return s.forEach((e=>n.disposeIntermediateTensorInfo(e))),r.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(a),o}let r=n.shouldExecuteOnCPU(e);if("string"===s&&(r=!0),r){const r=e.map((e=>{const s=Di(e.shape.slice(t));return xP({inputs:{x:e},backend:n,attrs:{shape:[-1,s]}})})),i=r.map((e=>({vals:n.readSync(e.dataId),shape:e.shape}))),a=dw(r.map((e=>e.shape)),1),o=1===r[0].shape[0],l=Fz(i,a,s,o),u=dw(e.map((e=>e.shape)),t),c=n.makeTensorInfo(u,s,l);return r.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}const i=e.filter((e=>Di(e.shape)>0)),a=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&i[0].shape.length>1;if(1===i.length){const t=a?new RL(e[0].shape,PL):new HL(e[0].shape,PL);return n.runWebGLProgram(t,e,s)}const o=ca().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(i.length>o){const e=[];for(let s=0;se.shape)),t);return n.runWebGLProgram(e,i,s)}const{tensors2D:l,outShape:u}=function(e,t,n){const s=dw(e.map((e=>e.shape)),t),r=e.map((e=>xP({inputs:{x:e},attrs:{shape:[-1,Di(e.shape.slice(t))]},backend:n})));return{tensors2D:r,outShape:s}}(i,t,n),c=new ZV(l.map((e=>e.shape))),h=n.runWebGLProgram(c,l,s);l.forEach((e=>n.disposeIntermediateTensorInfo(e)));const d=xP({inputs:{x:h},attrs:{shape:u},backend:n});return n.disposeIntermediateTensorInfo(h),d}function nW(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s,i=Vi(r,t[0].shape)[0];hw(t.map((e=>e.shape)),i);const a=dw(t.map((e=>e.shape)),i);if(0===Di(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Di(e.shape)>0));return 1===o.length?nP({inputs:{x:o[0]},backend:n}):tW(o,i,n)}const sW={kernelName:Ua,backendName:"webgl",kernelFunc:nW};class rW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const i=e.padInfo.top,a=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,y=m?2:3,b=m?3:1;let w="",v="";n&&(w=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,v="result = activation(result);");const A=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${w}\n\n const ivec2 strides = ivec2(${o}, ${l});\n const ivec2 pads = ivec2(${i}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${b}];\n\n ivec2 xRCCorner =\n ivec2(coords[${g}], coords[${y}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${m}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${1===f}) {\n\n if (${m}) {\n dotProd +=\n getX(batch, xR, xC, ${p}) *\n getW(wR, wC, ${p}, d2);\n } else {\n dotProd +=\n getX(batch, ${p}, xR, xC) *\n getW(wR, wC, ${p}, d2);\n }\n\n } else if (${2===f}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2)\n );\n\n if (${m}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${3===f}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2),\n getW(wR, wC, ${p} + 2, d2)\n );\n\n if (${m}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1),\n getX(batch, xR, xC, ${p} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC),\n getX(batch, ${p} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${A}\n ${v}\n setOutput(result);\n }\n `}}class iW{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,s=e.padInfo.left,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.filterDepth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${r}, ${i}, ${a});\n const ivec3 pads = ivec3(${t}, ${n}, ${s});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${o};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${u};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${1===f}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${p}) *\n getW(wF, wR, wC, ${p}, d2);\n } else if (${2===f}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${3===f}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1),\n getX(batch, xF, xR, xC, ${p} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2),\n getW(wF, wR, wC, ${p} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class aW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=cz(this.outputShape.length);const i=e.padInfo.left,a=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,c=u;let h="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let t=0;t<(c+1)/2;t++){const n=2*t;if(h+=`\n xC = xCCorner + ${n*o};\n `,1===a){if(n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n `,h+=1===o&&n>0?`\n xC${n} = vec4(xTexelC${n-2}.zw, xTexelC${n}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${n} = vec4(previous.zw, xTexelC${n}.xy);\n } else {\n xC${n} = vec4(0.0, 0.0, xTexelC${n}.xy);\n }\n `):h+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xC${n} = xTexelC${n};\n `,n+1= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n `,h+=o>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${n+1} = vec4(previous.zw, xTexelC${n+1}.xy);\n } else {\n xC${n+1} = vec4(0.0, 0.0, xTexelC${n+1}.xy);\n }\n `:`\n xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.xy);\n `):h+=1===e?`\n xC${n+1} = xTexelC${n};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n+1} = xTexelC${n+1};\n `}}else n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n `,n+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n `)):(h+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(\n xTexelC${n}.xy, xTexelC${n+1}.xy);\n `,n+1= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${a}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${r}) {\n innerDims = vec2(d1, ch);\n result[${2*e+t}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${l}\n\n ${s.output} = result;\n }\n `}}function lW(e,t){const n=e.length;return n>=3?t?[...e.slice(0,-3),e[n-3]*e[n-2],e[n-1]]:[...e.slice(0,-3),e[n-3],e[n-2]*e[n-1]]:!t&&1===n&&e[0]>1?[e[0],1]:null}function uW({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const l=e.shape,u=s.texData.get(e.dataId),c=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=i){const e=lW(i.shape,p);null!=e&&(i=xP({inputs:{x:i},backend:s,attrs:{shape:e}}),g.push(i))}if(null!=r){const e=lW(r.shape,p);null!=e&&(r=xP({inputs:{x:r},backend:s,attrs:{shape:e}}),g.push(r))}if(!((1===h||1===d)&&c>MP)&&u.isPacked&&p&&null!=u.texture&&l[2]%2!=0&&Mi(u.shape.slice(-3),l.slice(-3))){const c=l[0]*l[1]*(l[2]+1),h={dataId:e.dataId,shape:[1,c,n.inChannels],dtype:e.dtype},d=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,Ni(OB(u.shape,h.shape),(()=>`packed reshape ${u.shape} to ${h.shape} isn't free`));const p=xP({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const y=FP({a:h,b:p,backend:s,transposeA:false,transposeB:f,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a}),b=s.texData.get(y.dataId);Ni(b.isPacked,(()=>"batchMatMul result is expected to be packed")),u.shape=d,b.shape=n.outShape,m=nP({inputs:{x:y},backend:s}),m.shape=n.outShape,g.push(y)}else{const l=n.outHeight*n.outWidth,u=xP({inputs:{x:e},backend:s,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),c=xP({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}}),h=FP({a:p?u:c,b:p?c:u,transposeA:!p,transposeB:f,backend:s,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a});m=xP({inputs:{x:h},backend:s,attrs:{shape:n.outShape}}),g.push(u),g.push(c),g.push(h)}for(const e of g)s.disposeIntermediateTensorInfo(e);return m}function cW({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const{filterWidth:l,filterHeight:u,inChannels:c,outWidth:h,outHeight:d,dataFormat:p}=n,f="channelsLast"===p,m=l*u*c,g=d*h,y=[n.batchSize,m,g],b=[];if(null!=i){const e=lW(i.shape,f);null!=e&&(i=xP({inputs:{x:i},backend:s,attrs:{shape:e}}),b.push(i))}if(null!=r){const e=lW(r.shape,f);null!=e&&(r=xP({inputs:{x:r},backend:s,attrs:{shape:e}}),b.push(r))}const w=xP({inputs:{x:t},backend:s,attrs:{shape:[1,m,Di(t.shape)/m]}});b.push(w);const v=new oW(y,n),A=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],x=s.runWebGLProgram(v,[e],"float32",A),C=xP({inputs:{x},backend:s,attrs:{shape:y}});b.push(x),b.push(C);const k=null!=r,S=null!=i,_="leakyrelu"===o,E=o?mP(o,!0):null,I=new gP(f?C.shape:w.shape,f?w.shape:C.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,k,E,S,_),T=f?[C,w]:[w,C];if(r&&T.push(r),S&&T.push(i),_){const e=s.makeTensorInfo([],"float32",Qu(a,"float32"));T.push(e),b.push(e)}const N=s.runWebGLProgram(I,T,"float32"),O=xP({inputs:{x:N},backend:s,attrs:{shape:n.outShape}});b.push(N);for(const e of b)s.disposeIntermediateTensorInfo(e);return O}const hW={kernelName:qa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s,h=pf(l),d=nf(r.shape,i.shape,a,u,o,c,!1,h);let p;if(1!==d.filterHeight||1!==d.filterWidth||1!==d.dilationHeight||1!==d.dilationWidth||1!==d.strideHeight||1!==d.strideWidth||"SAME"!==d.padInfo.type&&"VALID"!==d.padInfo.type)if(d.strideWidth<=2&&"channelsLast"===h&&ca().getBool("WEBGL_EXP_CONV")){const e=new aW(d),t=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];p=n.runWebGLProgram(e,[r,i],"float32",t)}else if(ca().getBool("WEBGL_CONV_IM2COL"))p=cW({x:r,filter:i,convInfo:d,backend:n});else{const e=new rW(d);p=n.runWebGLProgram(e,[r,i],"float32")}else p=uW({x:r,filter:i,convInfo:d,backend:n});const f=xP({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),f}};class dW{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,i="channelsLast"===e.dataFormat;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${i?"float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);":"float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);"}\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class pW{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i="channelsLast"===e.dataFormat,a=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=i?1:2,u=i?2:3,c=i?3:1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n if (${i}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class fW{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.padInfo.front,i=e.padInfo.top,a=e.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yF = 0; yF < ${e.outDepth}; yF++) {\n int xF = wF + yF * ${t} - ${r};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${n} - ${i};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${s} - ${a};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class mW{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=s-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${o}, ${l}, ${u});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${t}; wF++) {\n float dyF = float(dyFCorner + wF) / ${r}.0;\n\n if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${t} - 1 - wF;\n\n for (int wR = 0; wR < ${n}; wR++) {\n float dyR = float(dyRCorner + wR) / ${i}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${n} - 1 - wR;\n\n for (int wC = 0; wC < ${s}; wC++) {\n float dyC = float(dyCCorner + wC) / ${a}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${s} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const gW={kernelName:ja,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:c}=s,h=pf(l),d=nf(r.shape,c,a,1,o,u,!1,h),p=new dW(d);return n.runWebGLProgram(p,[r,i],"float32")}};class yW{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=cz(this.outputShape.length);const t=e.filterHeight,n=e.filterWidth,s=t-1-e.padInfo.top,r=n-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${r});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n int wCPerm = ${n} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}}const bW={kernelName:Ha,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{inputShape:a,strides:o,pad:l,dataFormat:u,dimRoundingMode:c}=s,h=pf(u),d=nf(a,i.shape,o,1,l,c,!1,h);if(ca().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===h){const e=[[d.strideHeight,d.strideWidth]],t=new yW(d);return n.runWebGLProgram(t,[r,i],"float32",e)}{const e=new pW(d);return n.runWebGLProgram(e,[r,i],"float32")}}};const wW={kernelName:$a,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,u=sf(r.shape,i.shape,a,l,o),c=new iW(u);return n.runWebGLProgram(c,[r,i],"float32")}};const vW={kernelName:Ka,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,filterShape:l}=s,u=sf(r.shape,l,a,1,o),c=new fW(u);return n.runWebGLProgram(c,[r,i],"float32")}};const AW={kernelName:Xa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{pad:a,strides:o,inputShape:l}=s,u=sf(l,i.shape,o,1,a),c=new mW(u);return n.runWebGLProgram(c,[r,i],"float32")}},xW=pP({opSnippet:dP+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${eP}\n return result;\n`}),CW={kernelName:Za,backendName:"webgl",kernelFunc:xW},kW=pP({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),SW={kernelName:Ya,backendName:"webgl",kernelFunc:kW};class _W{constructor(e,t,n,s,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[i,a,o,l]=e,[u]=t,[c,h]=n;this.outputShape=[u,c,h,l];const d="bilinear"===s?1:0,[p,f]=[a-1+".0",o-1+".0"],[m,g,y]=c>1?[""+(a-1)/(c-1),"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[b,w,v]=h>1?[""+(o-1)/(h-1),"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n const float height_ratio = float(${m});\n const float width_ratio = float(${b});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${i}) {\n return;\n }\n\n float height_scale = ${g};\n float width_scale = ${w};\n\n float in_y = ${y};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${r}));\n return;\n }\n float in_x = ${v};\n if( in_x < 0.0 || in_x > ${f} ) {\n setOutput(float(${r}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${d} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}}const EW={kernelName:eo,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:u}=s,c=new _W(r.shape,i.shape,o,l,u);return n.runWebGLProgram(c,[r,i,a],"float32")}};var IW;!function(e){e.Prod="*",e.Sum="+"}(IW||(IW={}));class TW{constructor(e,t,n,s){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const r=this.outputShape.length,i=this.op===IW.Prod?"1.0":"0.0",a=n?i:`getX(${NW(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1];let l="",u="";n?(l=s?"end != "+(o-1):"end != 0",u=s?"end + 1":"end - 1"):(l=s?`end + pow2 < ${o}`:"end >= pow2",u=s?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${sz(r)} coords = getOutputCoords();\n int end = ${OW(r,"coords",this.op)};\n float val = ${a};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${u};\n ${OW(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${NW(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function NW(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function OW(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function RW(e,t,n,s,r,i){const a=t.shape.length,o=fm([s],a);let l=t;null!=o&&(l=RP({inputs:{x:t},backend:n,attrs:{perm:o}}));const u=gm(1,a)[0];if(u!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${s}`);const c=l.shape[u];let h=nP({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(c))-1;t++){const s=new TW(e,l.shape,!1,i),r=[[t]],a=h;h=n.runWebGLProgram(s,[h],h.dtype,r),n.disposeIntermediateTensorInfo(a)}if(r){const t=new TW(e,l.shape,r,i),s=h;h=n.runWebGLProgram(t,[h],h.dtype),n.disposeIntermediateTensorInfo(s)}if(null!=o){const e=RP({inputs:{x:h},backend:n,attrs:{perm:mm(o)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(l),e}return h}const DW={kernelName:Qa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return RW(IW.Prod,r,n,i,a,o)}};const MW={kernelName:Ja,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return RW(IW.Sum,r,n,i,a,o)}};const FW={kernelName:to,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a,binaryOutput:o}=s;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(i.dataId),s=Nz(e,t,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,s)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(i),s=Oz(e,t,a,o);return n.makeTensorInfo(s.shape,i.dtype,s.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};class BW{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${t};\n int offset_h = imod(h, ${t});\n int in_w = w / ${t};\n int offset_w = imod(w, ${t});\n int offset_d = (offset_h * ${t} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const zW={kernelName:no,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockSize:i,dataFormat:a}=s,o=r.shape[0],l=("NHWC"===a?r.shape[1]:r.shape[2])*i,u=("NHWC"===a?r.shape[2]:r.shape[3])*i,c=("NHWC"===a?r.shape[3]:r.shape[1])/(i*i),h=new BW("NHWC"===a?[o,l,u,c]:[o,c,l,u],i,a);return n.runWebGLProgram(h,[r],r.dtype)}};class LW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=cz(this.outputShape.length);const i=e.filterHeight,a=e.filterWidth,o=e.outChannels/e.inChannels;let l="",u="";n&&(l=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,u="result = activation(result);");const c=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${l}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${o};\n int q = d2 - d1 * ${o};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${i}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${a}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${u}\n setOutput(result);\n }\n `}}class PW{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=cz(this.outputShape.length);const i=e.outChannels/e.inChannels,a=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,c=e.filterWidth,h=c;let d="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let e=0;e<(h+1)/2;e++){const t=2*e;if(d+=`\n xC = xCCorner + ${t*l};\n `,1===o){if(t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n `,d+=1===l&&t>0?`\n xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${t} = vec4(previous.zw, xTexelC${t}.xy);\n } else {\n xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xC${t} = xTexelC${t};\n `,t+1= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n `,d+=l>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${t+1} = vec4(previous.zw, xTexelC${t+1}.xy);\n } else {\n xC${t+1} = vec4(0.0, 0.0, xTexelC${t+1}.xy);\n }\n `:`\n xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy);\n `):d+=1===e?`\n xC${t+1} = xTexelC${t};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t+1} = xTexelC${t+1};\n `}}else t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n `,t+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(\n xTexelC${t}.xy, xTexelC${t+1}.xy);\n `,t+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${c}'`));const h=nf(r.shape,i.shape,a,c,o,u,!0);let d;d=ca().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?new PW(h):new LW(h);const p=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];return n.runWebGLProgram(d,[r,i],"float32",p)}};class WW{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,i=e.outChannels/e.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${i} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class GW{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=t-1-e.padInfo.top,a=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${o}; dm++) {\n int d2 = d1 * ${o} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const UW={kernelName:ro,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:u,filterShape:c}=s,h=nf(r.shape,c,a,o,l,u,!0),d=new WW(h);return n.runWebGLProgram(d,[r,i],"float32")}};const qW={kernelName:io,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:u,inputShape:c}=s,h=nf(c,i.shape,a,o,l,u,!0),d=new GW(h);return n.runWebGLProgram(d,[r,i],"float32")}};class jW{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}}const HW={kernelName:ao,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=[...s.shape,...s.shape],i=Di(s.shape),a=xP({inputs:{x:s},backend:n,attrs:{shape:[i]}}),o=new jW(i),l=n.runWebGLProgram(o,[a],a.dtype),u=xP({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(l),u}};class $W{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:s,strideHeight:r,strideWidth:i,filterHeight:a,filterWidth:o,dilationHeight:l,dilationWidth:u}=e,{top:c,left:h}=s;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${i});\n const ivec2 pads = ivec2(${c}, ${h});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${a}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${o}; w++) {\n int wIn = wBeg + w * ${u};\n\n if (wIn >= 0 && wIn < ${n}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}}const KW={kernelName:oo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,u=Jp(r.shape,i.shape,a,o,"NHWC",l);let c;const h=new $W(u);c=n.runWebGLProgram(h,[r,i],"float32");const d=xP({inputs:{x:c},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(c),d}};const XW={kernelName:po,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{equation:r}=s,i=t,{allDims:a,summedDims:o,idDims:l}=$w(r,i.length);Xw(a.length,l,i);const{path:u,steps:c}=Zw(o,l),h=c.length;let d=null,p=a.length;const f=[];for(let e=0;e=0&&(d=NP({inputs:{x:d},backend:n,attrs:{axis:u[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},ZW=pP({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),YW={kernelName:fo,backendName:"webgl",kernelFunc:ZW},QW={kernelName:mo,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:s,y:r}=t,i=ca().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new tP("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",s.shape,r.shape):new JL("return (b >= 0.0) ? a : a * (b + 1.0);",s.shape,r.shape);return n.runWebGLProgram(i,[s,r],s.dtype)}},JW=fP({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:Bz}),eG={kernelName:yo,backendName:"webgl",kernelFunc:JW},tG=pP({opSnippet:`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ${Tw};\n float a1 = ${Nw};\n float a2 = ${Ow};\n float a3 = ${Rw};\n float a4 = ${Dw};\n float a5 = ${Mw};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),nG={kernelName:go,backendName:"webgl",kernelFunc:tG},sG=pP({opSnippet:dP+"\n return exp(x);\n",packedOpSnippet:"\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:zz,dtype:"float32"}),rG={kernelName:bo,backendName:"webgl",kernelFunc:sG};function iG(e){const{inputs:t,attrs:n,backend:s}=e,{dim:r}=n,{input:i}=t,a=i.shape.length,o=i.shape.slice();let l=r;return r<0&&(Ni(-(a+1)<=r,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+r+1),o.splice(l,0,1),xP({inputs:{x:i},backend:s,attrs:{shape:o}})}const aG={kernelName:wo,backendName:"webgl",kernelFunc:iG},oG="return exp(x) - 1.0;",lG=pP({opSnippet:oG,packedOpSnippet:oG,cpuKernelImpl:Lz}),uG={kernelName:vo,backendName:"webgl",kernelFunc:lG};class cG{constructor(e,t,n){this.variableNames=["real","imag"];const s=t[1];this.outputShape=t;const r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,i=n?`${s}.0`:"1.0";let a;if("real"===e)a="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);a="return real * expI + imag * expR;"}this.userCode=`\n const float exponentMultiplier = ${r};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${a}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${s});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${s}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${i};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}function hG(e,t,n){const s=n.texData.get(e.dataId),r=Di(e.shape),i=e.shape[e.shape.length-1],a=xP({inputs:{x:e},backend:n,attrs:{shape:[r/i,i]}}),o=a.shape,l=new cG("real",o,t),u=new cG("imag",o,t),c=[{dataId:s.complexTensorInfos.real.dataId,dtype:s.complexTensorInfos.real.dtype,shape:o},{dataId:s.complexTensorInfos.imag.dataId,dtype:s.complexTensorInfos.imag.dtype,shape:o}],h=n.runWebGLProgram(l,c,"float32"),d=n.runWebGLProgram(u,c,"float32"),p=rP({inputs:{real:h,imag:d},backend:n});n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d);const f=xP({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(p),f}const dG={kernelName:Ao,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return hG(s,!1,n)}};class pG{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}}function fG(e){const{backend:t,attrs:n}=e,{shape:s,value:r}=n;let{dtype:i}=n;if(i=i||Ki(r),"string"===i){const e=Ui(i,Di(s));return e.fill(r),t.makeTensorInfo(s,i,e)}{const e=new pG(s,r),n=[[r]];return t.runWebGLProgram(e,[],i,n)}}const mG={kernelName:xo,backendName:"webgl",kernelFunc:fG};class gG{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${t} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${t}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const yG={kernelName:Co,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,s=t,r=new gG(n.shape);return s.runWebGLProgram(r,[n],n.dtype)}},bG="return floor(x);",wG=pP({opSnippet:bG,packedOpSnippet:bG,cpuKernelImpl:Pz}),vG={kernelName:ko,backendName:"webgl",kernelFunc:wG},AG=fP({opSnippet:"\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",packedOpSnippet:"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n",dtype:"int32"}),xG={kernelName:So,backendName:"webgl",kernelFunc:AG};class CG{constructor(e){this.variableNames=["A"];const t=VB(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${s}.0, ${n}.0);\n\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}}class kG{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=VB(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${s}.0, ${n}.0);\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${t.output} = result;\n }\n `}}const SG={kernelName:xu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e;let{pixels:r}=t;const{numChannels:i}=s,a="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,o="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,u]=a?[r.videoWidth,r.videoHeight]:[r.width,r.height],c=[u,l],h=[u,l,i];if(o||a){const e=ca().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=_G&&e===EG||(EG=e,_G=document.createElement("canvas").getContext("2d",{willReadFrequently:EG})),_G.canvas.width=l,_G.canvas.height=u,_G.drawImage(r,0,0,l,u),r=_G.canvas}const d=n.makeTensorInfo(c,"int32");n.texData.get(d.dataId).usage=lB.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),r);const p=ca().getBool("WEBGL_PACK")?new kG(h):new CG(h),f=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),f}};let _G,EG=ca().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const IG={kernelName:Su,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s,m=pf(c),g=nf(r.shape,i.shape,l,h,u,d,!1,m);let y;const b=[],w=null!=a,v=null!=o,A="leakyrelu"===p,x=()=>{const e=[r,i],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=xP({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return b.push(t),t}return e};if(w&&e.push(t(a,c)),v&&e.push(t(o,c)),A){const t=n.makeTensorInfo([],"float32",Qu(f,"float32"));e.push(t),b.push(t)}return e};if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(g.strideWidth<=2&&"channelsLast"===m&&ca().getBool("WEBGL_EXP_CONV")){const e=p?mP(p,!0):null,t=new aW(g,w,e,v,A),s=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=x();y=n.runWebGLProgram(t,r,"float32",s)}else if(ca().getBool("WEBGL_CONV_IM2COL"))y=cW({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});else{const e=p?mP(p,!1):null,t=new rW(g,w,e,v,A),s=x();y=n.runWebGLProgram(t,s,"float32")}else y=uW({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});const C=xP({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return b.push(y),b.forEach((e=>n.disposeIntermediateTensorInfo(e))),C}};const TG={kernelName:_u,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:c,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=s,f=[];let m=c;null==m&&(m=[1,1]),Ni(hf(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=nf(r.shape,i.shape,l,m,u,h,!0),y=ca().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,b=d?mP(d,y):null,w=[r,i],v=null!=a,A=null!=o,x="leakyrelu"===d;if(v&&w.push(a),A&&w.push(o),x){const e=n.makeTensorInfo([],"float32",Qu(p,"float32"));w.push(e),f.push(e)}let C;C=y?new PW(g,v,b,A,x):new LW(g,v,b,A,x);const k=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],S=n.runWebGLProgram(C,w,"float32",k);return f.forEach((e=>n.disposeIntermediateTensorInfo(e))),S}};class NG{constructor(e,t,n,s){this.sliceDim=e,this.strides=t,this.paramsShape=s,this.variableNames=["x","indices"],this.outputShape=n;const r=sz(n.length);let i="\n int index;";for(let e=0;e= ${this.paramsShape[e]};\n flattenIndex += index * ${this.strides[e]};`;this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${i}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const OG={kernelName:Io,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:s,indices:r}=t,i=r.shape,a=i[i.length-1],o=Di(s.shape),[l,u,c,h]=_w(s,r),d=xP({inputs:{x:r},backend:n,attrs:{shape:[u,a]}}),p=xP({inputs:{x:s},backend:n,attrs:{shape:[Di(s.shape)/c,c]}});if(n.shouldExecuteOnCPU([s,r])||"string"===s.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(s),i=Vz(e,t,s.dtype,u,a,c,h,s.shape,o);return n.makeTensorInfo(l,s.dtype,i.values)}const f=new NG(a,h,[u,c],s.shape),m=n.runWebGLProgram(f,[p,d],p.dtype),g=xP({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}};class RG{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=sz(this.rank),s=function(e,t){const n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[];for(let t=0;t= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${s}));\n }\n `}}function DG(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,indices:i}=t,{axis:a,batchDims:o}=s,l=Vi(a,r.shape)[0];if(ca().get("DEBUG")){const e=n.readSync(i.dataId),t=r.shape[l];for(let n=0;n=0,(()=>`GatherV2: the index value ${s} is not in [0, ${t-1}]`))}}const u=fv(r,i,l,o),c=Di(i.shape),h=[],d=xP({inputs:{x:r},backend:n,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),p=xP({inputs:{x:i},backend:n,attrs:{shape:[u.batchSize,c/u.batchSize]}});h.push(d),h.push(p);const f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(n.shouldExecuteOnCPU([r,i])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(d),s=Wz(t,e,f);return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u.outputShape,s.dtype,s.values)}const m=new RG(d.shape,f),g=n.runWebGLProgram(m,[d,p],d.dtype);h.push(g);const y=xP({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}const MG={kernelName:Eo,backendName:"webgl",kernelFunc:DG},FG=fP({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:Gz,dtype:"bool"}),BG={kernelName:To,backendName:"webgl",kernelFunc:FG},zG=fP({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:Uz}),LG={kernelName:No,backendName:"webgl",kernelFunc:zG};const PG={kernelName:Ro,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return hG(s,!0,n)}},VG=pP({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),WG={kernelName:Mo,backendName:"webgl",kernelFunc:VG},GG=pP({opSnippet:"return float(isinf(x));",dtype:"bool"}),UG={kernelName:Fo,backendName:"webgl",kernelFunc:GG},qG=pP({opSnippet:"return float(isnan(x));",dtype:"bool"}),jG={kernelName:Bo,backendName:"webgl",kernelFunc:qG},HG=fP({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:qz,dtype:"bool"}),$G={kernelName:Lo,backendName:"webgl",kernelFunc:HG},KG=fP({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:jz,dtype:"bool"}),XG={kernelName:Po,backendName:"webgl",kernelFunc:KG};const ZG={kernelName:Vo,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:s,stop:r,num:i}=n,a=Hz(s,r,i);return t.makeTensorInfo([a.length],"float32",a)}},YG=pP({opSnippet:dP+"\n return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n",cpuKernelImpl:$z}),QG={kernelName:Wo,backendName:"webgl",kernelFunc:YG},JG=pP({opSnippet:dP+"\n return log(1.0 + x);\n"}),eU={kernelName:Go,backendName:"webgl",kernelFunc:JG},tU=fP({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),nU={kernelName:Uo,backendName:"webgl",kernelFunc:tU},sU=pP({opSnippet:"return float(!(x >= 1.0));"}),rU={kernelName:qo,backendName:"webgl",kernelFunc:sU},iU=fP({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),aU={kernelName:jo,backendName:"webgl",kernelFunc:iU};class oU{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[];const i=t,a=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${i}; j <= ${i}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${a}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${o};\n setOutput(val);\n }\n `}}class lU{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const i=t,a=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${i};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${i}; j <= ${i}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${a}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${o};\n setOutput(result);\n }\n `}}const uU={kernelName:Ho,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s,u=ca().getBool("WEBGL_PACK_NORMALIZATION")?new lU(r.shape,i,a,o,l):new oU(r.shape,i,a,o,l);return n.runWebGLProgram(u,[r],r.dtype)}};class cU{constructor(e,t,n,s,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=s,this.beta=r,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${t})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${t} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${s}) * norm + float(${n});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${s})\n * float(${r})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${r});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}}const hU={kernelName:$o,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r,y:i,dy:a}=t,{depthRadius:o,bias:l,alpha:u,beta:c}=s,h=new cU(r.shape,o,l,u,c);return n.runWebGLProgram(h,[r,i,a],r.dtype)}};function dU(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=r.shape.length,l=Vi(i,r.shape);let u=l;const c=fm(u,o),h=null!=c,d=n.shouldExecuteOnCPU([r]);let p=r;if(h){if(d){const e=n.texData.get(p.dataId).values,t=new Array(o);for(let e=0;e`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const u=ef(r.shape,i,a,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Mi(u.inShape,u.outShape))return nP({inputs:{x:r},backend:n});const c=new fV(u,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}};const yU={kernelName:Qo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dataFormat:l,dimRoundingMode:u}=s,c=tf(r.shape,i,a,[1,1,1],o,u,l),h=new mV(c,"max",!1);return n.runWebGLProgram(h,[r],r.dtype)}};class bU{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,s=e.dilationHeight,r=e.effectiveFilterHeight,i=e.effectiveFilterWidth,a=r-1-e.padInfo.top,o=i-1-e.padInfo.left,l=r*i-1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${r};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${t}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${i}; wC++) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${i} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class wU{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.dilationDepth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=u-1-e.padInfo.left,p=o*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${h}, ${d});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${o};\n wD += ${r}) {\n float dyD = float(dyDCorner + wD) / ${t}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${l};\n wR += ${i}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC += ${a}) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${p} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${l} * ${u} +\n wR * ${u} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const vU={kernelName:Jo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=tf(a.shape,o,l,[1,1,1],u,c),d=new mV(h,"max",!0),p=n.runWebGLProgram(d,[a],a.dtype),f=new wU(h),m=n.runWebGLProgram(f,[r,p],a.dtype);return n.disposeIntermediateTensorInfo(p),m}};const AU={kernelName:Yo,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;LB([i,a],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=ef(o.shape,l,u,1,c,h),p=new fV(d,"max",!0),f=n.runWebGLProgram(p,[o],o.dtype),m=new bU(d),g=n.runWebGLProgram(m,[r,f],o.dtype);return n.disposeIntermediateTensorInfo(f),g}};const xU={kernelName:el,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;Ni(4===s.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${s.shape.length}.`));const u=[1,1];Ni(hf(i,u),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`));const c=ef(s.shape,r,i,u,a),[h,d]=function(e,t,n,s){let r=new fV(n,"max",!1);const i=s.runWebGLProgram(r,[e],"float32");return r=new fV(n,"max",!0,!0,t),[i,s.runWebGLProgram(r,[e],"float32")]}(s,o,c,l);return[h,d]}};const CU={kernelName:tl,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{keepDims:r,axis:i}=t,a=n,o=s.shape.length,l=Vi(i,s.shape);let u=l;const c=fm(u,o),h=null!=c,d=a.shouldExecuteOnCPU([s]),p=[];let f=s;if(h){if(d){const e=a.texData.get(f.dataId).values,t=new Array(o);for(let e=0;et[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s),l="reflect"===n?0:1;this.userCode=1!==s?`\n ${r} start = ${r}(${i});\n ${r} end = ${r}(${a});\n\n void main() {\n ${r} outC = getOutputCoords();\n for (int i = 0; i < ${s}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${l};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n }\n }\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n `:`\n int start = ${i};\n int end = ${a};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${l};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${l};\n }\n setOutput(getX(outC - start));\n }\n `}}class IU{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=SL("rc",s),l=SL("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h="reflect"===n?0:1;let d="";if(1===s){const e=`\n ${r} source = rc;\n if (source < start) {\n source = start * 2 - source - ${h};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${h};\n }\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n `}else{const e=`\n ${r} source = rc;\n ${r} lt = ${r}(lessThan(source, start));\n ${r} gte = ${r}(greaterThanEqual(source, end));\n ${r} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${h}) +\n gte * ((end - 1) * 2 - source + ${h});\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {\n ${e}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${i});\n const ${r} end = ${r}(${a});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}}const TU={kernelName:rl,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s}=e,{paddings:r,mode:i}=n,a=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new IU(s.shape,r,i):new EU(s.shape,r,i);return t.runWebGLProgram(a,[s],s.dtype)}},NU=fP({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n "+eP+"\n return result;\n"}),OU={kernelName:il,backendName:"webgl",kernelFunc:NU};class RU{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,n],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${t-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${t-1}));\n }\n `}}const DU=fP({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),MU={kernelName:ho,backendName:"webgl",kernelFunc:DU},FU="return a - b;",BU=fP({opSnippet:FU,packedOpSnippet:FU,supportsComplex:!0,cpuKernelImpl:wL}),zU={kernelName:cu,backendName:"webgl",kernelFunc:BU};function LU(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=Vi([i],r.shape),o=dU({inputs:{x:r},backend:n,attrs:{reductionIndices:a,keepDims:!1}}),l=dm(o.shape,a),u=xP({inputs:{x:o},backend:n,attrs:{shape:l}}),c=BU({inputs:{a:r,b:u},backend:n}),h=sG({inputs:{x:c},backend:n}),d=NP({inputs:{x:h},backend:n,attrs:{axis:a,keepDims:!1}}),p=xP({inputs:{x:d},backend:n,attrs:{shape:l}}),f=DU({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),f}const PU={kernelName:Yl,backendName:"webgl",kernelFunc:LU};const VU={kernelName:al,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s,l=o?r:LU({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],c=l.shape[1],h=new RU(u,c,i),d=[[a]],p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}},WU=DL+"\n return -x;\n";const GU={kernelName:ll,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])){const e=n.texData.get(s.dataId),[t,r]=Qz(e.values,s.shape,s.dtype);return n.makeTensorInfo(r,s.dtype,t)}let r;return r=ca().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new HL(s.shape,"\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"):new RL(s.shape,WU),n.runWebGLProgram(r,[s],s.dtype)}},UU=yb;const qU={kernelName:cl,backendName:"webgl",kernelFunc:function(e){Eu();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=s,u=n.readSync(r.dataId),c=n.readSync(i.dataId),{selectedIndices:h}=UU(u,c,a,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}},jU=bb;const HU={kernelName:hl,backendName:"webgl",kernelFunc:function(e){Eu();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:u}=s,c=n.readSync(r.dataId),h=n.readSync(i.dataId),{selectedIndices:d,validOutputs:p}=jU(c,h,a,o,l,u);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},$U=wb;const KU={kernelName:dl,backendName:"webgl",kernelFunc:function(e){Eu();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=s,c=n.readSync(r.dataId),h=n.readSync(i.dataId),d=a,p=o,f=l,m=u,{selectedIndices:g,selectedScores:y}=$U(c,h,d,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class XU{constructor(e,t,n,s){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${s}), float(${n}),\n float(index == coords.y)));\n }\n `}}const ZU={kernelName:fl,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s,u=Di(r.shape),c=new XU(u,a,o,l),h=xP({inputs:{x:r},backend:n,attrs:{shape:[u]}}),d=n.runWebGLProgram(c,[h],i);n.disposeIntermediateTensorInfo(h);const p=xP({inputs:{x:d},backend:n,attrs:{shape:[...r.shape,a]}});return n.disposeIntermediateTensorInfo(d),p}};function YU(e){const{inputs:t,backend:n}=e,{x:s}=t;if("complex64"===s.dtype){const e=zV({inputs:{input:s},backend:n}),t=YU({inputs:{x:e},backend:n}),r=JV({inputs:{input:s},backend:n}),i=YU({inputs:{x:r},backend:n}),a=rP({inputs:{real:t,imag:i},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(i),a}return fG({attrs:{shape:s.shape,dtype:s.dtype,value:"string"===s.dtype?"":0},backend:n})}const QU={kernelName:vu,backendName:"webgl",kernelFunc:YU};const JU={kernelName:pl,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===r.dtype){const t=zV({inputs:{input:r},backend:s}),n=e({inputs:{x:t},backend:s}),i=JV({inputs:{input:r},backend:s}),a=YU({inputs:{x:i},backend:s}),o=rP({inputs:{real:n,imag:a},backend:s});return s.disposeIntermediateTensorInfo(t),s.disposeIntermediateTensorInfo(n),s.disposeIntermediateTensorInfo(i),s.disposeIntermediateTensorInfo(a),o}return fG({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:s})}};const eq={kernelName:ml,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s;if(1===t.length)return iG({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const i=t[0].shape,a=t[0].dtype;t.forEach((e=>{Oi(i,e.shape,"All tensors passed to stack must have matching shapes"),Ni(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=nW({inputs:t.map((e=>{const t=iG({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}};class tq{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s);this.userCode=1!==s?`\n ${r} start = ${r}(${i});\n ${r} end = ${r}(${a});\n\n void main() {\n ${r} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n }\n `:`\n int start = ${i};\n int end = ${a};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `}}class nq{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=sz(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=SL("rc",s),l=SL("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h=[`${r} rc = outputLoc;`,`${o[s-1]} += 1;\n if(${u}) {\n `,1===s?"":`}\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {`,1===s?"":` ${o[s-1]} += 1;\n if(${u}) {`],d=1===s?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let e=0,t=1===s?2:4;e{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,constantValue:a}=s;if(0===Di(r.shape)){const e=i.map(((e,t)=>e[0]+r.shape[t]+e[1]));return fG({backend:n,attrs:{shape:e,value:a,dtype:r.dtype}})}const o=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new nq(r.shape,i,a):new tq(r.shape,i,a),l=[[a]];return n.runWebGLProgram(o,[r],r.dtype,l)},rq={kernelName:gl,backendName:"webgl",kernelFunc:sq},iq=fP({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n "+eP+"\n return result;\n"}),aq={kernelName:yl,backendName:"webgl",kernelFunc:iq};const oq={kernelName:wl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=[],u=Vi(i,r.shape);let c=u;const h=fm(c,o);let d,p=r;if(null!=h&&(p=RP({inputs:{x:r},backend:n,attrs:{perm:h}}),c=gm(c.length,o),l.push(p)),pm("prod",c,o),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:s,outDtype:r}=eL(p.shape,p.dtype,e,c);d=n.makeTensorInfo(s,r,t)}else{const[e,t]=hm(p.shape,c),s=Di(t),i=xP({inputs:{x:p},backend:n,attrs:{shape:[-1,s]}}),a=_P(i,Nc(r.dtype),"prod",n);d=xP({inputs:{x:a},backend:n,attrs:{shape:e}}),l.push(i),l.push(a)}if(a){l.push(d);const e=dm(d.shape,u);d=xP({inputs:{x:d},backend:n,attrs:{shape:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),d}};const lq={kernelName:vl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.readSync(e.dataId))),u=r.map((e=>e.shape)),c=n.readSync(i.dataId),h=n.readSync(a.dataId),[d,p,f]=tL(l,u,c,i.shape,i.dtype,h,a.shape,o),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}};const uq={kernelName:Al,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{starts:s,limits:r,deltas:i}=t,a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[u,c]=nL(a,s.shape,s.dtype,o,r.shape,l,i.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],s.dtype,c)]}};const cq={kernelName:xl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.readSync(r.dataId),c=n.readSync(i.dataId),h=n.readSync(a.dataId),d=o.map((e=>n.readSync(e.dataId))),p=o.map((e=>e.shape)),[f,m]=sL(u,r.shape,c,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}},hq=e=>{const{backend:t,attrs:n}=e,{start:s,stop:r,step:i,dtype:a}=n,o=rL(s,r,i,a);return t.makeTensorInfo([o.length],a,o)},dq={kernelName:Cl,backendName:"webgl",kernelFunc:hq},pq=pP({opSnippet:"return 1.0 / x;"}),fq={kernelName:Sl,backendName:"webgl",kernelFunc:pq},mq=pP({opSnippet:DL+"\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),gq={kernelName:_l,backendName:"webgl",kernelFunc:mq},yq=pP({opSnippet:DL+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),bq={kernelName:Rl,backendName:"webgl",kernelFunc:yq};class wq{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${a}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}}class vq{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${a}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}}const Aq={kernelName:Nl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,u]=o,c=ca().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new vq(r.shape,l,u,i,a):new wq(r.shape,l,u,i,a);return n.runWebGLProgram(c,[r],"float32")}};class xq{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${i}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${a}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${s-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const Cq={kernelName:Ol,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new xq(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class kq{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${a}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}}class Sq{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const u=[s&&t>1?a-1:a,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${a}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}}const _q={kernelName:Il,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,u]=o,c=ca().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Sq(r.shape,l,u,i,a):new kq(r.shape,l,u,i,a);return n.runWebGLProgram(c,[r],r.dtype)}};class Eq{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${i}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${a}) {\n continue;\n }\n\n float sourceFracRow =\n float(${o[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${o[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${s}) - 1),\n ${n} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${r}) - 1),\n ${n} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const Iq={kernelName:Tl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new Eq(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class Tq{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,1===n)return void(this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${e[0]} - coord - 1));\n }\n `);const s=e.map(((n,s)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(s))).join(","),r=sz(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}}class Nq{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;const s=SL("rc",n),r=`${s[n-1]} + 1 < ${this.outputShape[n-1]}`,i=`${s[n-2]} + 1 < ${this.outputShape[n-2]}`,a=sz(n);function o(n){const s=e.map(((s,r)=>function(n,s){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${s[n]} - 1`:`${s[n]}`}(r,n)));return`getChannel(getX(${s.join(",")}), vec2(${s.slice(-2).join(",")}))`}this.userCode=1===n?`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${e[0]} - rc - 1),\n ${e[0]} - rc - 1);\n if(${r}){\n result.g = getChannel(getX(${e[0]} - (rc + 1) - 1),\n ${e[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:`\n void main() {\n ${a} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(e){return o(e)}(s.slice())};\n if(${r}){\n result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",o(e)}(s.slice())};\n }\n if(${i}) {\n result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n if(${r}) {\n result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n }\n }\n setOutput(result);\n }\n `}}const Oq={kernelName:Dl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s,a=r.shape.length,o=Vi(i,r.shape);if(0===a)return nP({inputs:{x:r},backend:n});const l=ca().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Nq(r.shape,o):new Tq(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}};class Rq{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],s=e[2];this.outputShape=e;let r="";r="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n vec3 fill = vec3(${t.join(",")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${r}\n if(coordX >= 0 && coordX < ${s} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const Dq={kernelName:Cu,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=new Rq(s.shape,i),[u,c]=vw(a,s.shape[1],s.shape[2]),h=[[u,c,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[s],s.dtype,h)}},Mq=pP({opSnippet:"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"}),Fq={kernelName:Ml,backendName:"webgl",kernelFunc:Mq},Bq=pP({opSnippet:"return inversesqrt(x);",cpuKernelImpl:iL}),zq={kernelName:Fl,backendName:"webgl",kernelFunc:Bq};class Lq{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=i;const l=sz(r.length),u=sz(i.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${e}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${t}; j++) {\n int index = round(${h});\n flattenedIndex += index * ${g};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${p};\n found = true;\n }\n }\n setOutput(mix(${m}, sum, float(found)));\n }\n `}}class Pq{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=i;const l=sz(r.length),u=sz(i.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides",y=t>1?"strides[j + 1]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${e}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${t}; j+=2) {\n ivec4 index = round(${h});\n flattenedIndex += index.xz * ${g};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${y};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${p};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${m}, sum, found));\n }\n `}}const Vq={kernelName:Bl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r,updates:i}=t,{shape:a}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Ey(0,r,a),d=[h/u,u];if(0===h)return n.makeTensorInfo(a,r.dtype);const p=xP({inputs:{x:r},backend:n,attrs:{shape:[l,o]}}),f=xP({inputs:{x:i},backend:n,attrs:{shape:[l,u]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=ca().getBool("WEBGL_PACK")?new Pq(l,o,p.shape.length,f.shape.length,c,d):new Lq(l,o,p.shape.length,f.shape.length,c,d);const y=n.runWebGLProgram(g,[f,p,m],f.dtype),b=xP({inputs:{x:y},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(m),b}};class Wq{constructor(e,t,n,s){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,n];const r=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,i=2===ca().getNumber("WEBGL_VERSION")?"while (left < right) {":r,a="left"===s?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${i}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${a} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}}const Gq={kernelName:Ll,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sortedSequence:r,values:i}=t,{side:a}=s,o=new Wq(r.shape[0],r.shape[1],i.shape[1],a),l=[[r.shape[1]]];return n.runWebGLProgram(o,[r,i],"int32",l)}};class Uq{constructor(e,t,n){let s,r;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)r="resRC",s="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],a=[];for(let s=0;s= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const qq={kernelName:Pl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:s,t:r,e:i}=t,a=new Uq(s.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(a,[s,r,i],Tc(r.dtype,i.dtype))}},jq=pP({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${Ew};\n float scale = ${Iw};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),Hq={kernelName:Vl,backendName:"webgl",kernelFunc:jq},$q=pP({opSnippet:dP+"\n return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:oL}),Kq={kernelName:jl,backendName:"webgl",kernelFunc:$q},Xq=pP({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),Zq={kernelName:ql,backendName:"webgl",kernelFunc:Xq},Yq=pP({opSnippet:dP+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${eP}\n return result;\n`}),Qq={kernelName:Gl,backendName:"webgl",kernelFunc:Yq},Jq=pP({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),ej={kernelName:Ul,backendName:"webgl",kernelFunc:Jq},tj=pP({opSnippet:"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"}),nj={kernelName:Hl,backendName:"webgl",kernelFunc:tj},sj={kernelName:Xl,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,paddings:a}=s;Ni(r.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=[[0,0]];l.push(...a);for(let e=1+i.length;en.disposeIntermediateTensorInfo(e))),g}};const rj={kernelName:Ql,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:s,values:r,denseShape:i,defaultValue:a}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${i.shape}`);if(2!==s.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${s.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==a.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${a.shape}`);const o=n.readSync(s.dataId),l=n.readSync(r.dataId),u=n.readSync(i.dataId),c=n.readSync(a.dataId)[0],[h,d,p,f,m]=cL(o,s.shape,s.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(d,s.dtype,h),n.makeTensorInfo([d[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map((e=>Number(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};const ij={kernelName:Jl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:s,inputShape:r,newShape:i}=t;if(2!==s.shape.length)throw new Error(`Input indices should be a matrix but received shape ${s.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(1!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const a=Array.from(n.readSync(r.dataId)),o=n.readSync(s.dataId),l=Array.from(n.readSync(i.dataId)),[u,c,h]=hL(o,s.shape,s.dtype,a,l);return[n.makeTensorInfo(c,s.dtype,u),n.makeTensorInfo([h.length],i.dtype,new Int32Array(h))]}};const aj={kernelName:eu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[u,c]=dL(a,s.shape,s.dtype,o,l,!0);return n.makeTensorInfo(c,s.dtype,u)}};const oj={kernelName:tu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[u,c]=dL(a,s.shape,s.dtype,o,l);return n.makeTensorInfo(c,s.dtype,u)}};const lj={kernelName:nu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sparseIndices:r,sparseValues:i,defaultValue:a}=t,{outputShape:o}=s,{sliceRank:l,numUpdates:u,sliceSize:c,strides:h,outputSize:d}=Ey(0,r,o),p=!1;if("string"===i.dtype){const e=n.bufferSync(r),t=n.bufferSync(i),s=nc(n.readSync(a.dataId)[0]),f=aL(e,t,o,d,c,u,l,h,s,p);return n.makeTensorInfo(o,f.dtype,f.values)}const f=new Lq(u,l,r.shape.length,i.shape.length,h,[d,1],p),m=n.runWebGLProgram(f,[i,r,a],i.dtype),g=xP({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),g}};const uj={kernelName:Zl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{numOrSizeSplits:i,axis:a}=s,o=Vi(a,r.shape)[0],l=Jw(r,i,o),u=r.shape.length,c=new Array(u).fill(0),h=r.shape.slice();return l.map((e=>{const t=[...h];t[o]=e;const s=TV({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[o]+=e,s}))}},cj="return sqrt(x);",hj=pP({opSnippet:cj,packedOpSnippet:cj,cpuKernelImpl:pL}),dj={kernelName:$l,backendName:"webgl",kernelFunc:hj},pj={kernelName:ru,backendName:"webgl",kernelFunc:pP({opSnippet:"return x * x;"})},fj="return (a - b) * (a - b);",mj=fP({opSnippet:fj,packedOpSnippet:fj}),gj={kernelName:su,backendName:"webgl",kernelFunc:mj};const yj={kernelName:iu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;if("string"!==r.dtype)throw new Error("Input must be of datatype string");const i=mv(n.readSync(r.dataId)),a=fL(i,"string",s);return n.makeTensorInfo(r.shape,"string",a)}};const bj={kernelName:Au,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:n}){const{x:s}=e,r=DL+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,i=new RL(s.shape,r);return n.runWebGLProgram(i,[s],s.dtype)}};class wj{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const s=n.length,r=sz(n.length),i=sz(n.length);let a="";if(1===s)a="coords * strides + begin";else{let e=0;a=n.map(((t,s)=>(e++,1===n.length?`coords * strides[${s}] + begin[${s}]`:`coords[${e-1}] * strides[${s}] + begin[${s}]`))).join(",")}this.userCode=`\n ${r} begin = ${r}(${e});\n ${r} strides = ${r}(${t});\n\n void main() {\n ${i} coords = getOutputCoords();\n setOutput(getX(${a}));\n }\n `}}const vj={kernelName:au,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,end:a,strides:o,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:h,shrinkAxisMask:d}=s,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:b,end:w,strides:v}=Pp(r.shape,i,a,o,l,u,c,h,d);let A;if(m)A=xP({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||y){Ni(r.shape.length>=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=_p(b,w,v),t=TV({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=xP({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=fd(r.shape,r.dtype,e),s=mL(p,t,v,b);A=n.makeTensorInfo(f,r.dtype,s.values)}else{const e=new wj(b,v,p);A=n.runWebGLProgram(e,[r],r.dtype)}}const x=xP({inputs:{x:A},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(A),x}};const Aj={kernelName:ou,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.readSync(c.dataId),p=n.readSync(h.dataId),[f,m]=gL(d,p,r,i,a,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};const xj={kernelName:lu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{skipEmpty:r}=s,{input:i,delimiter:a}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==a.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);const o=n.readSync(i.dataId),l=n.readSync(a.dataId)[0],[u,c,h]=yL(o,l,r),d=c.length;return[n.makeTensorInfo([d,2],"int32",u),n.makeTensorInfo([d],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(h))]}};const Cj={kernelName:uu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{numBuckets:r}=s,{input:i}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const a=n.readSync(i.dataId),o=bL(a,r);return n.makeTensorInfo(i.shape,"int32",o)}},kj=pP({opSnippet:"return tan(x);"}),Sj={kernelName:hu,backendName:"webgl",kernelFunc:kj},_j=pP({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),Ej={kernelName:du,backendName:"webgl",kernelFunc:_j};const Ij={kernelName:zl,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{tensor:r,indices:i,updates:a}=t,{}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Ey(0,i,r.shape),d=[h/u,u];if(0===h)return n.makeTensorInfo(r.shape,i.dtype);const p=xP({inputs:{x:i},backend:n,attrs:{shape:[l,o]}}),f=xP({inputs:{x:a},backend:n,attrs:{shape:[l,u]}}),m=xP({inputs:{x:r},backend:n,attrs:{shape:d}}),g=new Lq(l,o,p.shape.length,f.shape.length,c,d,!1,!0),y=n.runWebGLProgram(g,[f,p,m],m.dtype),b=xP({inputs:{x:y},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),b}};class Tj{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let s=0;s5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],s=[];for(let t=0;t5){const e=n.readSync(r.dataId),t="string"===r.dtype?e.map((e=>nc(e))):e,s=fd(r.shape,r.dtype,t),a=vL(s,i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}const a=new Tj(r.shape,i);return n.runWebGLProgram(a,[r],r.dtype)}const Oj={kernelName:pu,backendName:"webgl",kernelFunc:Nj};class Rj{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "}}class Dj{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "}}function Mj(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function Fj(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,s]=AL(e,u,r.dtype,i,a);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(s.shape,s.dtype,s.values)]}if(0===i)return u[u.length-1]=0,[n.makeTensorInfo(u,r.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===c)return[r,fG({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const h=n.texData.get(r.dataId),d=null!==h&&h.isPacked,p=d?n.unpackTensor(r):r,f=Di(u)/c,m=xP({inputs:{x:p},attrs:{shape:[f,c]},backend:n});d&&Mj(n,p);const g=Fj(i),y=Fj(c);let b=null;const w=()=>null===b?[m,m]:[m,b],v=(e,t,s)=>{const r=w(),i=new Rj(s),a=[[c],[null===b?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],o=b;b=n.runWebGLProgram(i,r,"int32",a),Mj(n,o)};for(let e=1;e=1;n/=2)v(t,n,[f,y])}for(let e=y;e>g;e/=2){const t=w(),s=new Dj([f,e/2]),r=[[c],[null===b?1:0],[g]],i=b;b=n.runWebGLProgram(s,t,"int32",r),Mj(n,i);const a=g/2,o=2*a;for(let e=a;e>=1;e/=2)v(o,e,b.shape)}let A=b;b=TV({inputs:{x:b},backend:n,attrs:{begin:0,size:[f,i]}}),Mj(n,A);let x=DG({inputs:{x:m,indices:b},backend:n,attrs:{axis:1,batchDims:1}});Mj(n,m);const C=u.slice(0,-1);C.push(i),A=b,b=xP({inputs:{x:b},attrs:{shape:C},backend:n}),Mj(n,A);const k=x;return x=xP({inputs:{x},attrs:{shape:C},backend:n}),Mj(n,k),[x,b]}};class zj{constructor(e,t,n,s,r,i){this.variableNames=["Image","Transforms"],this.outputShape=i;const a="nearest"===n?1:2;let o;switch(s){case"constant":default:o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${o} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${r});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${r});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${t}));\n float mapY = mapCoord(inY, float(${e}));\n\n if (${a} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}}const Lj={kernelName:mu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,transforms:i}=t,{interpolation:a,fillMode:o,fillValue:l,outputShape:u}=s,[c,h,d,p]=r.shape,[f,m]=null!=u?u:[h,d],g=new zj(h,d,a,o,l,[c,f,m,p]);return n.runWebGLProgram(g,[r,i],"float32")}};const Pj={kernelName:yu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{axis:r}=n,{x:i}=t;LB(i,"unique");const a=s.readSync(i.dataId),{outputValues:o,outputShape:l,indices:u}=CL(a,r,i.shape,i.dtype);return[s.makeTensorInfo(l,i.dtype,o),s.makeTensorInfo([u.length],"int32",u)]}};const Vj={kernelName:bu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{value:r}=t;let{axis:i}=s;i<0&&(i+=r.shape.length);const a=r,o=a.shape.length,l=r.shape[i],u=new Array(o-1);let c=0;for(let e=0;en.disposeIntermediateTensorInfo(e))),f}};class Wj{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,s=e.batchSize,r=e.inSize,i=e.numSegments,a=i*Math.ceil(r/n);this.outputShape=[s,a];const o=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ";let c="";r%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `);let h="";r%n>0&&(h=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${h}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${i})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${i})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${o}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${o};\n if (${1===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}const Gj={kernelName:wu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,segmentIds:i}=t,{numSegments:a}=s,o=r.shape.length,l=[];let u=0;const c=fm([u],o);let h=r;null!=c&&(h=RP({inputs:{x:r},backend:n,attrs:{perm:c}}),l.push(h),u=gm(1,o)[0]);const d=pv(h.shape,u,a),p=Di([h.shape[u]]),f=xP({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=Nc(r.dtype),g=(e,t,s,r,i)=>{const a=e.shape[0],o=e.shape[1],u=dv(o,i),c=new Wj({windowSize:u,inSize:o,batchSize:a,numSegments:i},t),h=n.compileAndRun(c,[e,s],r);if(l.push(h),h.shape[1]===i)return h;const d=hq({backend:n,attrs:{start:0,stop:i,step:1,dtype:"float32"}}),p=Nj({inputs:{x:d},backend:n,attrs:{reps:[o/u]}});l.push(d),l.push(p);return g(h,t,p,r,i)},y=xP({inputs:{x:g(f,"unsortedSegmentSum",i,m,a)},backend:n,attrs:{shape:d}});let b=y;if(null!=c){l.push(y);const e=mm(c);b=RP({inputs:{x:b},backend:n,attrs:{perm:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),b}},Uj=[BP,LP,VP,GP,jP,KP,XP,ZP,nV,sV,iV,oV,uV,hV,pV,gV,yV,vV,AV,xV,SV,OV,RV,DV,MV,VV,UV,HV,iP,XV,sW,hW,gW,bW,wW,vW,AW,CW,SW,EW,DW,MW,FW,zW,VW,UW,qW,HW,KW,XW,YW,QW,eG,nG,rG,aG,uG,dG,mG,yG,vG,xG,SG,IG,TG,OG,MG,BG,LG,sP,PG,eW,WG,UG,jG,lP,$G,XG,ZG,QG,eU,nU,rU,aU,uU,hU,pU,mU,gU,yU,vU,AU,xU,CU,kU,_U,TU,OU,VU,AP,GU,qU,HU,KU,BV,ZU,JU,eq,rq,aq,hP,oq,lq,uq,cq,dq,LV,MU,fq,gq,bq,CP,Aq,Cq,_q,Iq,Oq,Dq,Fq,zq,Vq,Gq,qq,Hq,Kq,Zq,Qq,ej,NV,PU,nj,sj,rj,ij,aj,oj,lj,uj,dj,pj,gj,yj,bj,vj,Aj,xj,Cj,zU,OP,Sj,Ej,Ij,Oj,Bj,Lj,DP,Pj,Vj,Gj,QU];for(const e of Uj)Mu(e);__webpack_require__(9464);const qj={moveTickSize:50,videoContainerId:"webgazerVideoContainer",videoElementId:"webgazerVideoFeed",videoElementCanvasId:"webgazerVideoCanvas",faceOverlayId:"webgazerFaceOverlay",faceFeedbackBoxId:"webgazerFaceFeedbackBox",gazeDotId:"webgazerGazeDot",videoViewerWidth:320,videoViewerHeight:240,faceFeedbackBoxRatio:.66,showVideo:!0,mirrorVideo:!0,showFaceOverlay:!0,showFaceFeedbackBox:!0,showGazeDot:!0,camConstraints:{video:{width:{min:320,ideal:640,max:1920},height:{min:240,ideal:480,max:1080},facingMode:"user"}},dataTimestep:50,showVideoPreview:!0,applyKalmanFilter:!0,saveDataAcrossSessions:!0,storingPoints:!1,videoIsOn:!1,trackEye:"both"};__webpack_require__(6003);var jj=__webpack_require__(7350),Hj=__webpack_require__.n(jj),$j=__webpack_require__(8990),Kj=function(){return Kj=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]>>0)+"_",r=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(s+(n||"")+"_"+r++,n)}})),r("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a(t=t||0)&&(t=Math.max(t+s,0));t>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=u+a+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function F(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<6&192|o))}}(e,(function(e){s[r++]=e})),r!==n?s.subarray(0,r):s}function B(){if(!D){D={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));R[n]=s;for(var r=0;re.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function K(e){var t=e.h,n=t[e.g],s=127&n;if(128>n)return e.g+=1,$(e),s;if(s|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,$(e),s;if(s|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,$(e),s;if(s|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,$(e),s;if(n=t[e.g+4],e.g+=5,s|=(15&n)<<28,128>n)return $(e),s;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw q();return $(e),s}j.prototype.reset=function(){this.g=this.j};var X=[];function Z(){this.g=[]}function Y(e,t){for(;127>>=7;e.g.push(t)}function Q(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,X.length?(n=X.pop(),t&&(n.v=t.v),e&&H(n,e),e=n):e=new j(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function J(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=K(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw U(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function ee(e){switch(e.h){case 0:if(0!=e.h)ee(e);else e:{for(var t=(e=e.g).g,n=t+10;t>>0,(e=e.g).g+=t,$(e));break;case 5:(e=e.g).g+=4,$(e);break;case 3:for(t=e.i;;){if(!J(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}ee(e)}break;default:throw U(e.h,e.j)}}Z.prototype.length=function(){return this.g.length},Z.prototype.end=function(){var e=this.g;return this.g=[],e},Q.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var te=[];function ne(){this.i=[],this.h=0,this.g=new Z}function se(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var re="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ie(e,t){Object.isFrozen(e)||(re?e[re]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ae(e){var t;return null==(t=re?e[re]:e.N)?0:t}function oe(e){return ie(e,1),e}function le(e){return!!Array.isArray(e)&&!!(2&ae(e))}function ue(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ie(e,2)}function ce(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var he=Object.freeze(oe([]));function de(e){if(le(e.m))throw Error("Cannot mutate an immutable Message")}var pe,fe="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function me(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function ge(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,s){s=void 0!==s&&s,de(e),tte.length&&te.push(e)}}function tt(e,t,n){for(var s=n.length,r=1==s%2,i=r?1:0;i>>0)>>31)+1,s=r>>>23&255,r&=8388607,ye(t,n,255==s?r?NaN:1/0*e:0==s?e*Math.pow(2,-149)*r:e*Math.pow(2,s-150)*(r+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){Y(e.g,8*n+5),e=e.g;var s=t;0===(s=(n=0>s?1:0)?-s:s)?G=0<1/s?0:2147483648:isNaN(s)?G=2147483647:34028234663852886e22>>0:11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),G=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,G=(n<<31|t+127<<23|8388607&s)>>>0),n=G,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),it=st((function(e,t,n){if(0!==e.h)return!1;for(var s=e.g,r=128,i=0,a=e=0;4>a&&128<=r;a++)r=s.h[s.g++],$(s),i|=(127&r)<<7*a;if(128<=r&&(r=s.h[s.g++],$(s),i|=(127&r)<<28,e|=(127&r)>>4),128<=r)for(a=0;5>a&&128<=r;a++)r=s.h[s.g++],$(s),e|=(127&r)<<7*a+3;if(!(128>r))throw q();return s=i>>>0,(e=2147483648&(r=e>>>0))&&(r=~r>>>0,0==(s=1+~s>>>0)&&(r=r+1>>>0)),s=4294967296*r+(s>>>0),ye(t,n,e?-s:s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t){Y(e.g,8*n),e=e.g;var s=t;for(n=0>s,t=(s=Math.abs(s))>>>0,s=Math.floor((s-t)/4294967296),s>>>=0,n&&(s=~s>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++s&&(s=0))),n=G=t,t=s;0>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),at=st((function(e,t,n){return 0===e.h&&(ye(t,n,K(e.g)),!0)}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t)if(Y(e.g,8*n),e=e.g,0<=(n=t))Y(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ot=st((function(e,t,n){if(2!==e.h)return!1;var s,r=K(e.g)>>>0,i=(e=e.g).g;if(e.g+=r,$(e),e=e.h,N)(s=I)||(s=I=new TextDecoder("utf-8",{fatal:!0})),s=s.decode(e.subarray(i,i+r));else{r=i+r;for(var a,o,l,u=[],c=null;i(a=e[i++])?u.push(a):224>a?i>=r?_():(o=e[i++],194>a||128!=(192&o)?(i--,_()):u.push((31&a)<<6|63&o)):240>a?i>=r-1?_():128!=(192&(o=e[i++]))||224===a&&160>o||237===a&&160<=o||128!=(192&(s=e[i++]))?(i--,_()):u.push((15&a)<<12|(63&o)<<6|63&s):244>=a?i>=r-2?_():128!=(192&(o=e[i++]))||o-144+(a<<28)>>30||128!=(192&(s=e[i++]))||128!=(192&(l=e[i++]))?(i--,_()):(a=(7&a)<<18|(63&o)<<12|(63&s)<<6|63&l,a-=65536,u.push(55296+(a>>10&1023),56320+(1023&a))):_(),8192<=u.length&&(c=E(c,u),u.length=0);s=E(c,u)}return ye(t,n,s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){var s=!1;if(s=void 0!==s&&s,O){if(s&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(T||(T=new TextEncoder)).encode(t)}else{for(var r=0,i=new Uint8Array(3*t.length),a=0;ao)i[r++]=o;else{if(2048>o)i[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&a=l){o=1024*(o-55296)+l-56320+65536,i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=63&o|128;continue}a--}if(s)throw Error("Found an unpaired surrogate");o=65533}i[r++]=o>>12|224,i[r++]=o>>6&63|128}i[r++]=63&o|128}}t=i.subarray(0,r)}Y(e.g,8*n+2),Y(e.g,t.length),se(e,e.g.end()),se(e,t)}})),lt=st((function(e,t,n,s,r){if(2!==e.h)return!1;t=Ae(t,n,s),n=e.g.i,s=K(e.g)>>>0;var i=e.g.g+s,a=i-n;if(0>=a&&(e.g.i=i,r(t,e),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+s+" bytes, instead read "+(s-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.i=n,!0}),(function(e,t,n,s,r){if(null!=(t=ve(t,s,n)))for(s=0;s>>=7,a.h++;i.push(o),a.h++}}));function ut(){Ne.apply(this,arguments)}if(p(ut,Ne),fe){var ct={};Object.defineProperties(ut,(ct[Symbol.hasInstance]=me(Object[Symbol.hasInstance]),ct))}function ht(e){ut.call(this,e)}function dt(){return[1,at,2,rt,3,ot,4,ot]}function pt(e){ut.call(this,e,-1,mt)}function ft(){return[1,lt,ht,dt]}p(ht,ut),p(pt,ut),pt.prototype.addClassification=function(e,t){return Ae(this,1,ht,e,t),this};var mt=[1];function gt(e){ut.call(this,e)}function yt(){return[1,rt,2,rt,3,rt,4,rt,5,rt]}function bt(e){ut.call(this,e,-1,vt)}function wt(){return[1,lt,gt,yt]}p(gt,ut),p(bt,ut);var vt=[1];function At(e){ut.call(this,e)}function xt(){return[1,rt,2,rt,3,rt,4,rt,5,rt,6,it]}p(At,ut);var Ct=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],kt=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],St=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],_t=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Et=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],It=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Tt=[].concat(o(Ct),o(kt),o(St),o(_t),o(Et),o(It));function Nt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Ot(e){return ve(e,ht,1).map((function(e){return{index:xe(e,1),ga:we(e,2),label:null!=ge(e,3)?Ce(e,3):void 0,displayName:null!=ge(e,4)?Ce(e,4):void 0}}))}function Rt(e){return{x:we(e,1),y:we(e,2),z:we(e,3),visibility:null!=ge(e,4)?we(e,4):void 0}}function Dt(e,t){this.h=e,this.g=t,this.l=0}function Mt(e,t,n){return function(e,t){var n=e.g;if(void 0===e.o){var s=Nt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),r=Nt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),i=n.createProgram();if(n.attachShader(i,s),n.attachShader(i,r),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(i));s=e.o=i,n.useProgram(s),r=n.getUniformLocation(s,"sampler0"),e.j={K:n.getAttribLocation(s,"aVertex"),J:n.getAttribLocation(s,"aTex"),ma:r},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(r,0)}s=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(s.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(s.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(s.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(s.K),n.disableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Ft(e){this.g=e}var Bt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function zt(e,t){return t+e}function Lt(e,t){window[e]=t}function Pt(e){if(this.g=e,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=e&&e.locateFile||zt,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=t,e.options)for(var n=(t=a(Object.keys(e.options))).next();!n.done;n=t.next()){n=n.value;var s=e.options[n].default;void 0!==s&&(this.j[n]="function"==typeof s?s():s)}}function Vt(e,t){var n,s;return x((function(r){return t in e.H?r.return(e.H[t]):(n=e.locateFile(t,""),s=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=s,r.return(s))}))}function Wt(e,t,n){var s,r,i,o,l,u,c,h,d,p,f,m,g,b;return x((function(w){switch(w.g){case 1:if(!n)return w.return(t);for(s={},r=0,i=a(Object.keys(n)),o=i.next();!o.done;o=i.next())l=o.value,"string"!=typeof(u=n[l])&&"texture"===u.type&&void 0!==t[u.stream]&&++r;10&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0){var c=o===e.strides.length-1?1:wH(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(l*c)),i.push(e.interpolatedScaleAspectRatio)}}o++}for(var h=0;h0)p=e.featureMapHeight[n],f=e.featureMapWidth[n];else{var m=e.strides[n];p=Math.ceil(e.inputSizeHeight/m),f=Math.ceil(e.inputSizeWidth/m)}for(var g=0;g-1})),lh([s,r,i]),[2,o]}}))}))}function xH(e,t,n){return uH(this,void 0,void 0,(function(){var s,r,i,a,o;return cH(this,(function(l){switch(l.label){case 0:return s=e[0],r=e[1],i=function(e,t,n){return oh((function(){var s,r,i,a;n.reverseOutputOrder?(r=my(Af(e,[0,n.boxCoordOffset+0],[-1,1])),s=my(Af(e,[0,n.boxCoordOffset+1],[-1,1])),a=my(Af(e,[0,n.boxCoordOffset+2],[-1,1])),i=my(Af(e,[0,n.boxCoordOffset+3],[-1,1]))):(s=my(Af(e,[0,n.boxCoordOffset+0],[-1,1])),r=my(Af(e,[0,n.boxCoordOffset+1],[-1,1])),i=my(Af(e,[0,n.boxCoordOffset+2],[-1,1])),a=my(Af(e,[0,n.boxCoordOffset+3],[-1,1]))),r=bd(Ad(vd(r,n.xScale),t.w),t.x),s=bd(Ad(vd(s,n.yScale),t.h),t.y),n.applyExponentialOnBoxSize?(i=Ad(Cm(vd(i,n.hScale)),t.h),a=Ad(Cm(vd(a,n.wScale)),t.w)):(i=Ad(vd(i,n.hScale),t.h),a=Ad(vd(a,n.wScale),t.h));var o=zd(s,vd(i,2)),l=zd(r,vd(a,2)),u=bd(s,vd(i,2)),c=bd(r,vd(a,2)),h=bf([mf(o,[n.numBoxes,1]),mf(l,[n.numBoxes,1]),mf(u,[n.numBoxes,1]),mf(c,[n.numBoxes,1])],1);if(n.numKeypoints)for(var d=0;d0)for((c=l.locationData).relativeKeypoints=[],h=n.numKeypoints*n.numValuesPerKeypoint,d=0;dl?(i=e.width,a=e.width*o,c=(1-l/o)/2):(i=e.height/o,a=e.height,u=(1-o/l)/2),e.width=i,e.height=a,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,i=e.height,a=Math.cos(e.rotation),o=Math.sin(e.rotation),l=e.xCenter,u=e.yCenter,c=1/t,h=1/n,d=new Array(16);return d[0]=r*a*1*c,d[1]=-i*o*c,d[2]=0,d[3]=(-.5*r*a*1+.5*i*o+l)*c,d[4]=r*o*1*h,d[5]=i*a*h,d[6]=0,d[7]=(-.5*i*a-.5*r*o*1+u)*h,d[8]=0,d[9]=0,d[10]=r*c,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(d)}(l,o.width,o.height),h=oh((function(){var t=gH(e),n=Ay(function(e,t,n){return yH(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=sw.transform(km(md(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return oh((function(){return bd(Ad(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}(n,this.imageToTensorConfig),r=s.imageTensor,i=s.transformationMatrix,a=this.detectorModel.execute(r,"Identity:0"),o=function(e){return oh((function(){var t=function(e){return oh((function(){return[Af(e,[0,0,0],[1,-1,1]),Af(e,[0,0,1],[1,-1,-1])]}))}(e),n=t[0],s=t[1];return{boxes:my(s),logits:my(n)}}))}(a),l=o.boxes,[4,xH([u=o.logits,l],this.anchorTensor,this.tensorsToDetectionConfig)]);case 1:return 0===(c=p.sent()).length?(lh([n,r,a,u,l]),[2,c]):[4,AH(c,this.maxFaces,.3)];case 2:return h=p.sent(),d=function(e,t){void 0===e&&(e=[]);var n,s=(n=t,[].concat.apply([],n));return e.forEach((function(e){var t=e.locationData;t.relativeKeypoints.forEach((function(e){var t=vH(s,[e.x,e.y]),n=t[0],r=t[1];e.x=n,e.y=r}));var n=t.relativeBoundingBox,r=Number.MAX_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,o=Number.MIN_VALUE;[[n.xMin,n.yMin],[n.xMin+n.width,n.yMin],[n.xMin+n.width,n.yMin+n.height],[n.xMin,n.yMin+n.height]].forEach((function(e){var t=vH(s,e),n=t[0],l=t[1];r=Math.min(r,n),a=Math.max(a,n),i=Math.min(i,l),o=Math.max(o,l)})),t.relativeBoundingBox={xMin:r,xMax:a,yMin:i,yMax:o,width:a-r,height:o-i}})),e}(h,i),lh([n,r,a,u,l]),[2,d]}}))}))},e.prototype.estimateFaces=function(e,t){return uH(this,void 0,void 0,(function(){var n,s;return cH(this,(function(r){return n=mH(e),s=!!t&&t.flipHorizontal,[2,this.detectFaces(e,s).then((function(e){return e.map((function(e){for(var t=e.locationData.relativeKeypoints.map((function(e,t){return lH(lH({},e),{x:e.x*n.width,y:e.y*n.height,name:hH[t]})})),s=e.locationData.relativeBoundingBox,r=0,i=["width","xMax","xMin"];r-1,[4,HI(t.detectorModelUrl,{fromTFHub:n})];case 1:return s=r.sent(),[2,new DH(t.modelType,s,t.maxFaces)]}}))}))}function FH(e,t){return uH(this,void 0,void 0,(function(){var n,s;return cH(this,(function(r){if(e===SH.MediaPipeFaceDetector){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,MH(n)];if("mediapipe"===n.runtime)return[2,fH(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}function BH(e){return e.width*e.height}function zH(e){var t=e.xCenter-e.width/2,n=t+e.width,s=e.yCenter-e.height/2;return{xMin:t,xMax:n,yMin:s,yMax:s+e.height,width:e.width,height:e.height}}function LH(e){return e instanceof vc?{height:e.shape[0],width:e.shape[1]}:{height:e.height,width:e.width}}function PH(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function VH(e){return e instanceof vc?e:Ap(e)}function WH(e,t){Ni(0!==e.width,(function(){return t+" width cannot be 0."})),Ni(0!==e.height,(function(){return t+" height cannot be 0."}))}function GH(e,t,n){var s=t.outputTensorSize,r=t.keepAspectRatio,i=t.borderMode,a=t.outputTensorFloatRange,o=LH(e),l=function(e,t){return t?{xCenter:t.xCenter*e.width,yCenter:t.yCenter*e.height,width:t.width*e.width,height:t.height*e.height,rotation:t.rotation}:{xCenter:.5*e.width,yCenter:.5*e.height,width:e.width,height:e.height,rotation:0}}(o,n),u=function(e,t,n){if(void 0===n&&(n=!1),!n)return{top:0,left:0,right:0,bottom:0};var s=t.height,r=t.width;WH(t,"targetSize"),WH(e,"roi");var i,a,o=s/r,l=e.height/e.width,u=0,c=0;return o>l?(i=e.width,a=e.width*o,c=(1-l/o)/2):(i=e.height/o,a=e.height,u=(1-o/l)/2),e.width=i,e.height=a,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,i=e.height,a=s?-1:1,o=Math.cos(e.rotation),l=Math.sin(e.rotation),u=e.xCenter,c=e.yCenter,h=1/t,d=1/n,p=new Array(16);return p[0]=r*o*a*h,p[1]=-i*l*h,p[2]=0,p[3]=(-.5*r*o*a+.5*i*l+u)*h,p[4]=r*l*a*d,p[5]=i*o*d,p[6]=0,p[7]=(-.5*i*o-.5*r*l*a+c)*d,p[8]=0,p[9]=0,p[10]=r*h,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(p)}(l,o.width,o.height,!1),h=oh((function(){var t=VH(e),n=Ay(function(e,t,n){return WH(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=sw.transform(km(md(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return oh((function(){return bd(Ad(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}function UH(e){return{xCenter:e.xMin+e.width/2,yCenter:e.yMin+e.height/2,width:e.width,height:e.height}}function qH(e){var t=e.relativeKeypoints;if(t.length<=1)throw new Error("2 or more keypoints required to calculate a rect.");var n=Number.MAX_VALUE,s=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MIN_VALUE;return t.forEach((function(e){n=Math.min(n,e.x),r=Math.max(r,e.x),s=Math.min(s,e.y),i=Math.max(i,e.y)})),{xCenter:(n+r)/2,yCenter:(s+i)/2,width:r-n,height:i-s}}function jH(e,t,n,s,r){var i="rect"===n?function(e,t,n){var s,r=e.locationData;if("boundingbox"===t)s=UH(r.boundingBox);else{s=qH(r);var i=n.width,a=n.height;s.xCenter=Math.round(s.xCenter*i),s.yCenter=Math.round(s.yCenter*a),s.width=Math.round(s.width*i),s.height=Math.round(s.height*a)}return s}(e,t,s):function(e,t){var n=e.locationData;return"boundingbox"===t?UH(n.relativeBoundingBox):qH(n)}(e,t);return r&&(i.rotation=function(e,t,n){var s,r=e.locationData,i=n.rotationVectorStartKeypointIndex,a=n.rotationVectorEndKeypointIndex;s=n.rotationVectorTargetAngle?n.rotationVectorTargetAngle:Math.PI*n.rotationVectorTargetAngleDegree/180;var o=r.relativeKeypoints[i].x*t.width,l=r.relativeKeypoints[i].y*t.height,u=r.relativeKeypoints[a].x*t.width,c=r.relativeKeypoints[a].y*t.height;return PH(s-Math.atan2(-(c-l),u-o))}(e,s,r)),i}function HH(e,t,n){for(var s=0;s1&&(h.y=s?t.inputImageHeight-a[u+1]:a[u+1]),i>2&&(h.z=a[u+2]),i>3&&(h.score=ZH(t.visibilityActivation,a[u+3])),o.push(h);for(c=0;c0?r/i:0}(e,t)<=.5}))).push(e)}))})),l=y,[4,Promise.all(l.map((function(e){return m.faceLandmark(e,r)})))];case 4:for(u=g.sent(),c=[],this.prevFaceRectsFromLandmarks=[],h=0;h-1,[4,HI(t.landmarkModelUrl,{fromTFHub:n})];case 1:return s=i.sent(),[4,FH(SH.MediaPipeFaceDetector,{modelType:"short",maxFaces:t.maxFaces,detectorModelUrl:t.detectorModelUrl,runtime:t.runtime})];case 2:return r=i.sent(),[2,new f$(r,s,t.maxFaces,t.refineLandmarks)]}}))}))}(JH||(JH={})).MediaPipeFaceMesh="MediaPipeFaceMesh";Object.freeze({__proto__:null,getKeypointIndexByContour:function(e){if(e===JH.MediaPipeFaceMesh)return Qj;throw new Error("Model "+e+" is not supported.")},getAdjacentPairs:function(e){if(e===JH.MediaPipeFaceMesh)return Jj;throw new Error("Model "+e+" is not supported.")}});const g$=(e,t,n,s)=>1===s?.5*(e+t):e+(t-e)*n/(s-1),y$={applyExponentialOnBoxSize:!1,flipVertically:!1,ignoreClasses:[],numClasses:1,numBoxes:2304,numCoords:16,boxCoordOffset:0,keypointCoordOffset:4,numKeypoints:6,numValuesPerKeypoint:2,sigmoidScore:!0,scoreClippingThresh:100,reverseOutputOrder:!0,xScale:192,yScale:192,hScale:192,wScale:192,minScoreThresh:.6},b$={reduceBoxesInLowestLayer:!1,interpolatedScaleAspectRatio:0,featureMapHeight:[],featureMapWidth:[],numLayers:1,minScale:.1484375,maxScale:.75,inputSizeHeight:192,inputSizeWidth:192,anchorOffsetX:.5,anchorOffsetY:.5,strides:[4],aspectRatios:[1],fixedAnchorSize:!0},w$={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},v$=e=>{e.detector.imageToTensorConfig=w$,e.detector.tensorsToDetectionConfig=y$,e.detector.anchors=(e=>{null===e.reduceBoxesInLowestLayer&&(e.reduceBoxesInLowestLayer=!1),null===e.interpolatedScaleAspectRatio&&(e.interpolatedScaleAspectRatio=1),null===e.fixedAnchorSize&&(e.fixedAnchorSize=!1);const t=[];let n=0;for(;n0){const n=o===e.strides.length-1?1:g$(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(t*n)),i.push(e.interpolatedScaleAspectRatio)}}o++}for(let e=0;e0)l=e.featureMapHeight[n],u=e.featureMapWidth[n];else{const t=e.strides[n];l=Math.ceil(e.inputSizeHeight/t),u=Math.ceil(e.inputSizeWidth/t)}for(let n=0;ne.width))),n=vy(e.detector.anchors.map((e=>e.height))),s=vy(e.detector.anchors.map((e=>e.xCenter))),r=vy(e.detector.anchors.map((e=>e.yCenter)));e.detector.anchorTensor={x:s,y:r,w:t,h:n}},A$=function(){this.model=function(e,t){return Xj(this,void 0,void 0,(function(){var n,s;return Zj(this,(function(r){if(e===JH.MediaPipeFaceMesh){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,m$(n)];if("mediapipe"===n.runtime)return[2,iH(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}(JH.MediaPipeFaceMesh,{runtime:"tfjs",detectorModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/face_detection/full/1"}),this.predictionReady=!1,this.modelLoaded=!1},x$={current:!1,resolves:[]};A$.prototype.loadModel=async function(){if(!this.modelLoaded){if(x$.current){const e=new Promise((e=>{x$.resolves.push(e)}));return await e}x$.current=!0;try{this.model=await this.model,v$(this.model),this.modelLoaded=!0,x$.resolves.forEach((e=>e()))}finally{x$.current=!1,x$.resolves=[]}}},A$.prototype.positionsArray=null,A$.prototype.getEyePatches=async function(e,t,n,s){if(0===t.width)return null;const r=this.model,i=await r.estimateFaces(t,{flipHorizontal:!1});if(0===i.length)return!1;this.positionsArray=i[0].keypoints;const a=i[0],[o,l]=[{eyeTopArc:[466,388,387,386,385,384,398].map((e=>a.keypoints[e])),eyeBottomArc:[263,249,390,373,374,380,381,382,362].map((e=>a.keypoints[e]))},{eyeTopArc:[246,161,160,159,158,157,173].map((e=>a.keypoints[e])),eyeBottomArc:[33,7,163,144,145,153,154,155,133].map((e=>a.keypoints[e]))}].map((({eyeTopArc:e,eyeBottomArc:t})=>{const n={x:Math.round(Math.min(...e.map((e=>e.x)))),y:Math.round(Math.min(...e.map((e=>e.y))))},s=Math.round(Math.max(...t.map((e=>e.x)))),r=Math.round(Math.max(...t.map((e=>e.y))));return{origin:n,width:s-n.x,height:r-n.y}}));var u=o.origin.x,c=o.origin.y,h=o.width,d=o.height,p=l.origin.x,f=l.origin.y,m=l.width,g=l.height;if(0===h||0===m)return null;if(0===d||0===g)return null;var y={},b=t.getContext("2d").getImageData(u,c,h,d);y.left={patch:b,imagex:u,imagey:c,width:h,height:d};var w=t.getContext("2d").getImageData(p,f,m,g);return y.right={patch:w,imagex:p,imagey:f,width:m,height:g},this.predictionReady=!0,y},A$.prototype.getPositions=function(){return this.positionsArray},A$.prototype.reset=function(){},A$.prototype.drawFaceOverlay=function(e,t){if(t){e.fillStyle="#32EEDB",e.strokeStyle="#32EEDB",e.lineWidth=.5;for(let n=0;nn?n:e}k$.Eye=function(e,t,n,s,r){this.patch=e,this.imagex=t,this.imagey=n,this.width=s,this.height=r},k$.getEyeFeats=function(e){var t=this.resizeEye(e.left,10,6),n=this.resizeEye(e.right,10,6),s=this.grayscale(t.data,t.width,t.height),r=this.grayscale(n.data,n.width,n.height),i=[];this.equalizeHistogram(s,5,i);var a=[];return this.equalizeHistogram(r,5,a),i.concat(a)},k$.DataWindow=function(e,t){this.data=[],this.windowSize=e,this.index=0,this.length=0,t&&(this.data=t.slice(t.length-e,t.length),this.length=this.data.length)},k$.DataWindow.prototype.push=function(e){return this.data.length>2),r=0,i=0,a=0;at?255:0;return e},k$.correlation=function(e,t){const n=Math.min(e.length,t.length);let s=0;for(let r=0;rE$(e,t,((e,t)=>e+t)),sub:(e,t)=>E$(e,t,((e,t)=>e-t)),inv:e=>I$.solve(e,I$.identity(e.length,e[0].length)),identity(e,t=e){const n=new Array(e);for(let s=0;se.length===e[0].length?I$.LUDecomposition(e,t):I$.QRDecomposition(e,t),LUDecomposition(e,t){for(var n=new Array(e.length),s=0;sMath.abs(c[f])&&(f=s);if(f!=r){for(p=0;p=0;p--){for(r=0;r=0;u--){for(r=0;r=0;n--){var s=this.screenXTrailArray.get(n),r=this.screenYTrailArray.get(n);if(Math.sqrt(Math.pow(s-e,2)+Math.pow(r-t,2))>72)return n+1}return n},N$.addData=function(e,t,n){e&&("click"===n?(this.screenXClicksArray.push([t[0]]),this.screenYClicksArray.push([t[1]]),this.eyeFeaturesClicks.push(_$.getEyeFeats(e)),this.dataClicks.push({eyes:e,screenPos:t,type:n})):"move"===n&&(this.screenXTrailArray.push([t[0]]),this.screenYTrailArray.push([t[1]]),this.eyeFeaturesTrail.push(_$.getEyeFeats(e)),this.trailTimes.push(performance.now()),this.dataTrail.push({eyes:e,screenPos:t,type:n})))};const O$=N$,R$={RidgeReg:function(){this.init()}};R$.RidgeReg.prototype.init=O$.InitRegression,R$.RidgeReg.prototype.addData=O$.addData,R$.RidgeReg.prototype.predict=function(e){if(!e||0===this.eyeFeaturesClicks.length)return null;for(var t=performance.now()-this.trailTime,n=[],s=[],r=[],i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.screenXClicksArray.data.concat(n),o=this.screenYClicksArray.data.concat(s),l=this.eyeFeaturesClicks.data.concat(r),u=O$.ridge(a,l,this.ridgeParameter),c=O$.ridge(o,l,this.ridgeParameter),h=_$.getEyeFeats(e),d=0;for(i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.eyeFeaturesClicks.data.length,o=Array(a),l=Array(a),u=Array(a);for(i=0;isetTimeout(t,e)))}function W$(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const G$={tracker:{}};G$.tracker.TFFaceMesh=C$,G$.reg=D$,G$.reg.RidgeWeightedReg=F$.RidgeWeightedReg,G$.reg.RidgeRegThreaded=P$.RidgeRegThreaded,G$.util=_$,G$.params=qj;var U$=null,q$=null,j$=null,H$=null,$$=null,K$=null,X$=null,Z$=!1,Y$=new Array(50),Q$=new Array(50),J$=(performance.now(),null),eK=null;G$.params.paused=!1,G$.params.greedyLearner=!1,G$.params.framerate=60,G$.params.showGazeDot=!1,G$.params.getLatestVideoFrameTimestamp=()=>{},G$.params.activeCamera={label:"",id:""};let tK=[];var nK=function(e){},sK=nK,rK=["click","move"],iK=performance.now(),aK=new G$.tracker.TFFaceMesh,oK=[new G$.reg.RidgeReg],lK={TFFacemesh:function(){return new G$.tracker.TFFaceMesh}},uK={ridge:function(){return new G$.reg.RidgeReg},weightedRidge:function(){return new G$.reg.RidgeWeightedReg},threadedRidge:function(){return new G$.reg.RidgeRegThreaded}},cK="webgazerGlobalData",hK="webgazerGlobalSettings",dK={},pK=[];let fK,mK,gK,yK,bK,wK,vK,AK,xK,CK,kK,SK;G$.computeValidationBoxSize=function(){var e=j$.videoWidth,t=j$.videoHeight,n=parseInt(j$.style.width),s=parseInt(j$.style.height),r=Math.min(e,t),i=e==Math.max(e,t)?n/e:s/t,a=r*G$.params.faceFeedbackBoxRatio*i;return[(s-a)/2,(n-a)/2,a,a]};let _K=!1,EK=!1;function IK(){null!==K$&&J$?(_K||EK||(EK=!0,setTimeout((()=>{fK=j$.videoWidth,mK=j$.videoHeight,gK=Math.min(fK,mK),yK=gK*G$.params.faceFeedbackBoxRatio,bK=(mK-yK)/2,wK=(fK-yK)/2,vK=wK+yK,AK=bK+yK,_K=!0,EK=!1}),500)),xK=fK-J$.left.imagex,kK=fK-J$.right.imagex,CK=J$.left.imagey,SK=J$.right.imagey,K$.style.border=_K&&xK>wK&&xKwK&&kKbK&&CKbK&&SK=1e3/G$.params.framerate&&(FK=MK,eK=OK(),eK=await eK,sK(eK),BK=!0,eK)){RK.push(eK);var e=0,t=0,n=RK.length;for(var s in RK.data)e+=RK.get(s).x,t+=RK.get(s).y;var r=_$.bound({x:e/n,y:t/n});G$.params.storingPoints&&(G$.storePoints(r.x,r.y,DK),50==++DK&&(DK=0)),X$.style.opacity="",X$.style.left=`${r.x}px`,X$.style.top=`${r.y}px`}requestAnimationFrame(LK)}var PK=function(e,t,n){if(!G$.params.paused){if(0===oK.length)return null;for(var s in oK)J$&&oK[s].addData(J$,[e,t],n)}},VK=async function(e){PK(e.clientX,e.clientY,rK[0]),G$.params.saveDataAcrossSessions&&await async function(){var e=oK[0].getData()||pK;Hj().setItem(hK,dK),Hj().setItem(cK,e)}()},WK=function(e){if(!G$.params.paused){var t=performance.now();tG$.params.activeCamera.id?{video:{...e.video,deviceId:G$.params.activeCamera.id}}:e;function HK(e){navigator.vendor&&navigator.vendor.indexOf("Apple")>-1?(e.style.opacity=G$.params.showVideo?"1":"0",e.style.display="block"):e.style.display=G$.params.showVideo?"block":"none"}G$._begin=function(e,t){if(!G$.params.videoIsOn)return void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(e){var t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise((function(n,s){t.call(navigator,e,n,s)})):Promise.reject(new Error("Unfortunately, your browser does not support access to the webcam through the getUserMedia API. Try to use the latest version of Google Chrome, Mozilla Firefox, Opera, or Microsoft Edge instead."))}),new Promise((async(n,s)=>{let r;try{if(void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.enumerateDevices){const s=await navigator.mediaDevices.enumerateDevices();if((e=>{let t,n;tK=[],e.forEach((e=>{"videoinput"===e.kind&&tK.push(e),e.label.includes("FaceTime")&&(t=e.label,n=e.deviceId)})),tK.length&&(G$.params.activeCamera.label=t||tK[0].label,G$.params.activeCamera.id=n||tK[0].deviceId)})(s),0===tK.length)throw t(tK),JSON.stringify({message:"We can't find any video input devices.",devices:s});try{r=await navigator.mediaDevices.getUserMedia(jK(G$.params.camConstraints))}catch(e){throw t(tK),e}qK(e?"video":"all",r).then((()=>{tK.length>1&&(e=>{const t=q$,n=document.createElement("select");n.className=n.id="webgazer-videoinput-select",n.name="videoinput",e.forEach(((e,t)=>{var s;n.innerHTML+=``})),n.onchange=e=>{const[t,s]=n.value.split("%");G$.params.activeCamera.label=s,G$.params.activeCamera.id=t,G$.setCameraConstraints(jK(G$.params.camConstraints))},t.appendChild(n)})(tK)})),G$.params.videoIsOn=!0,e||n(G$)}else t([])}catch(e){throw j$=null,r=null,t([]),s(e),JSON.stringify({error:e,devices:await navigator.mediaDevices.enumerateDevices()})}}));qK("gaze")},G$.isReady=function(){return null!==H$&&H$.width>0},G$.pause=function(){return G$.params.paused=!0,G$},G$.stopLearning=function(e){return UK(e),G$},G$.startLearning=function(e){return GK(e),G$},G$.resume=async function(){return G$.params.paused?(G$.params.paused=!1,BK=!0,$K.current&&(clearInterval($K.current),$K.current=void 0,Z$=!1,X$.style.backgroundColor="",X$.style.opacity=""),await LK(),G$):G$},G$.end=function(e=!1){return e&&(RK=new _$.DataWindow(4),DK=0,MK=null,FK=-1,_K=!1,G$.params.videoIsOn=!1,setTimeout((()=>{G$.stopVideo(),q$.remove()}),500)),G$},G$.stopVideo=function(){return U$.getTracks()[0].stop(),G$},G$.detectCompatibility=function(){return void 0!==(navigator.mediaDevices.getUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia)},G$.showVideoPreview=function(e){return G$.params.showVideoPreview=e,G$.showVideo(e&&G$.params.showVideo),G$.showFaceOverlay(e&&G$.params.showFaceOverlay),G$.showFaceFeedbackBox(e&&G$.params.showFaceFeedbackBox),G$},G$.showVideo=function(e,t=.8){return G$.params.showVideo=e,j$&&HK(j$),q$&&HK(q$),G$},G$.showFaceOverlay=function(e){return G$.params.showFaceOverlay=e,$$&&($$.style.display=e?"block":"none"),G$},G$.showFaceFeedbackBox=function(e){return G$.params.showFaceFeedbackBox=e,K$&&(K$.style.display=e?"block":"none"),G$},G$.showPredictionPoints=function(e){return G$.params.showGazeDot=e,X$&&(X$.style.display=e?"block":"none"),G$};const $K={current:void 0};function KK(e,t){H$&&(H$.width=e,H$.height=t),$$&&($$.width=e,$$.height=t)}G$.popPredictionPoints=function(){return $K.current&&(clearInterval($K.current),$K.current=void 0,Z$=!1),X$&&G$.params.showGazeDot&&(Z$=!0,X$.style.backgroundColor="red",X$.style.opacity=1,$K.current=setInterval((()=>{X$.style.opacity-=.02,X$.style.opacity<=.02&&(clearInterval($K.current),$K.current=void 0,Z$=!1,X$.style.backgroundColor="",X$.style.opacity="")}),50)),G$},G$.saveDataAcrossSessions=function(e){return G$.params.saveDataAcrossSessions=e,G$},G$.applyKalmanFilter=function(e){return G$.params.applyKalmanFilter=e,G$},G$.setCameraConstraints=async function(e){if(G$.params.camConstraints=e,U$){G$.pause();try{U$.getVideoTracks().forEach((e=>{e.stop()}));const e=await navigator.mediaDevices.getUserMedia(G$.params.camConstraints);setTimeout((()=>{const t=e.getVideoTracks()[0].getSettings();U$=e,j$.srcObject=e,KK(t.width,t.height)}),1500)}catch(e){return}await G$.resume()}},G$.setStaticVideo=function(e){return e,G$},G$.setVideoViewerSize=function(e,t){G$.params.videoViewerWidth=e,G$.params.videoViewerHeight=t,j$.style.width=e+"px",j$.style.height=t+"px",q$.style.width=e+"px",q$.style.height=t+"px",$$.style.width=e+"px",$$.style.height=t+"px";var n=G$.computeValidationBoxSize();K$.style.top=n[0]+"px",K$.style.left=n[1]+"px",K$.style.width=n[2]+"px",K$.style.height=n[3]+"px"},G$.addMouseEventListeners=function(){return GK(),G$},G$.removeMouseEventListeners=function(){return UK(),G$},G$.recordScreenPosition=function(e,t,n){return PK(e,t,n||rK[0]),G$},G$.storePoints=function(e,t,n){Y$[n]=e,Q$[n]=t},G$.setTracker=function(e){if(void 0===lK[e]){for(var t in lK);return G$}return aK=lK[e](),G$},G$.setRegression=function(e){if(void 0===uK[e]){for(var t in uK);return G$}return pK=oK[0].getData(),(oK=[uK[e]()])[0].setData(pK),G$},G$.addTrackerModule=function(e,t){lK[e]=function(){return new t}},G$.addRegressionModule=function(e,t){uK[e]=function(){return new t}},G$.addRegression=function(e){var t=uK[e]();return pK=oK[0].getData(),t.setData(pK),oK.push(t),G$},G$.setGazeListener=function(e){return sK=e,G$},G$.clearGazeListener=function(){return sK=nK,G$},G$.setVideoElementCanvas=function(e){return H$=e},G$.clearData=async function(){!function(){for(var e in Hj().clear(),oK)oK[e].init()}()},G$.getTracker=function(){return aK},G$.getRegression=function(){return oK},G$.getCurrentPrediction=async function(e=0,t=150,n=5){let s=0;const r=[],i=[];for(let e=0;et.x>=0&&t.x<=window.innerWidth?e+t.x:e),0)/i.length),l=Math.round(i.reduce(((e,t)=>t.y>=0&&t.y<=window.innerHeight?e+t.y:e),0)/i.length);return X$&&(X$.style.left=`${o}px`,X$.style.top=`${l}px`),{x:o,y:l,raw:i.map((e=>({x:W$(e.x,0),y:W$(e.y,0)})))}},G$.params.getEventTypes=function(){return rK.slice()},G$.getVideoElementCanvas=function(){return H$},G$.getVideoPreviewToCameraResolutionRatio=function(){return[G$.params.videoViewerWidth/j$.videoWidth,G$.params.videoViewerHeight/j$.videoHeight]},G$.getStoredPoints=function(){return[Y$,Q$]};const XK=G$;class ZK{constructor(e){this.calibrator=e,this.webgazer=XK,this.defaultGazeCallback=null,this.defaultDistanceTrackCallback=null,this._initialized={distance:!1,gaze:!1},this._learning=!0,this._running={distance:!1,gaze:!1},this._runningVideo=!1,this._toFixedN=1}begin({pipWidthPx:e},t){this.checkInitialized("gaze",!0)&&(this._running.gaze||(this.webgazer.begin(this.videoFailed.bind(this)),this._running.gaze=!0,this._runningVideo=!0),br(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}beginVideo({pipWidthPx:e},t){this.checkInitialized("distance",!0)&&(this._runningVideo||(this.webgazer.beginVideo(this.videoFailed.bind(this)),this._runningVideo=!0),br(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}videoFailed(e){const t=qs(this.calibrator,{showIcon:!0});zs.fire({...t,icon:"error",iconColor:this.calibrator._CONST.COLOR.DARK_RED,showConfirmButton:!1,html:e.length?G.H.RC_errorCameraUseDenied[this.calibrator.L]:G.H.RC_errorNoCamera[this.calibrator.L]})}attachNewCallback(e){this.checkInitialized("gaze",!0)&&this.webgazer.setGazeListener((t=>{if(t){const n=this.getData(t);this.calibrator.newGazePositionData=n,(0,E.nB)(e,n)}}))}async getGazeNow(e={},t=void 0){const n=Object.assign({wait:0,frames:5},e),s=this.getData(await this.webgazer.getCurrentPrediction(0,n.wait,n.frames));return this.calibrator.newGazePositionData=s,this.webgazer.popPredictionPoints(),(0,E.nB)(t,s),s}end(){this.webgazer.end()}}ZK.prototype._init=function({greedyLearner:e,framerate:t,toFixedN:n,showVideo:s,showFaceOverlay:r,showGazer:i},a){this.checkInitialized(a)||("gaze"===a&&(this.webgazer.params.greedyLearner=e,this.webgazer.params.framerate=t,this.webgazer.params.getLatestVideoFrameTimestamp=this._getLatestVideoTimestamp.bind(this),this.showGazer(i)),this._toFixedN=n,this.showVideo(s),this.showFaceOverlay(r),this._initialized[a]=!0)},ZK.prototype.checkInitialized=function(e,t=!1){return!!(""===e?this._initialized.gaze||this._initialized.distance:this._initialized[e])},ZK.prototype.getData=function(e){const t=performance.now();return{value:{x:(0,E.Nh)(e.x,this._toFixedN),y:(0,E.Nh)(e.y,this._toFixedN),latencyMs:t-this.calibrator._trackingVideoFrameTimestamps.gaze},timestamp:t,raw:e.raw?e.raw:void 0}},ZK.prototype.pause=function(){this.webgazer.pause()},ZK.prototype.resume=function(){this.webgazer.resume()},ZK.prototype.end=function(e,t=!1){if(!this.checkInitialized(e,!0))return;const n=t||!this._initialized.gaze||!this._initialized.distance;"gaze"===e?(this._endGaze(),n&&this.checkInitialized("distance")&&this.calibrator.endDistance(!1,!1),this.calibrator._trackingVideoFrameTimestamps.gaze=0):(this.defaultDistanceTrackCallback=null,n&&this.checkInitialized("gaze")&&this._endGaze()),n?(this._initialized={distance:!1,gaze:!1},this._running={distance:!1,gaze:!1},this.webgazer.end(!0),this._runningVideo=!1):(this._initialized[e]=!1,this._running[e]=!1)},ZK.prototype._endGaze=function(){this.webgazer.params.paused=!0,this._learning=!0,this.defaultGazeCallback=null,this.webgazer.clearData(),this.webgazer.params.greedyLearner=!1,this.webgazer.params.framerate=60,this.webgazer.params.getLatestVideoFrameTimestamp=()=>{}},ZK.prototype._getLatestVideoTimestamp=function(e){this.calibrator._trackingVideoFrameTimestamps.gaze=e},ZK.prototype.startStoringPoints=function(){this.webgazer.params.storingPoints=!0},ZK.prototype.stopStoringPoints=function(){this.webgazer.params.storingPoints=!1},ZK.prototype.startLearning=function(e){this._learning||(this.webgazer.startLearning(e),this._learning=!0)},ZK.prototype.stopLearning=function(e){this._learning&&(this.webgazer.stopLearning(e),this._learning=!1)},ZK.prototype.showGazer=function(e){this.webgazer.showPredictionPoints(e)},ZK.prototype.showVideo=function(e){this.webgazer.showVideo(e,this.calibrator._params.videoOpacity)},ZK.prototype.showFaceOverlay=function(e){this.webgazer.showFaceOverlay(e)},_.A.prototype.performanceCompute=async function(e,t=!1){if(!this.checkInitialized())return;const n=performance.now(),s={_useless:void 0,time:0,randomTime:0};for(;performance.now()-n<500;)s._useless=Array(5e3).fill(Math.floor(10*Math.random())),s.time++;const r=performance.now();for(s._useless=0;performance.now()-r<500;)s._useless+=Math.random(),s.randomTime++;const i={value:{computeArrayFillMHz:(0,E.Nh)(2*s.time/1e6,3),computeRandomMHz:(0,E.Nh)(2*s.randomTime/1e6,3),idealFps:void 0,stressFps:void 0},timestamp:performance.now()};return t||(this.newPerformanceData=i),(0,E.nB)(e,i),i},_.A.prototype.performance=async function(e={},t=void 0){if(!this.checkInitialized())return;const n=Object.assign({testComputation:!0,testFrameCount:180,testObjectCount:1e4,headline:`🚀 ${G.H.RC_performanceTitle[this.L]}`,description:G.H.RC_performanceIntro[this.L]},e);this._addBackground(),this._addBackgroundText(n.headline,n.description),await(0,E.yy)(200);const s=n.testComputation?await this.performanceCompute(null,!0):{value:{computeArrayFillMHz:void 0,computeRandomMHz:void 0}},r=document.createElement("canvas"),i=r.getContext("2d");r.width=window.innerWidth,r.height=window.innerHeight,this.background.appendChild(r);const a=await YK(i),o=await QK(i,n.testFrameCount,n.testObjectCount),l={value:{computeArrayFillMHz:s.value.computeArrayFillMHz,computeRandomMHz:s.value.computeRandomMHz,idealFps:Math.round(6e4/(a.end-a.start)),stressFps:Math.round(1e3*n.testFrameCount/(o.end-o.start))},timestamp:performance.now()};return this.newPerformanceData=l,this._removeBackground(),(0,E.nB)(t,l),l};const YK=()=>{let e=60;const t=performance.now();return new Promise((n=>{const s=()=>{e--,e>0?requestAnimationFrame(s):n({start:t,end:performance.now()})};requestAnimationFrame(s)}))},QK=async(e,t,n)=>{let s=t;const r=[],i=["#000000","#333333","#999999"];for(let e=0;e{const n=()=>{e.clearRect(0,0,window.innerWidth,window.innerHeight),e.beginPath();for(const t of r)t.move(),t.draw(e);s--,s>0?requestAnimationFrame(n):t({start:a,end:performance.now()})};requestAnimationFrame(n)}))};class JK{constructor(e){this.w=(0,E.Av)(20,70),this.h=(0,E.Av)(30,70),this.x=-this.w+Math.random()*window.innerWidth,this.y=-this.h/2+Math.random()*(window.innerHeight+this.h/2),this.speed=(0,E.Av)(1,5),this.stroke=e[Math.floor(Math.random()*e.length)]}move(){this.x+=this.speed+.5*Math.random(),this.x>window.innerWidth&&(this.x=-this.w)}draw(e){e.strokeStyle=this.stroke,e.fillRect(this.x,this.y,this.w,this.h),e.strokeRect(this.x,this.y,this.w,this.h)}}_.A.prototype.getEquipment=async function(e,t=!1){if(this.equipment&&!t)return(0,E.nB)(e);this._replaceBackground();const{CM:n,IN_D:s,IN_F:r}=this._CONST.UNITS,i={};i[n]="centimeter",i[s]="inch (decimal, e.g. 11.5 in)",i[r]="inch (fractional, e.g. 12 3/8 in)";const{value:a}=await zs.fire({...qs(this,{showIcon:!1}),title:"Do you have a ruler or tape measure?",html:"Ideally, it should be long enough to measure your viewing distance, but even a 6 inch (15 cm) ruler can be useful. Please select the units you'll use, or indicate that no ruler or tape measure is available.",input:"select",inputOptions:{...i,none:"No ruler or tape measure is available"},inputPlaceholder:"Select an option",inputValidator:e=>new Promise((t=>{e.length||t("Please select an option.");const n="none"!==e;this.newEquipmentData={value:{has:n,unit:n?e:null,equipment:n?"":null},timestamp:performance.now()},t()}))});return a?(0,E.nB)(e):void 0};var eX=__webpack_require__(2016),tX=__webpack_require__(980),nX=__webpack_require__.n(tX),sX=__webpack_require__(3890),rX=__webpack_require__.n(sX);_.A.prototype._checkScreenSize=async function(e,t,n){await this.getEquipment((()=>{iX(this,e,t,n)}))};const iX=async(e,t,n,s)=>{if(e.equipment?.value?.has){e._replaceBackground((0,E.$O)("📏 Measure the Length of the Arrow",'Use your ruler (or tape measure) to measure the length of the arrow. Type your numerical answer into the box. Just digits, period, decimal comma, and / (forward slash) for fractional inches. Then click OK or hit RETURN.'));const t=t=>[()=>{const n=document.createElement("div");e.background.appendChild(n),n.outerHTML=t},()=>{for(const t of e.background.getElementsByClassName("arrow-two-sided-svg"))t.remove()},{callback:()=>{},content:"Ruler is too short"}],n=await(0,eX.K)(e,...t(nX())),r=await(0,eX.K)(e,...t(rX())),i={};if(n){const t=n.value,s=e.windowWidthPx.value,r=(0,E.Nh)(2.54*s/e.screenPpi.value,1);i.horizontal={...t,calibratorArrowWidthCm:r,arrowWidthPx:s}}if(r){const t=r.value,n=e.windowHeightPx.value,s=(0,E.Nh)(2.54*n/e.screenPpi.value,1);i.vertical={...t,calibratorArrowHeightCm:s,arrowHeightPx:n}}if(i.vertical||i.horizontal){const t={value:i,timestamp:n?n.timestamp:r.timestamp,measure:"screenSize"};e.newCheckData=t,(0,E.nB)(s,t)}}e._removeBackground(),(0,E.nB)(t,n)};_.A.prototype._checkDistance=async function(e,t,n,s){await this.getEquipment((()=>aX(this,e,t,n,s)))};const aX=async(e,t,n,s,r)=>{const i="trackDistance"===s,a=()=>{e._removeBackground(),i||(0,E.nB)(t,n)};if(i&&(0,E.nB)(t,n),e.equipment?.value?.has){e._addBackground(),e._replaceBackground((0,E.$O)("📏 Hold Still and Measure Viewing Distance with Ruler",'Hold still so that your viewing distance from the screen stays unchanged from the last measurement. Please measure the distance from the middle of your screen to one of your eyes using your ruler (or measuring tape). If your ruler is not long enough, then select "Ruler is too short" below. Type your numerical answer into the box, then click OK or hit RETURN.'));const t=await(0,eX.K)(e,null,null,{callback:()=>{},content:"Ruler is too short"});if(t){const n={value:{...t.value,calibratorCm:e.viewingDistanceCm.value,calibratorMethod:e.viewingDistanceCm.method},timestamp:t.timestamp,measure:s};return e.newCheckData=n,a(),void(0,E.nB)(r,n)}}a()};var oX=__webpack_require__(7790),lX=__webpack_require__(627),uX=__webpack_require__.n(lX),cX=__webpack_require__(8110),hX=__webpack_require__.n(cX),dX=__webpack_require__(5072),pX=__webpack_require__.n(dX),fX=__webpack_require__(7825),mX=__webpack_require__.n(fX),gX=__webpack_require__(7659),yX=__webpack_require__.n(gX),bX=__webpack_require__(5056),wX=__webpack_require__.n(bX),vX=__webpack_require__(540),AX=__webpack_require__.n(vX),xX=__webpack_require__(1113),CX=__webpack_require__.n(xX),kX=__webpack_require__(4636),SX={};SX.styleTagTransform=CX(),SX.setAttributes=wX(),SX.insert=yX().bind(null,"head"),SX.domAPI=mX(),SX.insertStyleElement=AX();pX()(kX.A,SX);kX.A&&kX.A.locals&&kX.A.locals;_.A.prototype.removePanel=function(){return!!this._panelStatus.hasPanel&&(this._panel.panelObserver.unobserve(this._panel.panel),this._panel.panel.remove(),this._panel.panel=null,this._panel.panelObserver=null,this._panel.panelTasks=[],this._panel.panelParent=null,this._panel.panelOptions={},this._panel.panelCallback=null,this._panel.panelResolve=null,this._panelStatus.hasPanel=!1,this._panelStatus.panelFinished=!1,BX(this),!0)},_.A.prototype.resetPanel=function(e=null,t=null,n=null,s=null,r=null){if(!this._panelStatus.hasPanel)return!1;const i=e||[...this._panel.panelTasks],a=n||{...this._panel.panelOptions},o=s&&"function"==typeof s?s:this._panel.panelCallback,l=r||this._panel.panelResolve;return null!==t&&t!==this._panel.panelParent?(this.removePanel(),this.panel(i,t,a,o,l)):(BX(this),this.panel(i,this._panel.panelParent,a,o,l,!0))},_.A.prototype.panel=async function(e,t,n={},s=null,r=null,i=!1){if(this._panelStatus.hasPanel^i)return!1;if(!IX(e))return!1;const a=document.querySelector(t);if(!a)return!1;const o=Object.assign({headline:G.H.RC_panelTitle[this.L],description:G.H.RC_panelIntro[this.L],showNextButton:!1,nextHeadline:G.H.RC_panelTitleNext[this.L],nextDescription:G.H.RC_panelIntroNext[this.L],nextButton:G.H.RC_panelButton[this.L],color:"#3490de",debug:!1,i18n:!0,_demoActivateAll:!1},n),l=Tr(o.color).darken(20).toString();document.documentElement.style.setProperty("--rc-panel-theme-color",o.color),document.documentElement.style.setProperty("--rc-panel-darken-color",l),document.documentElement.style.setProperty("--rc-panel-theme-color-semi",`${o.color}66`),document.documentElement.style.setProperty("--rc-panel-darken-color-semi",`${l}88`);const u=document.createElement("div");u.className=u.id="rc-panel",this.LD===this._CONST.RTL?u.className+=" rc-lang-rtl":u.className+=" rc-lang-ltr",o.i18n&&(u.innerHTML+='
          '),u.innerHTML+=`

          ${o.headline}

          `,u.innerHTML+=`

          ${o.description}

          `,u.innerHTML+='
          ',i?a.replaceChild(u,this._panel.panel):a.appendChild(u);const c=u.querySelector("#rc-panel-steps"),h=new ResizeObserver((()=>{OX(c,u.offsetWidth,this.LD)}));if(h.observe(u),OX(c,u.offsetWidth,this.LD),0===e.length)c.className+=" rc-panel-no-steps";else for(const t in e){const n=TX(this,t,e[t],o);c.appendChild(n)}(o.showNextButton||o._demoActivateAll)&&c.appendChild(NX(e.length,o));RX(this,{index:0,finished:[]},e,o,s),this._panel.panel=u,this._panel.panelObserver=h,this._panel.panelTasks=e,this._panel.panelParent=t;const d={...o};return o.headline===G.H.RC_panelTitle[this.L]&&(d.headline=void 0),o.description===G.H.RC_panelIntro[this.L]&&(d.description=void 0),o.nextHeadline===G.H.RC_panelTitleNext[this.L]&&(d.nextHeadline=void 0),o.nextDescription===G.H.RC_panelIntroNext[this.L]&&(d.nextDescription=void 0),o.nextButton===G.H.RC_panelButton[this.L]&&(d.nextButton=void 0),this._panel.panelOptions=d,this._panel.panelCallback=s,this._panel.panelResolve=r,this._panelStatus.hasPanel=!0,this._panelStatus.panelFinished=!1,o.i18n&&zX(this,document.querySelector("#rc-panel-language-parent"),l),o.debug&&(0,oX.K)(this,u,e,s),null===r&&(r=!0),new Promise((e=>{const t=setInterval((()=>{this._panelStatus.panelFinished&&(clearInterval(t),e(r))}),100);this._panelStatus.panelResolveIntervals.push(t)}))};const _X={screenSize:{use:1,name:G.H.RC_screenSize["en-US"],phraseHandle:"RC_screenSize"},measureDistance:{use:1,name:G.H.RC_viewingDistance["en-US"],phraseHandle:"RC_viewingDistance"},trackDistance:{use:2,name:G.H.RC_distanceTracking["en-US"],phraseHandle:"RC_distanceTracking"},trackGaze:{use:2,name:G.H.RC_gazeTracking["en-US"],phraseHandle:"RC_gazeTracking"},performance:{use:1,name:G.H.RC_performance["en-US"],phraseHandle:"RC_performance"}},EX=Object.keys(_X),IX=e=>{if(!Array.isArray(e))return!1;for(const t of e){if("object"==typeof t&&(null===t||!EX.includes(t.name)))return!1;if("string"==typeof t&&!EX.includes(t))return!1}return!0},TX=(e,t,n,s)=>{let r,i;switch(_X[MX(n)].use){case 0:case 1:default:r="",i="";break;case 2:r=uX(),i=G.H.RC_panelUsesWebcam[e.L];break;case 3:r=uX()+hX(),i=G.H.RC_panelUsesWebcamPhone[e.L]}const a=document.createElement("button");return a.className="rc-panel-step rc-panel-step-todo"+(s._demoActivateAll?" rc-panel-step-active":" rc-panel-step-inactive"),a.dataset.index=t,a.innerHTML=`${r.length?`

          ${r}

          `:""}

          ${Number(t)+1}  ${G.H[_X[MX(n)].phraseHandle][e.L]}

          ${r.length?`

          ${r} ${i}

          `:""}`,a},NX=(e,t)=>{const n=document.createElement("button");return n.className="rc-panel-step rc-panel-next-button rc-panel-step-inactive",n.dataset.index=e,n.innerHTML=`

          ${t.nextButton}

          `,n},OX=(e,t,n)=>{if(t<640){e.classList.add("rc-panel-steps-s"),e.classList.remove("rc-panel-steps-l");for(const t of e.childNodes)t.classList.add(`rc-lang-${n.toLowerCase()}`)}else{e.classList.add("rc-panel-steps-l"),e.classList.remove("rc-panel-steps-s");for(const t of e.childNodes)t.classList.remove("rc-lang-ltr"),t.classList.remove("rc-lang-rtl")}},RX=(e,t,n,s,r)=>{document.querySelectorAll(".rc-panel-step").forEach(((i,a)=>{const o=Number(i.dataset.index);if(s._demoActivateAll)i.onclick=()=>{e[MX(n[a])](...FX(n[a])),DX(a),t.finished.push(MX(n[a]));for(const e of n)if(!t.finished.includes(MX(e)))return;const s=document.querySelector(".rc-panel-next-button");s.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),s.onclick=()=>{e._panelStatus.panelFinished=!0,(0,E.nB)(r,{timestamp:performance.now()})}};else if(o===t.index)if(i.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),i.focus(),o!==n.length)o!==n.length-1||s.showNextButton?i.onclick=()=>{e[MX(n[t.index])](...FX(n[t.index],(()=>{DX(t.index),t.index++,RX(e,t,n,s,r)})))}:i.onclick=()=>{e[MX(n[t.index])](...FX(n[t.index],(()=>{DX(t.index)}),r,(()=>{e._panelStatus.panelFinished=!0})))};else if(o===n.length&&s.showNextButton){const{headline:t,nextHeadline:n,description:a,nextDescription:o}=s;t!==n&&(document.querySelector("#rc-panel-title").innerHTML=n),a!==o&&(document.querySelector("#rc-panel-description").innerHTML=o),i.onclick=()=>{e._panelStatus.panelFinished=!0,(0,E.nB)(r,{timestamp:performance.now()})}}}))},DX=e=>{const t=document.querySelectorAll(".rc-panel-step");for(const n of t)Number(n.dataset.index)===e&&(n.classList.replace("rc-panel-step-todo","rc-panel-step-finished"),n.classList.replace("rc-panel-step-active","rc-panel-step-inactive"))},MX=e=>"string"==typeof e?e:e.name,FX=(e,t,n=null,s=null)=>{"string"==typeof e&&(e={name:e});const r=()=>{(0,E.nB)(t),(0,E.nB)(n,{timestamp:performance.now()}),(0,E.nB)(s)};return["screenSize","measureDistance","performance"].includes(e.name)?[e.options||{},t=>{(0,E.nB)(e.callback,t),r()}]:"trackGaze"===e.name?[e.options||{},t=>{(0,E.nB)(e.callbackOnCalibrationEnd,t),r()},e.callbackTrack||null]:"trackDistance"===e.name?[e.options||{},t=>{(0,E.nB)(e.callbackStatic,t),r()},e.callbackTrack||null]:void 0},BX=e=>{e._panelStatus.panelResolveIntervals.map((e=>clearInterval(e))),e._panelStatus.panelResolveIntervals=[]},zX=(e,t,n)=>{let s=`",t.innerHTML=s,document.querySelector("#rc-panel-lang-picker").onchange=()=>{e.newLanguage(document.querySelector("#rc-panel-lang-picker").value),e.resetPanel()}};_.A.prototype.backgroundColor=function(e=null){if(!this.checkInitialized())return null;null!==e&&/^#([0-9A-F]{3}){1,2}$/i.test(e)?this._params.backgroundColor=e:this._params.backgroundColor="#eee";const t=document.querySelector("#calibration-background");return t&&(t.style.background=this.params.backgroundColor),this.params.backgroundColor},_.A.prototype.videoOpacity=function(e=null){if(!this.checkInitialized())return null;null===e||Number(e)!==e||Number(e)>1||Number(e)<0?this._params.videoOpacity=.8:this._params.videoOpacity=e;const t=document.querySelector("#webgazerVideoContainer");return t&&(t.style.opacity=this.params.videoOpacity),this.params.videoOpacity},_.A.prototype.showCancelButton=function(e=!0){return this.checkInitialized()?(this._params.showCancelButton=!!e,this.params.showCancelButton):null};var LX=__webpack_require__(9725),PX={};PX.styleTagTransform=CX(),PX.setAttributes=wX(),PX.insert=yX().bind(null,"head"),PX.domAPI=mX(),PX.insertStyleElement=AX();pX()(LX.A,PX);LX.A&&LX.A.locals&&LX.A.locals;var VX=__webpack_require__(5151),WX={};WX.styleTagTransform=CX(),WX.setAttributes=wX(),WX.insert=yX().bind(null,"head"),WX.domAPI=mX(),WX.insertStyleElement=AX();pX()(VX.A,WX);VX.A&&VX.A.locals&&VX.A.locals;var GX=__webpack_require__(2945),UX={};UX.styleTagTransform=CX(),UX.setAttributes=wX(),UX.insert=yX().bind(null,"head"),UX.domAPI=mX(),UX.insertStyleElement=AX();pX()(GX.A,UX);GX.A&&GX.A.locals&&GX.A.locals;var qX=__webpack_require__(9057),jX={};jX.styleTagTransform=CX(),jX.setAttributes=wX(),jX.insert=yX().bind(null,"head"),jX.domAPI=mX(),jX.insertStyleElement=AX();pX()(qX.A,jX);qX.A&&qX.A.locals&&qX.A.locals;var HX=__webpack_require__(4889),$X={};$X.styleTagTransform=CX(),$X.setAttributes=wX(),$X.insert=yX().bind(null,"head"),$X.domAPI=mX(),$X.insertStyleElement=AX();pX()(HX.A,$X);HX.A&&HX.A.locals&&HX.A.locals;var KX=__webpack_require__(2636),XX={};XX.styleTagTransform=CX(),XX.setAttributes=wX(),XX.insert=yX().bind(null,"head"),XX.domAPI=mX(),XX.insertStyleElement=AX();pX()(KX.A,XX);KX.A&&KX.A.locals&&KX.A.locals;var ZX=__webpack_require__(2921),YX={};YX.styleTagTransform=CX(),YX.setAttributes=wX(),YX.insert=yX().bind(null,"head"),YX.domAPI=mX(),YX.insertStyleElement=AX();pX()(ZX.A,YX);ZX.A&&ZX.A.locals&&ZX.A.locals;var QX=__webpack_require__(7271),JX={};JX.styleTagTransform=CX(),JX.setAttributes=wX(),JX.insert=yX().bind(null,"head"),JX.domAPI=mX(),JX.insertStyleElement=AX();pX()(QX.A,JX);QX.A&&QX.A.locals&&QX.A.locals;var eZ=__webpack_require__(2551),tZ={};tZ.styleTagTransform=CX(),tZ.setAttributes=wX(),tZ.insert=yX().bind(null,"head"),tZ.domAPI=mX(),tZ.insertStyleElement=AX();pX()(eZ.A,tZ);eZ.A&&eZ.A.locals&&eZ.A.locals;var nZ=__webpack_require__(8470),sZ={};sZ.styleTagTransform=CX(),sZ.setAttributes=wX(),sZ.insert=yX().bind(null,"head"),sZ.domAPI=mX(),sZ.insertStyleElement=AX();pX()(nZ.A,sZ);nZ.A&&nZ.A.locals&&nZ.A.locals;var rZ=__webpack_require__(2535),iZ={};iZ.styleTagTransform=CX(),iZ.setAttributes=wX(),iZ.insert=yX().bind(null,"head"),iZ.domAPI=mX(),iZ.insertStyleElement=AX();pX()(rZ.A,iZ);rZ.A&&rZ.A.locals&&rZ.A.locals;var aZ=__webpack_require__(663),oZ={};oZ.styleTagTransform=CX(),oZ.setAttributes=wX(),oZ.insert=yX().bind(null,"head"),oZ.domAPI=mX(),oZ.insertStyleElement=AX();pX()(aZ.A,oZ);aZ.A&&aZ.A.locals&&aZ.A.locals;var lZ=__webpack_require__(5319),uZ={};uZ.styleTagTransform=CX(),uZ.setAttributes=wX(),uZ.insert=yX().bind(null,"head"),uZ.domAPI=mX(),uZ.insertStyleElement=AX();pX()(lZ.A,uZ);lZ.A&&lZ.A.locals&&lZ.A.locals;var cZ=__webpack_require__(290),hZ={};hZ.styleTagTransform=CX(),hZ.setAttributes=wX(),hZ.insert=yX().bind(null,"head"),hZ.domAPI=mX(),hZ.insertStyleElement=AX();pX()(cZ.A,hZ);cZ.A&&cZ.A.locals&&cZ.A.locals;const dZ=new _.A;dZ.gazeTracker=new ZK(dZ);const pZ=dZ})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); //# sourceMappingURL=RemoteCalibrator.min.js.map \ No newline at end of file diff --git a/lib/RemoteCalibrator.min.js.LICENSE.txt b/lib/RemoteCalibrator.min.js.LICENSE.txt index eb42d10..133d615 100644 --- a/lib/RemoteCalibrator.min.js.LICENSE.txt +++ b/lib/RemoteCalibrator.min.js.LICENSE.txt @@ -8,7 +8,7 @@ /*! * * @license - * EasyEyes Remote Calibrator (remote-calibrator) Version 0.7.15 + * EasyEyes Remote Calibrator (remote-calibrator) Version 0.7.16 * https://github.com/EasyEyes/remote-calibrator * * Copyright 2024 New York University. All Rights Reserved diff --git a/package.json b/package.json index 7dbeb0c..75cf385 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remote-calibrator", - "version": "0.7.15", + "version": "0.7.16", "description": "Useful calibration tools for remote psychophysics experiments", "main": "lib/RemoteCalibrator.min.js", "directories": {